Sferalabs Strato Pi UPS User manual

"
Strato Pi Logic Controller
Advanced Configuration Guide
October 2019
Revision 006
MCU firmware version 4.1
"

Introduction 3
Command syntax 4
Raspbian software serial implementations 5
RS-485 control commands 5
XSMn - RS-485 TX-Enable Mode (*) 5
XSPrbps - RS-485 communication parameters (*) 6
Shutdown parameters 7
XPEn - shutdown enable mode (*) 7
XPWnnnnn - shutdown wait time (*) 8
XPOnnnnn - power-off time (*) 8
XPUnnnnn - power-up delay (*) 8
XPPn - power-up mode (Strato Pi UPS only) (*) 9
Watchdog parameters 9
XWEn - watchdog enable mode (*) 10
XWHnnnnn - watchdog heartbeat timeout (*) 10
XWWnnnnn - watchdog forced shutdown timeout (*) 10
UPS Parameters (Strato Pi UPS only) 11
XUBnnnnn - UPS automatic power off (*) 11
Dual microSD cards routing (Strato Pi CM Duo only) 12
XSDPn - Power up routing 12
XSDRn - run-time SDX/SD1 interfaces routing 13
XPSDn - Toggle SDX/SD1 interfaces routing at next power-cycle 13
XWSDn - toggle SDX/SD1 interfaces routing after n watchdog resets 13
XSD0n - SDX enable (*) 13
XSD1n - SD1 enable (*) 14
Permanently saving the current configuration 14
XCCn - persistent configuration 14
Firmware version information 14
XFW? - read firmware version 14
Firmware upload 15
XBOOT - enter boot loader mode 16
XBW - write MCU flash memory 16
XBR - read from MCU flash memory 16
The Strato Pi ICSP header 17
Document revision history 18
1
Strato Pi Logic Controller

Sfera Labs S.r.l. may make changes to specifications and product descriptions at any time,
without notice. The product information on the web site or materials is subject to change
without notice.
Please download and read the Sfera Labs Terms and Conditions document available at:
https://www.sferalabs.cc
Strato and Sfera Labs are trademarks of Sfera Labs S.r.l. Other brands and names may be
claimed as the property of others.
#
Copyright © 2018-2019 Sfera Labs S.r.l. All rights reserved.
2
Strato Pi Logic Controller

Introduction
This document describes the features of the PIC MCU firmware version 4.0 used in the
1
following Strato Pi versions:
•Strato Pi Base
•Strato Pi UPS
•Strato Pi CAN
•Strato Pi CM
•Strato Pi CM Duo.
The MCU firmware implements all low-level control features of the Strato Pi boards,
including:
•RS-485 TX-enable management
•Hardware watchdog
•Hardware power cycle or Pi's reset
•UPS management
•Dual microSD card support
•MCU firmware upload from the Raspberry Pi.
Some of these features are only supported on specific models and hardware revisions of
the Strato Pi boards.
A simple ASCII-based serial command protocol between the Raspberry Pi and PIC MCU
implements all configuration and control commands.
RS-485
Watchdog
Power/Reset
UPS
Dual SD
FW upload
Base ≤2.2
✔
✔
✔
Base ≥3.0
✔
✔
✔
✔
UPS ≤2.2
✔
✔
✔
✔
UPS ≥3.0
✔
✔
✔
✔
✔
CAN
✔
✔
✔
CM
✔
✔
✔
CM Duo
✔
✔
✔
✔
✔
You can check the factory installed version of the Strato Pi controller firmware from the label
1
attached to the back of the Strato Pi board. After the first two alphabetic characters (representing
the assembly facility), the third and fourth are the firmware version and subversion numbers.
3
Strato Pi Logic Controller

