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#

BareBootTable_t

BootloaderInformation_t

BootloaderHeader_t

FirstBootloaderTable_t

MainBootloaderTable_t

Enumerations#

enum
NO_BOOTLOADER = 0
SL_BOOTLOADER = 1
NO_BOOTLOADER = 0
SL_BOOTLOADER = 1
}

Type of bootloader.

Functions#

void
bootloader_getInfo(BootloaderInformation_t *info)

Get information about the bootloader on this device.

int32_t

Initialize components of the bootloader so the app can use the interface.

int32_t

De-initialize components of the bootloader that were previously initialized.

void

Reboot into the bootloader to perform an install.

bool
bootloader_verifyApplication(uint32_t startAddress)

Verify the application image stored in the Flash memory starting at the address startAddress.

bool

Check whether signature verification on the application image in internal flash is enforced before every boot.

bool

Get bootloader certificate version.

Get reset cause of the bootloader.

bool
bootloader_pointerValid(const void *ptr)

Check if a pointer is valid and if it points to the bootloader main stage.

uint32_t
bootloader_GetAliasedAddr(uint32_t address)

Get Aliased flash address.

Macros#

#define

Bootloader version major version shift value.

#define

Bootloader version minor version shift value.

#define

Bootloader version major version mask.

#define

Bootloader version minor version mask.

#define

Bootloader enforces signed application upgrade images.

#define

Bootloader enforces encrypted application upgrade images.

#define

Bootloader enforces signature verification of the application image before every boot.

#define

Bootloader has the capability of being upgraded.

#define

Bootloader has the capability of parsing GBL files.

#define

Bootloader has the capability of parsing signed GBL files.

#define

Bootloader has the capability of parsing encrypted GBL files.

#define

Bootloader enforces signature verification of the application image before every boot using certificate.

#define

Bootloader has the capability of application rollback protection.

#define

Bootloader has the capability to check the peripherals in use.

#define

Bootloader rejects directly signed images without certificates.

#define

Bootloader has the capability of storing data in an internal or external storage medium.

#define

Bootloader has the capability of communicating with host processors using a communication interface.

#define

Magic word indicating first stage bootloader table.

#define
BOOTLOADER_MAGIC_MAIN (0x5ECDB007UL)

Magic word indicating main bootloader table.

#define

Pointer to main bootloader table.

Enumeration Documentation#

BootloaderType_t#

BootloaderType_t

Type of bootloader.

Enumerator
NO_BOOTLOADER

No bootloader present.

SL_BOOTLOADER

Bootloader is a Silicon Labs bootloader.

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.

Parameters
TypeDirectionArgument NameDescription
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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This typically includes initializing serial peripherals for communication with external SPI flashes, and so on.

Returns


bootloader_deinit#

int32_t bootloader_deinit (void )

De-initialize components of the bootloader that were previously initialized.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This typically includes powering down external SPI flashes and de-initializing the serial peripheral used for communication with the external flash.

Returns


bootloader_rebootAndInstall#

void bootloader_rebootAndInstall (void )

Reboot into the bootloader to perform an install.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • True if signature verification is enforced, else false.


bootloader_getCertificateVersion#

bool bootloader_getCertificateVersion (uint32_t * version)

Get bootloader certificate version.

Parameters
TypeDirectionArgument NameDescription
uint32_t *[out]version

Bootloader certificate version

Returns

  • True if a valid certificate version is found.


bootloader_getResetReason#

BootloaderResetCause_t bootloader_getResetReason (void )

Get reset cause of the bootloader.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
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.


bootloader_GetAliasedAddr#

uint32_t bootloader_GetAliasedAddr (uint32_t address)

Get Aliased flash address.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]address

to be converted based on secure/nonsecure

This function gets aliased flash address

Returns

  • Aliased address


Macro Definition Documentation#

BOOTLOADER_VERSION_MAJOR_SHIFT#

#define BOOTLOADER_VERSION_MAJOR_SHIFT
Value:
(24U)

Bootloader version major version shift value.


BOOTLOADER_VERSION_MINOR_SHIFT#

#define BOOTLOADER_VERSION_MINOR_SHIFT
Value:
(16U)

Bootloader version minor version shift value.


BOOTLOADER_VERSION_MAJOR_MASK#

