Common Bootloader#

Common bootloader interface defines and functions.

See bootloader-interface.h for source code.

Bootloader type definitions#

These are the type definitions for the bootloader.

typedef uint8_t

Define the bootloader base type.

typedef uint16_t

Define the bootloader extended type.

Bootloader Numerical Definitions#

These are numerical definitions for the possible bootloader types and a typedef of the bootloader base type.

#define

Numerical definition for a bootloader type.

#define

bl type standalone

#define

bl type application

#define

Generic bootloader type.

#define

Generic, but small bootloader type.

Functions#

Returns the bootloader base type the application was built for.

Returns the extended bootloader type of the bootloader that is present on the chip.

uint16_t

Returns the version of the installed bootloader, regardless of its type.

void
halGetExtendedBootloaderVersion(uint32_t *getEmberVersion, uint32_t *customerVersion)

Return extended bootloader version information, if supported.

Macros#

#define
BOOTLOADER_BASE_TYPE (extendedType)

Macro returning the base type of a bootloader when given an extended type.

#define
BOOTLOADER_MAKE_EXTENDED_TYPE (baseType, extendedSpecifier)

Macro returning the extended type of a bootloader when given a base type and extendedSpecifier.

#define
BL_EXT_TYPE_NULL ((BL_TYPE_NULL << 8U) | 0x00U)

Macro defining the extended NULL bootloader type.

#define
BL_EXT_TYPE_STANDALONE_UNKNOWN ((BL_TYPE_STANDALONE << 8U) | 0x00U)

Macro defining the extended standalone unknown bootloader type.

#define
BL_EXT_TYPE_SERIAL_UART ((BL_TYPE_STANDALONE << 8U) | 0x01U)

Macro defining the extended standalone UART bootloader type.

#define
BL_EXT_TYPE_SERIAL_UART_OTA ((BL_TYPE_STANDALONE << 8U) | 0x03U)

Macro defining the extended standalone OTA and UART bootloader type.

#define
BL_EXT_TYPE_EZSP_SPI ((BL_TYPE_STANDALONE << 8U) | 0x04U)

bl ext type ezsp spi

#define
BL_EXT_TYPE_EZSP_SPI_OTA ((BL_TYPE_STANDALONE << 8U) | 0x06U)

bl ext type ezsp spi ota

#define
BL_EXT_TYPE_SERIAL_USB ((BL_TYPE_STANDALONE << 8U) | 0x07U)

Macro defining the extended standalone USB bootloader type.

#define
BL_EXT_TYPE_SERIAL_USB_OTA ((BL_TYPE_STANDALONE << 8U) | 0x08U)

Macro defining the extended standalone OTA and USB bootloader type.

#define
BL_EXT_TYPE_APP_UNKNOWN ((BL_TYPE_APPLICATION << 8U) | 0x00U)

Macro defining the extended application unknown bootloader type.

#define
BL_EXT_TYPE_APP_SPI ((BL_TYPE_APPLICATION << 8U) | 0x01U)

Macro defining the extended application SPI bootloader type.

#define
BL_EXT_TYPE_APP_I2C ((BL_TYPE_APPLICATION << 8U) | 0x02U)

Macro defining the extended application I2C bootloader type.

#define
BL_EXT_TYPE_APP_LOCAL_STORAGE ((BL_TYPE_APPLICATION << 8U) | 0x03U)

Macro defining a type for the local storage app bootloader.

#define

Define an invalid bootloader version.

#define

Macro defining the customer application version stored in the ApplicationProperties_t struct.

#define

Macro defining the customer application capabilities stored in the ApplicationProperties_t struct.

#define

Macro defining the customer application product ID stored in the ApplicationProperties_t struct.

#define

Macro defining the support for the MPSI protocol stored in the capabilities field of the ApplicationProperties_t struct.

#define

Macro defining the bit position that corresponds to MPSI support in the capabilities field of the ApplicationProperties_t struct.

#define

Macro defining the capabilities that this application has.

Bootloader type definitions Documentation#

BlBaseType#

typedef uint8_t BlBaseType

Define the bootloader base type.


Definition at line 56 of file platform/service/legacy_hal/inc/bootloader-interface.h

BlExtendedType#

typedef uint16_t BlExtendedType

Define the bootloader extended type.


Definition at line 60 of file platform/service/legacy_hal/inc/bootloader-interface.h

Bootloader Numerical Definitions Documentation#