This serial protocol is implemented over two of the Pi's GPIO pins, one used as the TX line
and the other as RX. The GPIO pins are specific for each Strato Pi version.
Communication speed is fixed at 1200 8N1.
The PIC always starts with both AN10/RB4 and AN11/RB5 configured as inputs. When the
PIC senses a valid command and has to reply, it will switch AN10/RB4 to output and keep
it as output indefinitely.
The different versions of Strato Pi also use different GPIO pins for the various control lines.
The following table highlights the features that are controlled by different GPIO pins on
different versions:
Command syntax
Commands are always initiated by the Pi. PIC will only reply when a valid command is
received.
All commands start with the "X" ASCII character, followed by the command identifier and
arguments. No command termination character is required. The PIC replies after the last
character forming a valid command and argument is received. It does not reply to an
invalid command.
CR/LF characters are always ignored.
Pi TX
Pi RX
MCU TX
MCU RX
Base
GPIO13
GPIO19
RB4
RB5
UPS
GPIO13
GPIO19
RB4
RB5
CAN
GPIO13
GPIO19
RB4
RB5
CM
GPIO23
GPIO24
RB4
RB5
CM Duo
GPIO37
GPIO33
RB4
RB5
Shutdown
Enable
Watchdog
Enable
Watchdog
Heartbeat
Watchdog
Timeout
Base
GPIO16
GPIO6
GPIO5
GPIO12
UPS
GPIO16
GPIO6
GPIO5
GPIO12
CAN
GPIO16
GPIO6
GPIO5
GPIO12
CM
GPIO18
GPIO22
GPIO27
GPIO17
CM Duo
GPIO18
GPIO39
GPIO32
GPIO17
MCU
RC3
RB7
RC4
RB6
4
Strato Pi Logic Controller

There is a 5 seconds character timeout when receiving commands. If a character is not
received for 5 seconds since the previous character, the command buffer will be reset, and
the PIC will start looking for a new "X" ASCII command header character.
All commands use upper case characters only. Lower case characters won't match.
The configuration parameters corresponding to commands marked with (*) are retained
only until the next power-cycle, unless persisted in memory. If not persisted, the
parameters will be reset to the original factory defaults, or to the previously saved user
configuration. Refer to the "Permanently saving the current configuration" chapter for more
details.
Raspbian software serial implementations
There are a few software serial Linux modules implementations for Raspbian. An open-
source module is available on GitHub at: https://github.com/sfera-labs/soft_uart
After the module is compiled and installed, it can be loaded and configured to use the
appropriate GPIO pins, for example:
sudo insmod soft_uart.ko gpio_tx=13 gpio_rx=19
To load the module automatically at boot, add the line:
soft-uart
to /etc/modules, and create a new file /etc/modprobe.d/soft_uart.conf to set the module
options, with the appropriate GPIO numbers, for example:
options soft_uart gpio_tx=13 gpio_rx=19
The protocol is human readable, you can test it with minicom or any other terminal
program:
minicom -b 1200 -D /dev/ttySOFT0
On a Raspberry Pi Model 3 B+ and Raspbian, it has been tested successfully at speeds
up to 19200. Data transfer becomes unreliable at or above 38400.
A different software serial implementation is the pigpio Python module: http://abyz.me.uk/
rpi/pigpio/python.html
RS-485 control commands
XSMn - RS-485 TX-Enable Mode (*)
Set the TX-Enable operations mode.
5
Strato Pi Logic Controller

XSPrbps - RS-485 communication parameters (*)
Used when TX-Enable operation mode is set to fixed with the XSMF command, must be
set to the Pi's UART baud rate, number of bits per character, parity mode and number of
stop bits.
For example, the command XSP58N1 sets the communication parameters to the original
factory default configuration: 9600 bps, 8 bits, no parity and 1 stop bit.
Command
Description
Reply
XSMA
Set TX-Enable automatic mode (factory default)
XSMA
XSMP
Set TX-Enable passive mode
XSMP
XSMF
Set TX-Enable fixed speed mode. In this mode, TX-Enable
timing is based on speed, number of bits, parity and number of
stop bits set using the control protocol
XSMF
XSM?
Return current mode
XSMn
Command
Description
Reply
XSPrbps
Set RS-485 communication parameters: speed, number of bits,
parity and number of stop bits for TX-Enable fixed speed mode
XSPrbps
XSP?
Return current communication parameters
XSPrbps
[r] parameter
Description
Reply
2
1200 bps
XSP2bps
3
2400 bps
XSP3bps
4
4800 bps
XSP4bps
5
9600 bps (factory default)
XSP5bps
6
19200 bps
XSP6bps
7
38400 bps
XSP7bps
8
57600 bps
XSP8bps
9
115200 bps
XSP9bps
[b] parameter
Description
Reply
7
7 bit
XSPr7ps
8
8 bit (factory default)
XSPr8ps
6
Strato Pi Logic Controller

