Namespace OpenSkyhawk::Boot
Namespace List > OpenSkyhawk > Boot
Classes
| Type | Name |
|---|---|
| struct | BootloaderInfo |
Public Types
| Type | Name |
|---|---|
| enum uint8_t | AnnounceField Byte offsets in ANNOUNCE / CONNECTED. |
| enum uint8_t | BootState Why the board is in its bootloader ( AnnounceField::STATE ). |
| enum uint8_t | Cmd |
| enum uint8_t | Reply |
| enum uint8_t | Status Result byte of BEGUN / BLOCK_ACK / ENDED / GOING. |
Public Attributes
| Type | Name |
|---|---|
| constexpr uint16_t | ANNOUNCE_INTERVAL_MS = 1000 |
| constexpr uint8_t | ANNOUNCE_LEN = 8 |
| constexpr uint32_t | APP_OFFSET = [**BOOTLOADER\_SIZE**](namespaceOpenSkyhawk_1_1Boot.md#variable-bootloader_size) |
| constexpr uint8_t | ATTEMPTS_BKP_REGISTER = 2 |
| constexpr uint8_t | ATTEMPT_LIMIT = 3 |
| constexpr uint16_t | BLOCK_SIZE = 64 |
| constexpr uint32_t | BOOTLOADER_SIZE = 0x10004 KB = one F103 write-protect block; apps start here |
| constexpr uint16_t | BRIDGE_ENTER_EXPORT_ADDRESS = 0xFF02 |
| constexpr uint16_t | CATCH_WINDOW_MS = 200after every reset, a CONNECT on BOOT_CMD_n keeps the board here (#364) |
| constexpr uint16_t | CMD_ID_BASE = 0x740BOOT_CMD_n = 0x740 + n — host (bridge) → node n's bootloader. |
| constexpr uint8_t | DATA_BYTES = 7payload bytes per DATA frame (byte 0 = Cmd::DATA_k) |
| constexpr uint8_t | DATA_FRAMES = 10DATA frames per block (70 bytes carried, 64 used) |
| constexpr uint8_t | ENTRY_BKP_REGISTER = 1 |
| constexpr uint16_t | ENTRY_MAGIC = 0xB007 |
| constexpr uint16_t | IDLE_TIMEOUT_MS = 30000REQUESTED / CAUGHT with no command this long → back to the app (#364) |
| constexpr uint32_t | INFO_ADDRESS = 0x08000FF0 |
| constexpr uint32_t | INFO_MAGIC = 0x4C42534Fu"OSBL" in memory order |
| constexpr uint8_t | PROTOCOL_VERSION = 1Bumped on any change to the frames below. A board reports it in READY_n byte 3 (#365); 0 = no bootloader. |
| constexpr uint8_t | RELAY_ESCAPE = 0x56 |
| constexpr uint8_t | RELAY_ESC_55 = 0x01after RELAY_ESCAPE: decodes to 0x55 |
| constexpr uint8_t | RELAY_ESC_56 = 0x02after RELAY_ESCAPE: decodes to 0x56 |
| constexpr uint16_t | RELAY_EXPORT_ADDRESS = 0xFF10 |
| constexpr uint8_t | RELAY_EXPORT_WORDS = 320xFF10-0xFF4F: 64 bytes per record |
| constexpr uint8_t | RELAY_FRAME_MARK = 0xE0| len: a frame starts |
| constexpr uint16_t | RSP_ID_BASE = 0x780BOOT_RSP_n = 0x780 + n — node n's bootloader → host. |
| constexpr uint32_t | SERIAL_BAUD = 250000 |
| constexpr uint8_t | SERIAL_FRAME_START = 0xAA |
| constexpr uint8_t | TRANSPORT_CAN = 0x01BOOT_CMD_n / BOOT_RSP_n — the node build. |
| constexpr uint8_t | TRANSPORT_SERIAL = 0x02USART2 to the Gateway's RP2040 — the bridge build. |
| constexpr uint32_t | UID_ADDRESS = 0x1FFFF7E8the F103's 96-bit unique ID |
| constexpr uint16_t | UNCONFIGURED_CMD_ID = 0x7C0 |
| constexpr uint16_t | UNCONFIGURED_RSP_ID = 0x7C1A bootloader with no NODE_ID yet (option byte Data0 = 0xFF, no valid app) announces here. |
| constexpr uint8_t | WINDOW_BLOCKS = 4 |
Public Functions
| Type | Name |
|---|---|
| constexpr uint16_t | canIdBootCmd (uint8_t n) BOOT_CMD_n for node n (0x740-0x77F). |
| constexpr uint16_t | canIdBootRsp (uint8_t n) BOOT_RSP_n for node n (0x780-0x7BF). |
Public Types Documentation
enum AnnounceField
Byte offsets in ANNOUNCE / CONNECTED.
enum OpenSkyhawk::Boot::AnnounceField {
CODE = 0,
PROTOCOL = 1,
ID = 2,
KIND = 3,
STATE = 4,
FLASH_KB = 5,
UID16 = 6
};
enum BootState
Why the board is in its bootloader ( AnnounceField::STATE ).
enum OpenSkyhawk::Boot::BootState {
REQUESTED = 0x01,
APP_INVALID = 0x02,
UNCONFIGURED = 0x03,
APP_UNSTABLE = 0x04,
CAUGHT = 0x05
};
enum Cmd
enum OpenSkyhawk::Boot::Cmd {
CONNECT = 0x01,
BEGIN = 0x02,
BLOCK = 0x10,
DATA_0 = 0x20,
DATA_9 = 0x29,
END = 0x30,
GO = 0x40,
SET_NODE_ID = 0x50
};
enum Reply
enum OpenSkyhawk::Boot::Reply {
CONNECTED = 0x81,
BEGUN = 0x82,
BLOCK_ACK = 0x90,
ANNOUNCE = 0xA0,
ENDED = 0xB0,
GOING = 0xC0,
NODE_SET = 0xD0
};
enum Status
Result byte of BEGUN / BLOCK_ACK / ENDED / GOING.
enum OpenSkyhawk::Boot::Status {
OK = 0x00,
BAD_CRC = 0x01,
FLASH_ERROR = 0x02,
OUT_OF_RANGE = 0x03,
OUT_OF_ORDER = 0x04,
NO_APP = 0x05,
BAD_IMAGE = 0x06,
WRONG_NODE = 0x07,
WRONG_KIND = 0x08
};
Public Attributes Documentation
variable ANNOUNCE_INTERVAL_MS
constexpr uint16_t OpenSkyhawk::Boot::ANNOUNCE_INTERVAL_MS;
variable ANNOUNCE_LEN
constexpr uint8_t OpenSkyhawk::Boot::ANNOUNCE_LEN;
variable APP_OFFSET
constexpr uint32_t OpenSkyhawk::Boot::APP_OFFSET;
variable ATTEMPTS_BKP_REGISTER
constexpr uint8_t OpenSkyhawk::Boot::ATTEMPTS_BKP_REGISTER;
Crash-loop counter (#364): the bootloader adds one before every jump to the app; the app sets it back to 0 once it is healthy (STM32Board::markBootHealthy()). At ATTEMPT_LIMIT the bootloader stays (BootState::APP_UNSTABLE). Cleared by a committed image and by GO; lost on a power cycle.
variable ATTEMPT_LIMIT
constexpr uint8_t OpenSkyhawk::Boot::ATTEMPT_LIMIT;
variable BLOCK_SIZE
constexpr uint16_t OpenSkyhawk::Boot::BLOCK_SIZE;
bytes per block; the image is padded with 0xFF to a whole block
variable BOOTLOADER_SIZE
4 KB = one F103 write-protect block; apps start here
constexpr uint32_t OpenSkyhawk::Boot::BOOTLOADER_SIZE;
variable BRIDGE_ENTER_EXPORT_ADDRESS
constexpr uint16_t OpenSkyhawk::Boot::BRIDGE_ENTER_EXPORT_ADDRESS;
A host writes this export address (any value) to ask the bridge's app to reset into its bootloader — the bridge's counterpart of a node's CONNECT on BOOT_CMD_n. Honoured only with a bootloader installed.
variable CATCH_WINDOW_MS
after every reset, a CONNECT on BOOT_CMD_n keeps the board here (#364)
constexpr uint16_t OpenSkyhawk::Boot::CATCH_WINDOW_MS;
variable CMD_ID_BASE
BOOT_CMD_n = 0x740 + n — host (bridge) → node n's bootloader.
constexpr uint16_t OpenSkyhawk::Boot::CMD_ID_BASE;
variable DATA_BYTES
payload bytes per DATA frame (byte 0 = Cmd::DATA_k)
constexpr uint8_t OpenSkyhawk::Boot::DATA_BYTES;
variable DATA_FRAMES
DATA frames per block (70 bytes carried, 64 used)
constexpr uint8_t OpenSkyhawk::Boot::DATA_FRAMES;
variable ENTRY_BKP_REGISTER
constexpr uint8_t OpenSkyhawk::Boot::ENTRY_BKP_REGISTER;
The app sets backup register DR1 to ENTRY_MAGIC and resets to enter the bootloader (#365). The bootloader clears it on read. The backup domain survives a reset, not a power cycle.
variable ENTRY_MAGIC
constexpr uint16_t OpenSkyhawk::Boot::ENTRY_MAGIC;
variable IDLE_TIMEOUT_MS
REQUESTED / CAUGHT with no command this long → back to the app (#364)
constexpr uint16_t OpenSkyhawk::Boot::IDLE_TIMEOUT_MS;
variable INFO_ADDRESS
constexpr uint32_t OpenSkyhawk::Boot::INFO_ADDRESS;
The last 16 bytes of the bootloader's 4 KB. A running app reads it to know a bootloader is present (and so whether it may honour an enter request) and which protocol it speaks (READY_n byte 3).
variable INFO_MAGIC
"OSBL" in memory order
constexpr uint32_t OpenSkyhawk::Boot::INFO_MAGIC;
variable PROTOCOL_VERSION
Bumped on any change to the frames below. A board reports it in READY_n byte 3 (#365); 0 = no bootloader.
constexpr uint8_t OpenSkyhawk::Boot::PROTOCOL_VERSION;
variable RELAY_ESCAPE
constexpr uint8_t OpenSkyhawk::Boot::RELAY_ESCAPE;
variable RELAY_ESC_55
after RELAY_ESCAPE: decodes to 0x55
constexpr uint8_t OpenSkyhawk::Boot::RELAY_ESC_55;
variable RELAY_ESC_56
after RELAY_ESCAPE: decodes to 0x56
constexpr uint8_t OpenSkyhawk::Boot::RELAY_ESC_56;
variable RELAY_EXPORT_ADDRESS
constexpr uint16_t OpenSkyhawk::Boot::RELAY_EXPORT_ADDRESS;
variable RELAY_EXPORT_WORDS
0xFF10-0xFF4F: 64 bytes per record
constexpr uint8_t OpenSkyhawk::Boot::RELAY_EXPORT_WORDS;
variable RELAY_FRAME_MARK
| len: a frame starts
constexpr uint8_t OpenSkyhawk::Boot::RELAY_FRAME_MARK;
variable RSP_ID_BASE
BOOT_RSP_n = 0x780 + n — node n's bootloader → host.
constexpr uint16_t OpenSkyhawk::Boot::RSP_ID_BASE;
variable SERIAL_BAUD
constexpr uint32_t OpenSkyhawk::Boot::SERIAL_BAUD;
the Gateway link's rate (FirmwarePlan/03)
variable SERIAL_FRAME_START
constexpr uint8_t OpenSkyhawk::Boot::SERIAL_FRAME_START;
variable TRANSPORT_CAN
BOOT_CMD_n / BOOT_RSP_n — the node build.
constexpr uint8_t OpenSkyhawk::Boot::TRANSPORT_CAN;
BootloaderInfo transports bits (#367): how the installed bootloader can be reached. An app only resets into it on a request that arrived the same way, so a board can't strand itself in a bootloader nothing can talk to. (0xFF from a #365 / #366 bootloader reads as both.)
variable TRANSPORT_SERIAL
USART2 to the Gateway's RP2040 — the bridge build.
constexpr uint8_t OpenSkyhawk::Boot::TRANSPORT_SERIAL;
variable UID_ADDRESS
the F103's 96-bit unique ID
constexpr uint32_t OpenSkyhawk::Boot::UID_ADDRESS;
variable UNCONFIGURED_CMD_ID
constexpr uint16_t OpenSkyhawk::Boot::UNCONFIGURED_CMD_ID;
Commands to an unconfigured bootloader (#364). CONNECT names the board's UID hash (AnnounceField::UID16); only that board binds the session and answers on UNCONFIGURED_RSP_ID. One unconfigured board on the bus at a time.
variable UNCONFIGURED_RSP_ID
A bootloader with no NODE_ID yet (option byte Data0 = 0xFF, no valid app) announces here.
constexpr uint16_t OpenSkyhawk::Boot::UNCONFIGURED_RSP_ID;
variable WINDOW_BLOCKS
constexpr uint8_t OpenSkyhawk::Boot::WINDOW_BLOCKS;
Blocks a host may send ahead of the last ack (#366). The bootloader buffers their frames while it writes flash; a lost block is resent from BLOCK_ACK's next (go-back-N). BEGIN erases every page the image needs before it replies, so no erase stalls the stream.
Public Functions Documentation
function canIdBootCmd
BOOT_CMD_n for node n (0x740-0x77F).
constexpr uint16_t OpenSkyhawk::Boot::canIdBootCmd (
uint8_t n
)
function canIdBootRsp
BOOT_RSP_n for node n (0x780-0x7BF).
constexpr uint16_t OpenSkyhawk::Boot::canIdBootRsp (
uint8_t n
)
The documentation for this class was generated from the following file Firmware/Libraries/BootProtocol/BootProtocol.h