BL_TYPE_NULL#

#define BL_TYPE_NULL
Value:
(0)

Numerical definition for a bootloader type.


Definition at line 41 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_TYPE_STANDALONE#

#define BL_TYPE_STANDALONE
Value:
(1)

bl type standalone


Definition at line 42 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_TYPE_APPLICATION#

#define BL_TYPE_APPLICATION
Value:
(2)

bl type application


Definition at line 43 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_TYPE_BOOTLOADER#

#define BL_TYPE_BOOTLOADER
Value:
(3)

Generic bootloader type.


Definition at line 44 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_TYPE_SMALL_BOOTLOADER#

#define BL_TYPE_SMALL_BOOTLOADER
Value:
(4)

Generic, but small bootloader type.


Definition at line 45 of file platform/service/legacy_hal/inc/bootloader-interface.h

Function Documentation#

halBootloaderGetType#

BlBaseType halBootloaderGetType (void )

Returns the bootloader base type the application was built for.

Parameters
N/A

Returns


Definition at line 69 of file platform/service/legacy_hal/inc/bootloader-interface.h

halBootloaderGetInstalledType#

BlExtendedType halBootloaderGetInstalledType (void )

Returns the extended bootloader type of the bootloader that is present on the chip.

Parameters
N/A

Returns

  • the extended bootloader type of the bootloader that is present on the chip.


Definition at line 135 of file platform/service/legacy_hal/inc/bootloader-interface.h

halGetBootloaderVersion#

uint16_t halGetBootloaderVersion (void )

Returns the version of the installed bootloader, regardless of its type.

Parameters
N/A

Returns

  • Version if bootloader installed, or BOOTLOADER_INVALID_VERSION. A returned version of 0x1234U would indicate version 1.2 build 34


Definition at line 147 of file platform/service/legacy_hal/inc/bootloader-interface.h

halGetExtendedBootloaderVersion#

void halGetExtendedBootloaderVersion (uint32_t * getEmberVersion, uint32_t * customerVersion)

Return extended bootloader version information, if supported.

Parameters
N/AgetEmberVersion

If specified, we will return the full 32bit ember version for this bootloader. Format is major, minor, patch, doc (4bit nibbles) followed by a 16bit build number.

N/AcustomerVersion

This will return the 32bit value specified in CUSTOMER_BOOTLOADER_VERSION at build time.

This API is not supported for EM2XX chips and only returns extra information on bootloaders built on or after the 4.7 release.


Definition at line 159 of file platform/service/legacy_hal/inc/bootloader-interface.h

Macro Definition Documentation#

BOOTLOADER_BASE_TYPE#

#define BOOTLOADER_BASE_TYPE
Value:
(extendedType)

Macro returning the base type of a bootloader when given an extended type.


Definition at line 74 of file platform/service/legacy_hal/inc/bootloader-interface.h

BOOTLOADER_MAKE_EXTENDED_TYPE#

#define BOOTLOADER_MAKE_EXTENDED_TYPE
Value:
(baseType, extendedSpecifier)

Macro returning the extended type of a bootloader when given a base type and extendedSpecifier.


Definition at line 80 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_NULL#

#define BL_EXT_TYPE_NULL
Value:
((BL_TYPE_NULL << 8U) | 0x00U)

Macro defining the extended NULL bootloader type.


Definition at line 85 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_STANDALONE_UNKNOWN#

#define BL_EXT_TYPE_STANDALONE_UNKNOWN
Value:
((BL_TYPE_STANDALONE << 8U) | 0x00U)

Macro defining the extended standalone unknown bootloader type.


Definition at line 89 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_SERIAL_UART#

#define BL_EXT_TYPE_SERIAL_UART
Value:
((BL_TYPE_STANDALONE << 8U) | 0x01U)

Macro defining the extended standalone UART bootloader type.


Definition at line 93 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_SERIAL_UART_OTA#

#define BL_EXT_TYPE_SERIAL_UART_OTA
Value:
((BL_TYPE_STANDALONE << 8U) | 0x03U)

Macro defining the extended standalone OTA and UART bootloader type.


Definition at line 100 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_EZSP_SPI#

#define BL_EXT_TYPE_EZSP_SPI
Value:
((BL_TYPE_STANDALONE << 8U) | 0x04U)

bl ext type ezsp spi


Definition at line 101 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_EZSP_SPI_OTA#