Shutdown parameters
You can start a delayed power-cycle by rising Raspberry Pi’s ShutdownEnable pin.
When ShutdownEnable is set to high for at least one second, Strato Pi will wait 60
seconds (configurable with the XPWnnnnn command) and then power off the Pi board for
at least 5 seconds (configurable with the XPOnnnnn command). In the alternative "arm
mode", setting ShutdownEnable high will arm the shutdown procedure, but will not start
the power-cycle until ShutdownEnable goes low.
After being powered off, the Strato Pi UPS board will supply power to the Raspberry Pi
only when the main power source is restored (the XPPA command can change this
behavior, so that the Strato Pi UPS board will always power up the Raspberry Pi board
after a power cycle, even when powered by the battery).
XPEn - shutdown enable mode (*)
Set the shutdown enable mode.
In the default mode, the power-cycle is activated rising the Raspberry Pi’s
ShutdownEnable pin.
In the alternative "arm mode", setting ShutdownEnable high will arm the shutdown
procedure, but will not start the power-cycle until ShutdownEnable goes low. After the line
goes low, Strato Pi will wait 60 seconds (configurable with the XPWnnnnn command) and
then power off the Pi board for at least 5 seconds (configurable with the XPOnnnnn
command).
Note that, if the watchdog is enabled in "arm mode", it will remain active while
ShutdownEnable is high (armed).
Using the alternate "arm mode" a shorter shutdown wait time could be configured, then
ShutdownEnable set high immediately before starting the OS shutdown procedure. The
ShutdownEnable pin should go low automatically when the CPU is halted, so that the
power cycle will occur shortly after. If the shutdown procedure fails to complete, the
watchdog will still intervene to prevent an indefinite lock.
[p] parameter
Description
Reply
N
No parity (factory default)
XSPrbNs
E
Even parity
XSPrbEs
O
Odd parity
XSPrbOs
[s]
Description
Reply
1
1 stop bit (factory default)
XSPrbp1
2
2 stop bits
XSPrbp2
7
Strato Pi Logic Controller

XPWnnnnn - shutdown wait time (*)
Set the shutdown wait time, in seconds.
XPOnnnnn - power-off time (*)
Set the power-off time, in seconds.
XPUnnnnn - power-up delay (*)
Set the power-up delay, in seconds.
After being powered off, the Strato Pi board will supply power to the Raspberry Pi (or
release the reset line of Raspberry Pi Compute Module) only when the main power source
is restored for at least the number of seconds set with XPUnnnnn, or immediately (factory
default) if the power-on delay is set to 0.
Command
Description
Reply
XPEI
When ShutdownEnable is set to high, Strato Pi will immediately
initiate the power-cycle, wait 60 seconds (configurable with
XPWnnnnn) and then power off the Pi board for at least 5
seconds (configurable with XPOnnnnn) (factory default)
XPEI
XPEA
Setting ShutdownEnable high will arm the shutdown procedure,
but will not start the power-cycle until ShutdownEnable goes low.
After the line goes low, Strato Pi will wait 60 seconds
(configurable with XPWnnnnn) and then power off the Pi board
for at least 5 seconds (configurable with XPOnnnnn)
XPEA
XPE?
Return current shutdown enable mode
XPEn
Command
Description
Reply
XPWnnnnn
Set the shutdown wait time, in seconds (factory default is 60,
XPW00060). Min: 1; Max: 99999
XPWnnnnn
XPW?
Return current shutdown wait time
XPWnnnnn
Command
Description
Reply
XPOnnnnn
Set the power-off time, in seconds (factory default is 5,
XPW00005). Min: 1; Max: 99999
XPOnnnnn
XPO?
Return current power-off time
XPOnnnnn
Command
Description
Reply
XPUnnnnn
Set the power-up delay, in seconds (factory default is 0,
XPU00000). Min: 0; Max: 99999
XPUnnnnn
XPU?
Return current power-up delay
XPUnnnnn
8
Strato Pi Logic Controller