#define BOOTLOADER_VERSION_MAJOR_MASK
Value:
(0xFF000000U)

Bootloader version major version mask.


BOOTLOADER_VERSION_MINOR_MASK#

#define BOOTLOADER_VERSION_MINOR_MASK
Value:
(0x00FF0000U)

Bootloader version minor version mask.


BOOTLOADER_CAPABILITY_ENFORCE_UPGRADE_SIGNATURE#

#define BOOTLOADER_CAPABILITY_ENFORCE_UPGRADE_SIGNATURE
Value:
(1 << 0)

Bootloader enforces signed application upgrade images.


BOOTLOADER_CAPABILITY_ENFORCE_UPGRADE_ENCRYPTION#

#define BOOTLOADER_CAPABILITY_ENFORCE_UPGRADE_ENCRYPTION
Value:
(1 << 1)

Bootloader enforces encrypted application upgrade images.


BOOTLOADER_CAPABILITY_ENFORCE_SECURE_BOOT#

#define BOOTLOADER_CAPABILITY_ENFORCE_SECURE_BOOT
Value:
(1 << 2)

Bootloader enforces signature verification of the application image before every boot.


BOOTLOADER_CAPABILITY_BOOTLOADER_UPGRADE#

#define BOOTLOADER_CAPABILITY_BOOTLOADER_UPGRADE
Value:
(1 << 4)

Bootloader has the capability of being upgraded.


BOOTLOADER_CAPABILITY_GBL#

#define BOOTLOADER_CAPABILITY_GBL
Value:
(1 << 5)

Bootloader has the capability of parsing GBL files.


BOOTLOADER_CAPABILITY_GBL_SIGNATURE#

#define BOOTLOADER_CAPABILITY_GBL_SIGNATURE
Value:
(1 << 6)

Bootloader has the capability of parsing signed GBL files.


BOOTLOADER_CAPABILITY_GBL_ENCRYPTION#

#define BOOTLOADER_CAPABILITY_GBL_ENCRYPTION
Value:
(1 << 7)

Bootloader has the capability of parsing encrypted GBL files.


BOOTLOADER_CAPABILITY_ENFORCE_CERTIFICATE_SECURE_BOOT#

#define BOOTLOADER_CAPABILITY_ENFORCE_CERTIFICATE_SECURE_BOOT
Value:
(1 << 8)

Bootloader enforces signature verification of the application image before every boot using certificate.


BOOTLOADER_CAPABILITY_ROLLBACK_PROTECTION#

#define BOOTLOADER_CAPABILITY_ROLLBACK_PROTECTION
Value:
(1 << 9)

Bootloader has the capability of application rollback protection.


BOOTLOADER_CAPABILITY_PERIPHERAL_LIST#

#define BOOTLOADER_CAPABILITY_PERIPHERAL_LIST
Value:
(1 << 10)

Bootloader has the capability to check the peripherals in use.


BOOTLOADER_CAPABILITY_REJECT_DIRECT_SIGNED_IMG#

#define BOOTLOADER_CAPABILITY_REJECT_DIRECT_SIGNED_IMG
Value:
(1 << 11)

Bootloader rejects directly signed images without certificates.


BOOTLOADER_CAPABILITY_STORAGE#

#define BOOTLOADER_CAPABILITY_STORAGE
Value:
(1 << 16)

Bootloader has the capability of storing data in an internal or external storage medium.


BOOTLOADER_CAPABILITY_COMMUNICATION#

#define BOOTLOADER_CAPABILITY_COMMUNICATION
Value:
(1 << 20)

Bootloader has the capability of communicating with host processors using a communication interface.


BOOTLOADER_MAGIC_FIRST_STAGE#

#define BOOTLOADER_MAGIC_FIRST_STAGE
Value:
(0xB00710ADUL)

Magic word indicating first stage bootloader table.


BOOTLOADER_MAGIC_MAIN#

#define BOOTLOADER_MAGIC_MAIN
Value:
(0x5ECDB007UL)

Magic word indicating main bootloader table.


mainBootloaderTable#

#define mainBootloaderTable
Value:
(*(MainBootloaderTable_t **) \
(BTL_MAIN_BOOTLOADER_TABLE_BASE))

Pointer to main bootloader table.