![]() |
Wirepas SDK
|
Interface for interacting with bootloader
Definition in file bl_interface.h.
Go to the source code of this file.
Typedefs | |
typedef uint32_t | bl_memory_area_id_t |
Memory Area id definition. | |
typedef bl_interface_res_e(* | bl_memory_area_startRead_f) (bl_memory_area_id_t id, void *to, uint32_t from, size_t amount) |
Read bytes from a memory area. | |
typedef bl_interface_res_e(* | bl_memory_area_startWrite_f) (bl_memory_area_id_t id, uint32_t to, const void *from, size_t amount) |
Write bytes to a memory area. | |
typedef bl_interface_res_e(* | bl_memory_area_startErase_f) (bl_memory_area_id_t id, uint32_t *sector_base, size_t *number_of_sector) |
Erase a sector of a memory area. | |
typedef bool(* | bl_memory_area_isBusy_f) (bl_memory_area_id_t id) |
Checks if underlying flash driver is busy. | |
typedef bl_interface_res_e(* | bl_memory_area_getAreaInfo_f) (bl_memory_area_id_t id, bl_memory_area_info_t *info) |
Fills a structure with info about memory area. | |
typedef void(* | bl_memory_area_getAreaList_f) (bl_memory_area_id_t *list, uint8_t *num_areas) |
Return the list of areas defined in the bootloader. | |
typedef bl_interface_res_e(* | bl_memory_area_getIdfromType_f) (bl_memory_area_id_t *id, bl_memory_area_type_e type) |
Return the memory area id of the FIRST area with provided type. | |
typedef bl_interface_res_e(* | bl_memory_area_getAreaHeader_f) (bl_memory_area_id_t id, bl_memory_area_header_t *header) |
Return a structure containing the information stored in the header at the beginning of the area. | |
typedef uint8_t(* | bl_memory_area_getMaxNumAreas_f) (void) |
Return the total number of areas supported by the bootloader. | |
typedef bl_interface_res_e(* | bl_scrat_getValidity_f) (bl_scrat_valid_e *validity) |
Check if the scratchpad contains valid data. | |
typedef bl_interface_res_e(* | bl_scrat_read_f) (void *to, uint32_t from, size_t amount) |
Read bytes from a scratchpad file. | |
typedef bl_interface_res_e(* | bl_scrat_clear_f) (void(*clear_wdt) (void)) |
Erase the scratchpad area. | |
typedef bl_interface_res_e(* | bl_scrat_begin_f) (uint32_t num_bytes, uint8_t seq, void(*clear_wdt) (void)) |
Prepare scratchpad memory for storing new data. | |
typedef bl_interface_res_e(* | bl_scrat_write_f) (uint32_t to, const void *from, size_t amount, bl_scrat_write_status_e *status) |
Write bytes to scratchpad area. | |
typedef bl_interface_res_e(* | bl_scrat_getInfo_f) (bl_scrat_info_t *info) |
Fills a structure with info about the scratchpad. | |
typedef bl_interface_res_e(* | bl_scrat_setBootable_f) (void) |
Set scratchpad as bootable. | |
typedef bl_interface_res_e(* | bl_scrat_setStatus_f) (uint32_t status) |
typedef const bl_hardware_capabilities_t *(* | bl_hardware_getCapabilities_f) (void) |
Returns board hardware capabilities. | |
Data Structures | |
struct | bl_flash_info_t |
Flash memory info definition. More... | |
struct | bl_memory_area_info_t |
Memory Area info definition. More... | |
struct | bl_memory_area_header_t |
Informations contained in the header that the bootloader can store in the beginning of an area (only used by stack and application for now). More... | |
struct | bl_scrat_info_t |
Scratchpad info definition. More... | |
union | bl_platform_t |
Platform specific descriptions. More... | |
struct | bl_hardware_capabilities_t |
Hardware features that can be installed on a board. More... | |
struct | memory_area_services_t |
struct | scratchpad_services_t |
struct | hardware_services_t |
struct | bl_interface_t |
Global interface entry point with a version id. More... | |
Macros | |
#define | BL_MEMORY_AREA_UNDEFINED 0xFFFFFFFF |
Value of an area that doesn't exists. | |
typedef const bl_hardware_capabilities_t *(* bl_hardware_getCapabilities_f) (void) |
Returns board hardware capabilities.
Definition at line 534 of file bl_interface.h.
typedef bl_interface_res_e(* bl_memory_area_getAreaHeader_f) (bl_memory_area_id_t id, bl_memory_area_header_t *header) |
Return a structure containing the information stored in the header at the beginning of the area.
id | Id of the memory area to get info from. |
header | pointer to an bl_memory_area_header_t structure. |
Definition at line 428 of file bl_interface.h.
typedef bl_interface_res_e(* bl_memory_area_getAreaInfo_f) (bl_memory_area_id_t id, bl_memory_area_info_t *info) |
Fills a structure with info about memory area.
id | Id of the memory area to get info from. |
info | pointer to an memoryArea_info_t structure. |
Definition at line 389 of file bl_interface.h.
typedef void(* bl_memory_area_getAreaList_f) (bl_memory_area_id_t *list, uint8_t *num_areas) |
Return the list of areas defined in the bootloader.
list | pointer to an array of areas. |
num_areas | In: size of the array list. Out: number of defined areas. |
Definition at line 400 of file bl_interface.h.
typedef bl_interface_res_e(* bl_memory_area_getIdfromType_f) (bl_memory_area_id_t *id, bl_memory_area_type_e type) |
Return the memory area id of the FIRST area with provided type.
id | Id of the area if found, BL_MEMORY_AREA_UNDEFINED otherwise. |
type | Type of the area area to find. |
Definition at line 414 of file bl_interface.h.
typedef uint8_t(* bl_memory_area_getMaxNumAreas_f) (void) |
Return the total number of areas supported by the bootloader.
Definition at line 438 of file bl_interface.h.
typedef uint32_t bl_memory_area_id_t |
Memory Area id definition.
Definition at line 41 of file bl_interface.h.
typedef bool(* bl_memory_area_isBusy_f) (bl_memory_area_id_t id) |
Checks if underlying flash driver is busy.
id | Id of the memory area to check. |
Definition at line 378 of file bl_interface.h.
typedef bl_interface_res_e(* bl_memory_area_startErase_f) (bl_memory_area_id_t id, uint32_t *sector_base, size_t *number_of_sector) |
Erase a sector of a memory area.
id | Id of the memory area to erase to. |
sector_base | pointer to the base address of the sector to be erased. If the flash driver cannot erase all requested sector, return the base address of the next sector to be erased. |
number_of_sector | Pointer to number of sector to erase. Returns the number of remaining sector to erase. |
Definition at line 369 of file bl_interface.h.
typedef bl_interface_res_e(* bl_memory_area_startRead_f) (bl_memory_area_id_t id, void *to, uint32_t from, size_t amount) |
Read bytes from a memory area.
id | Id of the memory area to read from. |
to | Pointer in RAM to store read data. |
from | Address in memory area to read data from. |
amount | Number of bytes to read. |
Definition at line 333 of file bl_interface.h.
typedef bl_interface_res_e(* bl_memory_area_startWrite_f) (bl_memory_area_id_t id, uint32_t to, const void *from, size_t amount) |
Write bytes to a memory area.
id | Id of the memory area to write to. |
to | Address in memory area to write data to. |
from | Pointer in RAM to the data to be written. |
amount | Number of bytes to write. |
Definition at line 352 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_begin_f) (uint32_t num_bytes, uint8_t seq, void(*clear_wdt)(void)) |
Prepare scratchpad memory for storing new data.
num_bytes | Total number of bytes to write |
seq | Scratchpad sequence number |
Definition at line 485 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_clear_f) (void(*clear_wdt)(void)) |
Erase the scratchpad area.
Definition at line 473 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_getInfo_f) (bl_scrat_info_t *info) |
Fills a structure with info about the scratchpad.
info | pointer to an scratchpad_info_t structure. |
Definition at line 517 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_getValidity_f) (bl_scrat_valid_e *validity) |
Check if the scratchpad contains valid data.
validity | Filled with scratchpad validity code. |
Definition at line 449 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_read_f) (void *to, uint32_t from, size_t amount) |
Read bytes from a scratchpad file.
to | Pointer in RAM to store read data. |
from | Address in scratchpad file to read data from. |
amount | Number of bytes to read. |
Definition at line 464 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_setBootable_f) (void) |
Set scratchpad as bootable.
Definition at line 525 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_setStatus_f) (uint32_t status) |
Definition at line 527 of file bl_interface.h.
typedef bl_interface_res_e(* bl_scrat_write_f) (uint32_t to, const void *from, size_t amount, bl_scrat_write_status_e *status) |
Write bytes to scratchpad area.
to | Address in scratchpad to write data to. |
from | Pointer in RAM to the data to be written. |
amount | Number of bytes to write. |
status | The result of the write operation state machine. |
Definition at line 503 of file bl_interface.h.
struct bl_flash_info_t |
Flash memory info definition.
Definition at line 57 of file bl_interface.h.
struct bl_memory_area_info_t |
Memory Area info definition.
Definition at line 91 of file bl_interface.h.
Data Fields | ||
---|---|---|
bl_memory_area_id_t | area_id |
Id of the area |
uint32_t | area_physical_address |
Area physical address in flash |
size_t | area_size |
Size in bytes of the area |
bool | external_flash |
true if area is located in external flash |
bl_flash_info_t | flash |
Description of the flash memory where the area is located |
bool | has_header |
true if bl_area_info_header_t is stored at the beginning of area |
bl_memory_area_type_e | type |
Type of memory area |
struct bl_memory_area_header_t |
Informations contained in the header that the bootloader can store in the beginning of an area (only used by stack and application for now).
Definition at line 113 of file bl_interface.h.
struct bl_scrat_info_t |
Scratchpad info definition.
Definition at line 197 of file bl_interface.h.
Data Fields | ||
---|---|---|
uint32_t | area_length |
Maximum possible length for the scratchpad (including tag and header) |
uint16_t | crc |
CRC16-CCITT, not including any tag or header bytes |
bool | dedicated |
true if scratchpad has is own dedicated area |
uint32_t | erase_time |
theorical erase time of the whole scratchpad area |
uint8_t | flags |
Flags used by the stack to determine if the scratchpad must be taken into use if the connection to the sink is lost for more than one hour. |
uint32_t | length |
Number of bytes (including tag and header) |
uint32_t | modem_fw_data |
Offset of modem firmware data in the scratchpad memory area, valid only when status is BL_SCRATCHPAD_STATUS_MODEM_FW_PENDING |
uint32_t | modem_fw_length |
Length of modem firmware file in bytes, valid only when status is BL_SCRATCHPAD_STATUS_MODEM_FW_PENDING |
bl_scrat_modem_file_type_e | modem_fw_type |
Type of the modem firmware present in scratchpad valid only when status is BL_SCRATCHPAD_STATUS_MODEM_FW_PENDING |
uint8_t | seq |
Sequence number of data in scratchpad: bl_scratchpad_seq_t, we don't want dependancies with the bootloader here. BL_SCRATCHPAD_MIN_SEQ .. BL_SCRATCHPAD_MAX_SEQ |
uint32_t | status |
Status code from bootloader: bl_scratchpad_status_e |
uint32_t | type |
Scratchpad type information for bootloader: bl_header_type_e |
union bl_platform_t |
Platform specific descriptions.
Definition at line 278 of file bl_interface.h.
struct bl_hardware_capabilities_t |
Hardware features that can be installed on a board.
Definition at line 304 of file bl_interface.h.
Data Fields | ||
---|---|---|
bool | crystal_32k |
True if 32kHz crystal is present; default:true (introduced in bootloader v7). |
bool | dcdc |
True if DCDC converter is enabled; default:true (introduced in bootloader v7). |
bl_platform_t | platform |
Platform specific descriptions (introduced in bootloader v8). |
struct memory_area_services_t |
Definition at line 538 of file bl_interface.h.
Data Fields | ||
---|---|---|
bl_memory_area_getAreaHeader_f | getAreaHeader | |
bl_memory_area_getAreaInfo_f | getAreaInfo | |
bl_memory_area_getAreaList_f | getAreaList | |
bl_memory_area_getIdfromType_f | getIdfromType | |
bl_memory_area_getMaxNumAreas_f | getMaxNumAreas | |
bl_memory_area_isBusy_f | isBusy | |
bl_memory_area_startErase_f | startErase | |
bl_memory_area_startRead_f | startRead | |
bl_memory_area_startWrite_f | startWrite |
struct scratchpad_services_t |
Definition at line 551 of file bl_interface.h.
Data Fields | ||
---|---|---|
bl_scrat_begin_f | begin | |
bl_scrat_clear_f | clear | |
bl_scrat_getInfo_f | getInfo | |
bl_scrat_getValidity_f | getValidity | |
bl_scrat_read_f | read | |
bl_scrat_setBootable_f | setBootable | |
bl_scrat_setStatus_f | setStatus | |
bl_scrat_write_f | write |
struct hardware_services_t |
Definition at line 563 of file bl_interface.h.
Data Fields | ||
---|---|---|
bl_hardware_getCapabilities_f | getCapabilities |
struct bl_interface_t |
Global interface entry point with a version id.
Definition at line 571 of file bl_interface.h.
Data Fields | ||
---|---|---|
const void * | dflow_services_p | |
const hardware_services_t * | hardware_services_p | |
const memory_area_services_t * | memory_area_services_p | |
const scratchpad_services_t * | scratchpad_services_p | |
uint32_t | version |
enum bl_interface_res_e |
Bootloader interface operations result.
Definition at line 25 of file bl_interface.h.
Types of Memory Areas.
Definition at line 44 of file bl_interface.h.
Type of modem FW image present in scratchpad
Enumerator | |
---|---|
BL_SCRAT_MODEM_FILE_TYPE_FULL_IMAGE | Full modem FW image |
BL_SCRAT_MODEM_FILE_TYPE_DELTA_IMAGE | Delta modem FW image |
BL_SCRAT_MODEM_FILE_TYPE_INVALID | Invalid image |
Definition at line 186 of file bl_interface.h.
enum bl_scrat_type_e |
Scratchpad type enum.
Enumerator | |
---|---|
BL_SCRAT_TYPE_BLANK | No valid scratchpad stored |
BL_SCRAT_TYPE_PRESENT | Valid scratchpad stored |
BL_SCRAT_TYPE_PROCESS | Valid scratchpad stored and marked to be processed by the bootloader |
Definition at line 133 of file bl_interface.h.
enum bl_scrat_valid_e |
Scratchpad validity.
Definition at line 167 of file bl_interface.h.
Scratchpad write status.
Definition at line 144 of file bl_interface.h.
#define BL_MEMORY_AREA_UNDEFINED 0xFFFFFFFF |
Value of an area that doesn't exists.
Definition at line 38 of file bl_interface.h.