Common Application Interface#
Generic application interface available on all versions of the bootloader, regardless of the available components.
Note
These Bootloader APIs are not reentrant and should be wrapped in critical section where needed.
Modules#
Enumerations#
Bootloader interface APIs are trust zone aware.
Functions#
Get information about the bootloader on this device.
Initialize components of the bootloader so the app can use the interface.
De-initialize components of the bootloader that were previously initialized.
Reboot into the bootloader to perform an install.
Verify the application image stored in the Flash memory starting at the address startAddress.
Check whether signature verification on the application image in internal flash is enforced before every boot.
Get base address of the bootloader upgrade image.
Count the total remaining number of application upgrades.
Get reset cause of the bootloader.
Check if a pointer is valid and if it points to the bootloader main stage.
Checks if a memory region is within the valid flash address range.
Checks if a memory region is erased (all bits set to 1).
Reboots the system with GPIO retention and enters EM4 sleep mode.
Macros#
Bootloader version major version shift value.
Bootloader version minor version shift value.
Bootloader version major version mask.
Bootloader version minor version mask.
Bootloader enforces signed application upgrade images.
Bootloader enforces encrypted application upgrade images.
Bootloader enforces signature verification of the application image before every boot.
Bootloader has the capability of being upgraded.
Bootloader has the capability of parsing GBL files.
Bootloader has the capability of parsing signed GBL files.
Bootloader has the capability of parsing encrypted GBL files.
Bootloader enforces signature verification of the application image before every boot using certificate.
Bootloader has the capability of application rollback protection.
Bootloader has the capability to check the peripherals in use.
Bootloader has the capability of storing data in an internal or external storage medium.
Bootloader has the capability of communicating with host processors using a communication interface.
The bootloader supports EM4 GPIO retention.
Magic word indicating first stage bootloader table.
Magic word indicating main bootloader table.
Pointer to main bootloader table.
Normal application boot.
Application requested that bootloader runs.
Bootloader detected bad upgrade image.
Bootloader detected bad application.
Bootloader detected a fatal error.
Enumeration Documentation#
BootloaderType_t#
BootloaderType_t
Bootloader interface APIs are trust zone aware.
Type of bootloader
| Enumerator | |
|---|---|
| NO_BOOTLOADER | No bootloader present. |
| SL_BOOTLOADER | Bootloader is a Silicon Labs bootloader. |
Function Documentation#
bootloader_getInfo#
void bootloader_getInfo (BootloaderInformation_t * info)
Get information about the bootloader on this device.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| BootloaderInformation_t * | [out] | info | Pointer to the bootloader information struct. |
The returned information is fetched from the main bootloader information table.
bootloader_init#
int32_t bootloader_init (void )
Initialize components of the bootloader so the app can use the interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
This typically includes initializing serial peripherals for communication with external SPI flashes, and so on.
Returns
Error code. BOOTLOADER_OK on success, else error code in BOOTLOADER_ERROR_INIT_BASE range.
bootloader_deinit#
int32_t bootloader_deinit (void )
De-initialize components of the bootloader that were previously initialized.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
This typically includes powering down external SPI flashes and de-initializing the serial peripheral used for communication with the external flash.
Returns
Error code. BOOTLOADER_OK on success, else error code in BOOTLOADER_ERROR_INIT_BASE range.
bootloader_rebootAndInstall#
void bootloader_rebootAndInstall (void )
Reboot into the bootloader to perform an install.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
If there is a storage component and a slot is marked for bootload, install the image in that slot after verifying it.
If a communication component is present, open the communication channel and receive an image to be installed.
bootloader_verifyApplication#
bool bootloader_verifyApplication (uint32_t startAddress)
Verify the application image stored in the Flash memory starting at the address startAddress.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint32_t | [in] | startAddress | Starting address of the application. |
If the secure boot is enforced, the function will only return true if the cryptographic signature of the application is valid. Otherwise, the application is verified according to the signature type defined in the ApplicationProperties_t structure embedded in the application. Silicon Labs wireless stacks include a declaration of this structure. However, applications not using a full wireless stack may need to instantiate the structure.
Examples of results when the secure boot is not enforced:
App has no signature: Valid if initial stack pointer and program counter have reasonable values.
App has CRC checksum: Valid if checksum is valid.
App has ECDSA signature: Valid if ECDSA signature is valid.
When secure boot is enforced, only ECDSA signed applications with a valid signature are considered valid.
Returns
True if the application is valid, else false.
bootloader_secureBootEnforced#
bool bootloader_secureBootEnforced (void )
Check whether signature verification on the application image in internal flash is enforced before every boot.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
Returns
True if signature verification is enforced, else false.
bootloader_getUpgradeLocation#
bool bootloader_getUpgradeLocation (uint32_t * location)
Get base address of the bootloader upgrade image.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint32_t * | [out] | location | the base address of bootloader upgrade image. |
Returns
Returns true if the location was found.
bootloader_remainingApplicationUpgrades#
uint32_t bootloader_remainingApplicationUpgrades (void )
Count the total remaining number of application upgrades.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
Returns
remaining number of application upgrades.
bootloader_getResetReason#
BootloaderResetCause_t bootloader_getResetReason (void )
Get reset cause of the bootloader.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
Returns
Reset cause of the bootloader.
bootloader_pointerValid#
bool bootloader_pointerValid (const void * ptr)
Check if a pointer is valid and if it points to the bootloader main stage.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| const void * | [in] | ptr | The pointer to check |
This function checks pointers to bootloader jump tables.
Returns
True if the pointer points into the bootloader main stage, false if not.
verifyAddressRange#
bool verifyAddressRange (uint32_t address, uint32_t length)
Checks if a memory region is within the valid flash address range.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint32_t | N/A | address | The starting address of the memory region to check. |
| uint32_t | N/A | length | The length (in bytes) of the memory region to check. |
This function verifies that the specified address and length are within the bounds of the device's flash memory region, defined by FLASH_BASE and FLASH_SIZE.
Returns
true if the region is fully within the flash memory range, false otherwise.
verifyErased#
bool verifyErased (uint32_t address, uint32_t length)
Checks if a memory region is erased (all bits set to 1).
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint32_t | N/A | address | The starting address of the memory region to check. |
| uint32_t | N/A | length | The length (in bytes) of the memory region to check. Must be a multiple of 4. |
This function iterates over the specified memory region and checks if every 32-bit word is equal to 0xFFFFFFFF, which indicates an erased state in flash memory.
Returns
true if all 32-bit words in the region are erased (0xFFFFFFFF), false otherwise.
bootloader_rebootAndInstallWithGpioRetention#
int32_t bootloader_rebootAndInstallWithGpioRetention (const gpio_em4_retention_t * pins, uint8_t num_pins, bool auto_configure_wakeup)
Reboots the system with GPIO retention and enters EM4 sleep mode.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| const gpio_em4_retention_t * | [in] | pins | Pointer to array of GPIO pin configurations to retain |
| uint8_t | [in] | num_pins | Number of pins to retain (range: 1 to MAX_EM4_RETAINED_PINS) |
| bool | [in] | auto_configure_wakeup | Wakeup configuration flag (true: BURTC wakeup, false: direct EM4 entry) |
This function implements a complete EM4 GPIO retention workflow by:
Validating the provided GPIO configuration parameters
Persisting GPIO configurations to BURAM for retention across EM4 cycles
Entering EM4 sleep mode with configurable wakeup behavior
The wakeup mechanism is controlled by the auto_configure_wakeup parameter:
When true: BURTC is configured for scheduled wakeup before entering EM4
When false: EM4 is entered directly, allowing the application to handle wakeup configuration
Returns
On success, this function transitions the system to EM4 sleep mode and does not return
BOOTLOADER_ERROR_GPIO_RETENTION_INVALID: Invalid parameters or EM4 GPIO retention not available
Other error codes from btl_em4GpioRetentionConfigSave() on GPIO retention save failure