XPPn - power-up mode (Strato Pi UPS only) (*)
Set the power-up mode.
If the ShutdownEnable pin is set to high when the main power is not present, the
Raspberry Pi and the whole Strato UPS board will be powered down after the shutdown
wait time, and turned on again only when the main power is restored.
You can change this behavior so that only the Raspberry Pi is turned off, and the power is
always restored after the power-off time, even if running on battery, with no main power
present.
Watchdog parameters
The watchdog is normally disabled. To enable it, set the WatchdogEnable pin to high (the
XWEA command can change this behavior, so that the watchdog is always enabled, and
the level of the WatchdogEnable pin is ignored).
While WatchdogEnable is high, the Strato Pi controller will watch for state changes of the
WatchdogHeartbeat pin.
You should ensure that WatchdogHeartbeat flips its state between high and low faster than
every 60 seconds (the watchdog heartbeat timeout is configurable with the XWHnnnnn
command).
If the Strato Pi UPS controller doesn’t see WatchdogHeartbeat changing state for more
than 60 seconds, it will initiate a shutdown procedure, rising the WatchdogTimeout pin to
high, to signal that a watchdog timeout has occurred.
If possible, you should immediately initiate a software shutdown on Raspberry Pi, and set
the ShutdownEnable pin to high.
When ShutdownEnable is set to high or 60 seconds after the timeout (configurable with
the XWWnnnnn command), Strato Pi will wait 60 seconds more (configurable with the
XPWnnnnn command, see the shutdown wait time above), then power cycle the
Raspberry Pi.
Command
Description
Reply
XPPA
If the ShutdownEnable pin is set to high when the main power is
not present, only the Raspberry Pi is turned off, and the power is
always restored after the power-off time, even if running on
battery, with no main power present
XPPA
XPPM
If the ShutdownEnable pin is set to high when the main power is
not present, the Raspberry Pi and the Strato UPS board is
powered down after the shutdown wait time, and turned on again
only when the main power is restored (factory default)
XPPM
XPP?
Return current power-up mode
XPPn
9
Strato Pi Logic Controller