#define BL_EXT_TYPE_EZSP_SPI_OTA
Value:
((BL_TYPE_STANDALONE << 8U) | 0x06U)

bl ext type ezsp spi ota


Definition at line 102 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_SERIAL_USB#

#define BL_EXT_TYPE_SERIAL_USB
Value:
((BL_TYPE_STANDALONE << 8U) | 0x07U)

Macro defining the extended standalone USB bootloader type.


Definition at line 106 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_SERIAL_USB_OTA#

#define BL_EXT_TYPE_SERIAL_USB_OTA
Value:
((BL_TYPE_STANDALONE << 8U) | 0x08U)

Macro defining the extended standalone OTA and USB bootloader type.


Definition at line 110 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_APP_UNKNOWN#

#define BL_EXT_TYPE_APP_UNKNOWN
Value:
((BL_TYPE_APPLICATION << 8U) | 0x00U)

Macro defining the extended application unknown bootloader type.


Definition at line 114 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_APP_SPI#

#define BL_EXT_TYPE_APP_SPI
Value:
((BL_TYPE_APPLICATION << 8U) | 0x01U)

Macro defining the extended application SPI bootloader type.


Definition at line 118 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_APP_I2C#

#define BL_EXT_TYPE_APP_I2C
Value:
((BL_TYPE_APPLICATION << 8U) | 0x02U)

Macro defining the extended application I2C bootloader type.


Definition at line 122 of file platform/service/legacy_hal/inc/bootloader-interface.h

BL_EXT_TYPE_APP_LOCAL_STORAGE#

#define BL_EXT_TYPE_APP_LOCAL_STORAGE
Value:
((BL_TYPE_APPLICATION << 8U) | 0x03U)

Macro defining a type for the local storage app bootloader.


Definition at line 126 of file platform/service/legacy_hal/inc/bootloader-interface.h

BOOTLOADER_INVALID_VERSION#

#define BOOTLOADER_INVALID_VERSION
Value:
0xFFFF

Define an invalid bootloader version.


Definition at line 139 of file platform/service/legacy_hal/inc/bootloader-interface.h

CUSTOMER_APPLICATION_VERSION#

#define CUSTOMER_APPLICATION_VERSION
Value:
0

Macro defining the customer application version stored in the ApplicationProperties_t struct.


Definition at line 165 of file platform/service/legacy_hal/inc/bootloader-interface.h

CUSTOMER_APPLICATION_CAPABILITIES#

#define CUSTOMER_APPLICATION_CAPABILITIES
Value:
0

Macro defining the customer application capabilities stored in the ApplicationProperties_t struct.

Note

  • The capabilities field in the ApplicationProperties_t struct is shared with other values.


Definition at line 174 of file platform/service/legacy_hal/inc/bootloader-interface.h

CUSTOMER_APPLICATION_PRODUCT_ID#

#define CUSTOMER_APPLICATION_PRODUCT_ID
Value:
{ 0 }

Macro defining the customer application product ID stored in the ApplicationProperties_t struct.


Definition at line 181 of file platform/service/legacy_hal/inc/bootloader-interface.h

MPSI_PLUGIN_SUPPORT#

#define MPSI_PLUGIN_SUPPORT
Value:
0

Macro defining the support for the MPSI protocol stored in the capabilities field of the ApplicationProperties_t struct.


Definition at line 190 of file platform/service/legacy_hal/inc/bootloader-interface.h

APPLICATION_PROPERTIES_CAPABILITIES_MPSI_SUPPORT_BIT#

#define APPLICATION_PROPERTIES_CAPABILITIES_MPSI_SUPPORT_BIT
Value:
31

Macro defining the bit position that corresponds to MPSI support in the capabilities field of the ApplicationProperties_t struct.


Definition at line 204 of file platform/service/legacy_hal/inc/bootloader-interface.h

APPLICATION_PROPERTIES_CAPABILITIES#

#define APPLICATION_PROPERTIES_CAPABILITIES
Value:
(MPSI_PLUGIN_SUPPORT << APPLICATION_PROPERTIES_CAPABILITIES_MPSI_SUPPORT_BIT) \
| (CUSTOMER_APPLICATION_CAPABILITIES & 0x7FFFFFFF)

Macro defining the capabilities that this application has.

This value is set in the capabilities field of the ApplicationProperties_t struct.


Definition at line 210 of file platform/service/legacy_hal/inc/bootloader-interface.h