|
PER Firmware
|
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | BOOTLOADER_PROTOCOL_VERSION 1U |
| #define | BOOTLOADER_INFO_PERIOD_MS 5000U |
| #define | BOOTLOADER_INFO_FLAG_BOOTLOADABLE (1U << 0U) |
| #define | BOOTLOADER_INFO_FLAG_READY (1U << 1U) |
| #define | BOOTLOADER_METADATA_MAGIC 0x50455242U |
| #define | BOOTLOADER_METADATA_FORMAT_VERSION 2U |
| #define | BOOTLOADER_METADATA_FLAG_INSTALLED_BY_BOOTLOADER (1U << 0U) |
| #define | BL_METADATA_SIZE 32U |
| STM32G474RE flash layout shared with the linker scripts. | |
| #define | BL_WORD_SIZE 4U |
| #define | BL_FLASH_WRITE_SIZE 8U |
Enumerations | |
| enum | BLError_t { BLERROR_NONE = 0x00 , BLERROR_LOCKED = 0x01 , BLERROR_SEQUENCE = 0x02 , BLERROR_FLASH = 0x03 , BLERROR_SIZE = 0x04 , BLERROR_ADDRESS = 0x05 } |
| Detail values accompanying BOOTLOADER_STATUS_ERROR. More... | |
Functions | |
| struct | __attribute__ ((aligned(BL_FLASH_WRITE_SIZE))) |
| Metadata describing the only application the bootloader may launch. | |
| uint32_t | BL_getGitHash (void) |
Variables | |
| BootloaderMetadata_t | |
| #define BL_FLASH_WRITE_SIZE 8U |
STM32G4 flash programming granularity.
| #define BL_METADATA_SIZE 32U |
STM32G474RE flash layout shared with the linker scripts.
Applications occupy the full 480 KiB remaining after the resident image and metadata at BL_APP_ADDRESS. The metadata region and application slot begin on flash erase-page boundaries; PHAL_FLASH_erase() erases complete pages even when passed the metadata record. Programming addresses are 8-byte aligned.
Images and CRC input are 32-bit-word aligned. The package builder pads a partial final word with erased bytes before recording size_bytes and crc32. An odd number of image words is then padded with one erased 32-bit word for the final 8-byte flash write; that physical padding is outside size_bytes. The metadata record is written last and acts as the commit marker. Size of the committed metadata record.
| #define BL_WORD_SIZE 4U |
Wire and CRC payload granularity.
| #define BOOTLOADER_INFO_FLAG_BOOTLOADABLE (1U << 0U) |
Information-frame flag indicating that the bootloader accepts updates.
| #define BOOTLOADER_INFO_FLAG_READY (1U << 1U) |
Information-frame flag indicating that the resident image is ready.
| #define BOOTLOADER_INFO_PERIOD_MS 5000U |
Period between resident bootloader information frames.
| #define BOOTLOADER_METADATA_FLAG_INSTALLED_BY_BOOTLOADER (1U << 0U) |
Metadata flag set only by the final installation write.
| #define BOOTLOADER_METADATA_FORMAT_VERSION 2U |
Metadata layout version accepted by resident bootloaders.
| #define BOOTLOADER_METADATA_MAGIC 0x50455242U |
Magic identifying a BootloaderMetadata_t record (ASCII "PERB").
| #define BOOTLOADER_PROTOCOL_VERSION 1U |
Bootloader wire-protocol version reported with BOOTLOADER_STATUS_READY.
| enum BLError_t |
Detail values accompanying BOOTLOADER_STATUS_ERROR.
| struct __attribute__ | ( | (aligned(BL_FLASH_WRITE_SIZE)) | ) |
Metadata describing the only application the bootloader may launch.
This record is written after the image at BL_APP_ADDRESS has passed sequence, CRC, and vector validation. A missing or inconsistent record prevents application launch.
< Must equal BOOTLOADER_METADATA_MAGIC.
< Must equal BOOTLOADER_METADATA_FORMAT_VERSION.
< Must include INSTALLED_BY_BOOTLOADER.
< CRC-32/MPEG-2 over the application words.
< Must equal BL_APP_ADDRESS.
< Non-zero, word-aligned application length.
< Resident bootloader build advertised by the app.
< Reserved for a future metadata format.
| uint32_t BL_getGitHash | ( | void | ) |
Return the installed resident bootloader hash, or zero when unavailable.
| BootloaderMetadata_t |