XWEn - watchdog enable mode (*)
Set the watchdog enable mode.
XWHnnnnn - watchdog heartbeat timeout (*)
Set the watchdog heartbeat timeout.
If the watchdog heartbeat timeout is not persisted (see the "Permanently saving the
current configuration" paragraph), it is reverted to the saved value when the next power-
cycle occurs.
This allows, for example, to have a long timeout by default, that is reset to a much shorted
value when the application that handles the heartbeat signal has started.
When the watchdog is always enabled (XWEA command), the factory default or user
defined configuration of the watchdog heartbeat timeout will be forced to 60 seconds if set
to a lower value.
XWWnnnnn - watchdog forced shutdown timeout (*)
Set the watchdog forced shutdown timeout.
Command
Description
Reply
XWED
Watchdog is normally disabled (factory default)
XWED
XWEA
Watchdog is always enabled
XWEA
XWE?
Return current watchdog enable mode
XWEn
Command
Description
Reply
XWHnnnnn
Set the watchdog heartbeat timeout, in seconds (factory default
is 60, XWH00060). Min: 1; Max: 99999
XWHnnnnn
XWH?
Return current watchdog heartbeat timeout
XWHnnnnn
Command
Description
Reply
XWWnnnnn
Forced shutdown delay from the moment the timeout is expired
and the shutdown cycle has not been enabled, in seconds
(factory default is 60, XWW00060). Min: 1; Max: 99999
XWWnnnnn
XWW?
Return current watchdog forced shutdown timeout
XWWnnnnn
10
Strato Pi Logic Controller

UPS Parameters (Strato Pi UPS only)
In its factory default configuration, Strato Pi UPS doesn't automatically power down the
Raspberry Pi when the main power source is not available.
It is the user application that, after being notified that the it is running on battery power via
the BatteryPower pin, will have to initiate a delayed power-cycle setting the
ShutdownEnable pin to high.
This can be changed with the XUBnnnnn command.
XUBnnnnn - UPS automatic power off (*)
Set the UPS automatic power-off timer.
Command
Description
Reply
XUBnnnnn
Set the UPS automatic power off timeout, in seconds. Strato Pi
UPS will automatically initiate a delayed power-cycle (just like
when GPIO16 is set high) if the main power source is not
available for the number of seconds set with this command. Min:
1; Max: 99999
XUBnnnnn
XUB00000
UPS automatic power off disabled (factory default)
XUB00000
XUB?
Return current UPS automatic power off configuration
XUBnnnnn
11
Strato Pi Logic Controller

Dual microSD cards routing (Strato Pi CM Duo only)
Strato Pi CM Duo allows the two SD interfaces of the Raspberry Pi Compute Module Lite
to be routed to two external microSD cards.
The primary SD interface of the Raspberry Pi Compute Module Lite is called SDX. This
interface is used for the SD card where the boot partition must be found to boot the
system, and must remain connected to SD card at all times while the OS is running.
A secondary SD interface is called SD1. This interface can be used to connect a second
SD card where other, non boot partitions, can be present.
The two microSD slots of Strato Pi CM Duo are called SDA and SDB.
Strato Pi CM Duo has a high speed 2x2 hardware matrix, that can be configured to
independently enable the data lines to and from SDX and SD1, and to define which SD
slot is routed to SDX and SD1.
The default configuration is to have SDX enabled and routed to SDA, and SD1 disabled.
This is the firmware factory configuration, and is also forced in hardware when the MCU
pins are high impedance.
Control of the 2x2 matrix is based on three pins of the MCU:
These pins can be directly controlled, or configured to be set to the desired state during
the next power cycle, using dedicated commands. It is also possible to configure the
watchdog to switch the SDX interface to the other SD card slot if a watchdog timeout
occurs.
XSDPn - Power up routing
Set the SDX/SD1 interfaces routing at power up.
MCU pin
High
Low
RA5
SDX interface enabled
(default)
SDX interface disabled
RC0
SD1 interface enabled
SD1 interface disabled
(default)
RA4
SDX to SDB
SD1 to SDA
SDX to SDA
SD1 to SDB
(default)
Command
Description
Reply
XSDPA
set SDA to SDX bus, SDB to SD1 (RA4 = L) at power up (factory
default)
XSDPA
XSDPB
set SDA to SD1 bus, SDB to SDX (RA4 = H) at power up
XSDPB
XSDP?
return SDA/SDB routing mode set for next power up
XSDPn
12
Strato Pi Logic Controller

XSDRn - run-time SDX/SD1 interfaces routing
Immediately set the SDX/SD1 interfaces routing switch (RA4) to SDA/SDB.
This command can be used only with CMs with embedded eMMC, and only when the SD
card routed to SD1 is not mounted. The CM Lite versions running Linux would not tolerate
a hot swap of the root file system SD card.
XPSDn - Toggle SDX/SD1 interfaces routing at next power-cycle
Toggle the SDX/SD1 interfaces routing switch (RA4) to SDA/SDB at next power-cycle.
XWSDn - toggle SDX/SD1 interfaces routing after n watchdog resets
Toggle the SDX/SD1 interfaces routing switch (RA4) to SDA/SDB after n consecutive
watchdog resets.
XSD0n - SDX enable (*)
Immediately enable/disable the SDX interface (RA5).
This command may be used with the CM Lite only with bare-metal OS versions or when
the OS runs entirely in RAM, as the OS would not tolerate the hot loss of its file system. It
has no effect with CMs with embedded eMMC.
Command
Description
Reply
XSDRA
Immediately set SDA to SDX bus, SDB to SD1 (RA4 = L)
(factory default)
XSDRA
XSDRB
Immediately set SDA to SD1 bus, SDB to SDX (RA4 = H)
XSDRB
XSDR?
return current SDX/SD1 routing
XSDRn
Command
Description
Reply
XPSD1
enable boot SD toggle at power cycle
XPSD1
XPSD0
disable boot SD toggle at power cycle (factory default)
XPSD0
XPSD?
return boot SD toggle at power cycle mode
XPSDn
Command
Description
Reply
XWSD0
SD switch on watchdog reset disabled (factory default)
XWSD0
XWSDn
(n>0) switch boot from SDA/SDB after n consecutive watchdog
resets, if no heartbeat is detected. A value of n > 1 can be used
with XWEA only; if the watchdog enable mode is set to XWED,
then XWSD1 is forced automatically
XWSDn
XWSD?
return current watchdog SD toggle mode
XWSDn
13
Strato Pi Logic Controller

XSD1n - SD1 enable (*)
Immediately enable/disable the SD1 interface (RC0).
Permanently saving the current configuration
The configuration parameters corresponding to commands marked with (*) are retained
only until the next power-cycle, unless persisted in memory. If not persisted, the
parameters will be reset to the original factory defaults, or to the previously saved user
configuration.
Note: the Strato Pi controller's permanent memory can only accept up to 100.000 writes
throughout the component's lifetime.To prevent damaging the memory the XCCS and
XCCR commands should be executed with a frequency such as to avoid exceeding the
maximum number of total memory writes.
XCCn - persistent configuration
Permanently save the current configuration as the new factory default, or restore the
original factory settings.
Firmware version information
XFW? - read firmware version
Returns the firmware version.
Command
Description
Reply
XSD01
enable SDX (RA5 = H) (factory default)
XSD01
XSD00
disable SDX (RA5 = L)
XSD00
XSD0?
return SDX enable status
XSD0n
Command
Description
Reply
XSD11
enable SD1 (RC0 = H)
XSD11
XSD10
disable SD1 (RC0 = L) (factory default)
XSD10
XSD1?
return SD1 enable status
XSD0n
Command
Description
Reply
XCCS
Permanently save the current configuration as the new factory
default
XCCS
XCCR
Permanently restore the original factory settings
XCCR
14
Strato Pi Logic Controller

Firmware upload
The firmware upload feature is supported with firmware version 4.0 or later, on Strato Pi
Base/UPS revision 3.0 or later and Strato Pi CM Duo.
It is based on a factory pre-loaded boot loader in the MCU.
The boot loader code is stored in the address range 0x0000 - 0x05BF. This area is write
protected, and cannot be altered uploading data within this range via the boot loader itself.
The 64 bytes at 0x05C0 - 0x05FF are reserved to the code upload validation.
User firmware is loaded from address 0x0600 up.
The firmware upload process should follow these steps:
•Request firmware upload (boot loader mode)
•Set ShutdownEnable line high and keep it high for at least 5 seconds
2
•Erase the firmware code validation area, writing the 64 bytes at 0x05C0 - 0x05FF to
0xFF
•Write firmware code from address 0x0600 up, in 64 bytes segments
Command
Description
Reply
XFW?
With firmware versions < 4.0, returns the firmware version.
<m> is the major version number, <n> is the minor version
number
XFWm.n
With firmware versions ≥4.0, returns the firmware version and
hardware model code.
<m> is the major version number, <n> is the minor version
number, <h> is the numeric hardware model code
XFWm.n/h
Hardware model
Code
Strato Pi Base rev. < 3.0
01
Strato Pi UPS rev. < 3.0
02
Strato Pi CAN
03
Strato Pi CM
04
Strato Pi Base rev. ≥3.0
05
Strato Pi UPS rev. ≥3.0
06
Strato Pi CM Duo
07
The ShutdownEnable line is used during the firmware upload process in a different way than the
2
normal request to power cycle the Pi. Here a high to low transition of this line is interpreted as the
end of the upload process, and triggers the MCU's reset and restart with the new firmware.
15
Strato Pi Logic Controller

•Read back the written code for validation
•Confirm the uploaded code by writing the 0x05C0 - 0x05FF validation area
•Set ShutdownEnable line low for at least 5 seconds (or simply shut down the Pi) to reset
the MCU and activate the new firmware.
If the MCU is reset (or power-cycled) and the firmware validation area is not correct, the
boot loader will automatically enter boot mode, and user firmware will not be executed,
effectively disabling all the features in Strato that are controlled by the MCU.
Note that the Raspberry Pi in Strato Pi Base, UPS and CAN will be switched off while the
MCU is reset.
On Strato Pi CM and Strato Pi CM Duo, the Compute Module will be reset instead of being
switched off. After the reset, SD routing will be set based on the power-up configuration.
XBOOT - enter boot loader mode
Enter boot loader mode.
XBW - write MCU flash memory
Writes the MCU flash memory, in 64 bytes segments.
This command uses binary data, not only ASCII characters.
XBR - read from MCU flash memory
Read data from the MCU flash memory, in 64 bytes segments.
This command uses binary data, not only ASCII characters.
Command
Description
Reply
XBOOT
If not already in boot loader mode, enter boot loader mode
XBOOTOK
If already in boot loader mode, remain in this mode
XBOOTIN
Command
Description
Reply
XBW<Ah><Al
><D1>...<D64
><Ch><Cl>
<Ah> is the most significant byte of the starting address
<Al> is the least significant byte of the starting address
<D1>...<D64> are 64 bytes
<Ch> is the most significant byte of the command checksum (1-
complement sum of all data in this command, including the XBW
command header
<Cl> is the least significant byte of the command checksum
XBWOK
XBWKO (error)
Command
Description
Reply
XBR<Ah><Al>
<n>
<Ah> is the most significant byte of the starting address
<Al> is the least significant byte of the starting address
<n> is the number of bytes to read (1 ≤n ≤64)
XBR<Ah><Al><D1>...
<D64><Ch><Cl>
16
Strato Pi Logic Controller

The Strato Pi ICSP header
The Strato Pi Base, UPS, CAN and CM have a programming header that can be used to
flash the MCU firmware.
The MCU can be powered from the ICSP header at 3.3V, otherwise the Strato Pi board
must be powered through its power supply input.
Note: improper wiring of the ICSP connections, or using a supply voltage different
from 3.3V may damage the Strato Pi board, the Raspberry Pi or the programmer, and
voids the product warranty.
Note: Sfera Labs is not responsible for malfunction of damage caused by firmware
uploaded by the customer.
17
Strato Pi Logic Controller

Document revision history
•001 - Nov 24, 2018 - Fw. 3.1
•Initial public release
•002 - Jan 4, 2019 - Fw. 3.2
•New XFW? command: returns the firmware version
•New XPEn command: shutdown enable mode
•New XPUnnnnn command: power-up delay (Strato Pi UPS only)
•ICSP header information added
•003 - July 1, 2019 - Fw. 3.3
•Fixed a minor TX-Enable bug that could cause an erratic control of the TX-Enable
immediately after switching between passive and automatic mode. Normal operating
conditions are restored after a power cycle
•004 - July 31, 2019 - Fw. 3.4
•Fixed a bug that caused a false watchdog activation immediately after power-up with
the watchdog always enabled (XWEA)
•005 - September 2, 2019 - Fw. 4.0
•New Strato Pi CM Duo commands for dual SD card support
•New firmware upload commands
•New watchdog forced shutdown timeout command (XWWnnnnn)
•Hardware model code added in read firmware version command (XFW?) response
•006 - October 9, 2019 - Fw. 4.1
•Fixed watchdog heartbeat timeout configuration bug (XWHnnnnn command)
introduced in firmware version 4.0 that caused the watchdog heartbeat timeout default
setting to be forced to 60 if set to a lower value even when the watchdog was set to
normally disabled mode (XWED)
18
Strato Pi Logic Controller
Other manuals for Strato Pi UPS
3
This manual suits for next models
4
Table of contents