Wirepas SDK
bl_interface.h File Reference

Detailed Description

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...
 

Enumerations

enum  bl_interface_res_e {
  BL_RES_OK = 0 , BL_RES_ERROR = 1 , BL_RES_BUSY = 2 , BL_RES_NODRIVER = 3 ,
  BL_RES_PARAM = 4 , BL_RES_INVALID_AREA = 5 , BL_RES_TIMEOUT = 6 , BL_RES_INVALID_STATE = 7
}
 Bootloader interface operations result. More...
 
enum  bl_memory_area_type_e {
  BL_MEM_AREA_TYPE_BOOTLOADER = 0 , BL_MEM_AREA_TYPE_STACK = 1 , BL_MEM_AREA_TYPE_APPLICATION = 2 , BL_MEM_AREA_TYPE_PERSISTENT = 3 ,
  BL_MEM_AREA_TYPE_SCRATCHPAD = 4 , BL_MEM_AREA_TYPE_USER = 5 , BL_MEM_AREA_TYPE_MODEMFW = 6 , BL_MEM_AREA_TYPE_MODEMDELTAFW = 7
}
 Types of Memory Areas. More...
 
enum  bl_scrat_type_e { BL_SCRAT_TYPE_BLANK = 0 , BL_SCRAT_TYPE_PRESENT = 1 , BL_SCRAT_TYPE_PROCESS = 2 }
 Scratchpad type enum. More...
 
enum  bl_scrat_write_status_e {
  BL_SCRAT_WRITE_STATUS_OK = 0 , BL_SCRAT_WRITE_STATUS_COMPLETED_OK = 1 , BL_SCRAT_WRITE_STATUS_COMPLETED_ERROR = 2 , BL_SCRAT_WRITE_STATUS_NOT_ONGOING = 3 ,
  BL_SCRAT_WRITE_STATUS_INVALID_START = 4 , BL_SCRAT_WRITE_STATUS_INVALID_NUM_BYTES = 5 , BL_SCRAT_WRITE_STATUS_INVALID_HEADER = 6 , BL_SCRAT_WRITE_STATUS_INVALID_NULL_BYTES = 7 ,
  BL_SCRAT_WRITE_STATUS_FLASH_ERROR = 8
}
 Scratchpad write status. More...
 
enum  bl_scrat_valid_e {
  BL_SCRAT_IS_UNKNOWN , BL_SCRAT_IS_CLEAR , BL_SCRAT_IS_NOTAG , BL_SCRAT_IS_INVALID_HEADER ,
  BL_SCRAT_IS_INVALID_CRC , BL_SCRAT_IS_INVALID , BL_SCRAT_IS_VALID
}
 Scratchpad validity. More...
 
enum  bl_scrat_modem_file_type_e { BL_SCRAT_MODEM_FILE_TYPE_FULL_IMAGE = 0 , BL_SCRAT_MODEM_FILE_TYPE_DELTA_IMAGE = 1 , BL_SCRAT_MODEM_FILE_TYPE_INVALID = 255 }
 

Macros

#define BL_MEMORY_AREA_UNDEFINED   0xFFFFFFFF
 Value of an area that doesn't exists.
 

Typedef Documentation

◆ bl_hardware_getCapabilities_f

typedef const bl_hardware_capabilities_t *(* bl_hardware_getCapabilities_f) (void)

Returns board hardware capabilities.

Returns
Return a structure bl_hardware_capabilities_t with hardware features installed on the board.

Definition at line 534 of file bl_interface.h.

◆ bl_memory_area_getAreaHeader_f

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.

Parameters
idId of the memory area to get info from.
headerpointer to an bl_memory_area_header_t structure.
Returns
Result code, BL_RES_OK if successful. BL_RES_ERROR if the area has no stored or invalid header. See bl_interface_res_e for other result codes.

Definition at line 428 of file bl_interface.h.

◆ bl_memory_area_getAreaInfo_f

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.

Parameters
idId of the memory area to get info from.
infopointer to an memoryArea_info_t structure.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 389 of file bl_interface.h.

◆ bl_memory_area_getAreaList_f

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.

Parameters
listpointer to an array of areas.
num_areasIn: size of the array list. Out: number of defined areas.
Returns
none

Definition at line 400 of file bl_interface.h.

◆ bl_memory_area_getIdfromType_f

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.

Note
If there is more than one area with the same type. The first one is always returned.
Parameters
idId of the area if found, BL_MEMORY_AREA_UNDEFINED otherwise.
typeType of the area area to find.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 414 of file bl_interface.h.

◆ bl_memory_area_getMaxNumAreas_f

typedef uint8_t(* bl_memory_area_getMaxNumAreas_f) (void)

Return the total number of areas supported by the bootloader.

Returns
Number of areas supported by the bootloader
Note
Bootloaders prior to version 10 do not have this function. Instead, a macro called BL_MEMORY_AREA_MAX_AREAS is defined, which has a value of 8.

Definition at line 438 of file bl_interface.h.

◆ bl_memory_area_id_t

typedef uint32_t bl_memory_area_id_t

Memory Area id definition.

Definition at line 41 of file bl_interface.h.

◆ bl_memory_area_isBusy_f

typedef bool(* bl_memory_area_isBusy_f) (bl_memory_area_id_t id)

Checks if underlying flash driver is busy.

Parameters
idId of the memory area to check.
Returns
true: driver is busy, false otherwise.

Definition at line 378 of file bl_interface.h.

◆ bl_memory_area_startErase_f

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.

Parameters
idId of the memory area to erase to.
sector_basepointer 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_sectorPointer to number of sector to erase. Returns the number of remaining sector to erase.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 369 of file bl_interface.h.

◆ bl_memory_area_startRead_f

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.

Parameters
idId of the memory area to read from.
toPointer in RAM to store read data.
fromAddress in memory area to read data from.
amountNumber of bytes to read.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 333 of file bl_interface.h.

◆ bl_memory_area_startWrite_f

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.

Parameters
idId of the memory area to write to.
toAddress in memory area to write data to.
fromPointer in RAM to the data to be written.
amountNumber of bytes to write.
Note
Writes to internal flash memory must be 4 bytes aligned.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 352 of file bl_interface.h.

◆ bl_scrat_begin_f

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.

Parameters
num_bytesTotal number of bytes to write
seqScratchpad sequence number
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.
Note
Scratchpad memory is implicitly cleared if this call succeeds

Definition at line 485 of file bl_interface.h.

◆ bl_scrat_clear_f

typedef bl_interface_res_e(* bl_scrat_clear_f) (void(*clear_wdt)(void))

Erase the scratchpad area.

Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 473 of file bl_interface.h.

◆ bl_scrat_getInfo_f

typedef bl_interface_res_e(* bl_scrat_getInfo_f) (bl_scrat_info_t *info)

Fills a structure with info about the scratchpad.

Parameters
infopointer to an scratchpad_info_t structure.
Note
doesn't check if header/scratchpad is valid. some data may be false.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 517 of file bl_interface.h.

◆ bl_scrat_getValidity_f

typedef bl_interface_res_e(* bl_scrat_getValidity_f) (bl_scrat_valid_e *validity)

Check if the scratchpad contains valid data.

Note
Valid data isn't necessarily a firmware image
Parameters
validityFilled with scratchpad validity code.
Returns
Result code, BL_RES_OK if validity field has successfully been updated (and not necessarily BL_SCRAT_IS_VALID). See bl_interface_res_e for other result codes.

Definition at line 449 of file bl_interface.h.

◆ bl_scrat_read_f

typedef bl_interface_res_e(* bl_scrat_read_f) (void *to, uint32_t from, size_t amount)

Read bytes from a scratchpad file.

Parameters
toPointer in RAM to store read data.
fromAddress in scratchpad file to read data from.
amountNumber of bytes to read.
Returns
Result code, BL_RES_OK if successful. Returns BL_RES_ERROR if scratchpad is invalid. See bl_interface_res_e for other result codes.

Definition at line 464 of file bl_interface.h.

◆ bl_scrat_setBootable_f

typedef bl_interface_res_e(* bl_scrat_setBootable_f) (void)

Set scratchpad as bootable.

Note
Does nothing if scratchpad was already set to be bootable
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 525 of file bl_interface.h.

◆ bl_scrat_setStatus_f

typedef bl_interface_res_e(* bl_scrat_setStatus_f) (uint32_t status)

Definition at line 527 of file bl_interface.h.

◆ bl_scrat_write_f

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.

Parameters
toAddress in scratchpad to write data to.
fromPointer in RAM to the data to be written.
amountNumber of bytes to write.
Note
Writes must be 4 bytes aligned.
Parameters
statusThe result of the write operation state machine.
Returns
Result code, BL_RES_OK if successful. See bl_interface_res_e for other result codes.

Definition at line 503 of file bl_interface.h.


Data Structure Documentation

◆ bl_flash_info_t

struct bl_flash_info_t

Flash memory info definition.

Definition at line 57 of file bl_interface.h.

Data Fields
uint32_t byte_write_call_time

Time taken by startWrite() call for one byte in uS

uint32_t byte_write_time

Time taken by the Flash chipset to write one byte in uS.

Note
For internal Flash driver write (erase) time is 0. Duz to hardware limitation the driver is fully synchronous so the write (erase) to Flash is finished when startWrite (startErase) returns.
size_t erase_sector_size

Size of an erase sector

size_t flash_size

Size in bytes of the flash

uint32_t is_busy_call_time

Time taken by isBusy() call in uS

uint32_t page_write_call_time

Time taken by startWrite() call for one page in uS

uint32_t page_write_time

Time taken by the flash chipset write one page in uS

uint32_t sector_erase_call_time

Time taken by startErase() call for one sector in uS

uint32_t sector_erase_time

Time taken by the flash chipset to erase on sector in uS

size_t write_alignment

Minimum write alignment supported by the flash hardware. Write address must be aligned on write_alignment and write amount must be a multiple of write_alignment bytes.

size_t write_page_size

Size of a write page

◆ bl_memory_area_info_t

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

◆ bl_memory_area_header_t

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.

Data Fields
uint16_t crc

CRC16-CCITT of scratchpad, not including any header or tag bytes

uint8_t devel

Firmware development version number component

uint32_t length

Number of bytes of scratchpad, not including header and tag

uint8_t maint

Firmware maintenance version number component

uint8_t major

Firmware major version number component

uint8_t minor

Firmware minor version number component

uint8_t seq

Sequence number of data in scratchpad: BL_SCRATCHPAD_MIN_SEQ .. BL_SCRATCHPAD_MAX_SEQ

◆ bl_scrat_info_t

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

◆ bl_platform_t

union bl_platform_t

Platform specific descriptions.

Definition at line 278 of file bl_interface.h.

◆ bl_hardware_capabilities_t

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).

◆ memory_area_services_t

struct memory_area_services_t

◆ scratchpad_services_t

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

◆ hardware_services_t

struct hardware_services_t

Definition at line 563 of file bl_interface.h.

Data Fields
bl_hardware_getCapabilities_f getCapabilities

◆ bl_interface_t

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

Enumeration Type Documentation

◆ bl_interface_res_e

Bootloader interface operations result.

Enumerator
BL_RES_OK 

Operation is successful.

BL_RES_ERROR 

Error during operation.

BL_RES_BUSY 

Underneath flash driver is busy.

BL_RES_NODRIVER 

There is no external flash driver.

BL_RES_PARAM 

Invalid parameters.

BL_RES_INVALID_AREA 

Area doesn't exists.

BL_RES_TIMEOUT 

Synchronous call timeout.

BL_RES_INVALID_STATE 

Write ongoing or scratchpad not valid.

Definition at line 25 of file bl_interface.h.

26{
27 BL_RES_OK = 0,
28 BL_RES_ERROR = 1,
29 BL_RES_BUSY = 2,
30 BL_RES_NODRIVER = 3,
31 BL_RES_PARAM = 4,
33 BL_RES_TIMEOUT = 6,
bl_interface_res_e
Bootloader interface operations result.
@ BL_RES_ERROR
Error during operation.
@ BL_RES_TIMEOUT
Synchronous call timeout.
@ BL_RES_BUSY
Underneath flash driver is busy.
@ BL_RES_INVALID_AREA
Area doesn't exists.
@ BL_RES_INVALID_STATE
Write ongoing or scratchpad not valid.
@ BL_RES_OK
Operation is successful.
@ BL_RES_NODRIVER
There is no external flash driver.
@ BL_RES_PARAM
Invalid parameters.

◆ bl_memory_area_type_e

Types of Memory Areas.

Enumerator
BL_MEM_AREA_TYPE_BOOTLOADER 

Bootloader area.

BL_MEM_AREA_TYPE_STACK 

Stack area.

BL_MEM_AREA_TYPE_APPLICATION 

Application area.

BL_MEM_AREA_TYPE_PERSISTENT 

Persistent memory area.

BL_MEM_AREA_TYPE_SCRATCHPAD 

Dedicated scratchpad area.

BL_MEM_AREA_TYPE_USER 

User defined area.

BL_MEM_AREA_TYPE_MODEMFW 

Modem firmware area.

BL_MEM_AREA_TYPE_MODEMDELTAFW 

Modem delta firmware area.

Definition at line 44 of file bl_interface.h.

45{
bl_memory_area_type_e
Types of Memory Areas.
@ BL_MEM_AREA_TYPE_APPLICATION
Application area.
@ BL_MEM_AREA_TYPE_BOOTLOADER
Bootloader area.
@ BL_MEM_AREA_TYPE_MODEMFW
Modem firmware area.
@ BL_MEM_AREA_TYPE_STACK
Stack area.
@ BL_MEM_AREA_TYPE_SCRATCHPAD
Dedicated scratchpad area.
@ BL_MEM_AREA_TYPE_MODEMDELTAFW
Modem delta firmware area.
@ BL_MEM_AREA_TYPE_USER
User defined area.
@ BL_MEM_AREA_TYPE_PERSISTENT
Persistent memory area.

◆ bl_scrat_modem_file_type_e

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.

187{
bl_scrat_modem_file_type_e
@ BL_SCRAT_MODEM_FILE_TYPE_DELTA_IMAGE
@ BL_SCRAT_MODEM_FILE_TYPE_FULL_IMAGE
@ BL_SCRAT_MODEM_FILE_TYPE_INVALID

◆ 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.

134{
bl_scrat_type_e
Scratchpad type enum.
@ BL_SCRAT_TYPE_PRESENT
@ BL_SCRAT_TYPE_PROCESS
@ BL_SCRAT_TYPE_BLANK

◆ bl_scrat_valid_e

Scratchpad validity.

Enumerator
BL_SCRAT_IS_UNKNOWN 

Scratchpad validity has not been determined, yet

BL_SCRAT_IS_CLEAR 

Scratchpad memory has been cleared, completely

BL_SCRAT_IS_NOTAG 

Scratchpad tag not found

BL_SCRAT_IS_INVALID_HEADER 

Scratchpad found but header is not valid

BL_SCRAT_IS_INVALID_CRC 

Scratchpad found but CRC doesn't match

BL_SCRAT_IS_INVALID 

default error code, write ongoing, flash read error

BL_SCRAT_IS_VALID 

Scratchpad header present and CRC is correct

Definition at line 167 of file bl_interface.h.

168{
bl_scrat_valid_e
Scratchpad validity.
@ BL_SCRAT_IS_UNKNOWN
@ BL_SCRAT_IS_INVALID_HEADER
@ BL_SCRAT_IS_VALID
@ BL_SCRAT_IS_NOTAG
@ BL_SCRAT_IS_INVALID
@ BL_SCRAT_IS_CLEAR
@ BL_SCRAT_IS_INVALID_CRC

◆ bl_scrat_write_status_e

Scratchpad write status.

Enumerator
BL_SCRAT_WRITE_STATUS_OK 

Write completed successfully

BL_SCRAT_WRITE_STATUS_COMPLETED_OK 

All data received and CRC is correct

BL_SCRAT_WRITE_STATUS_COMPLETED_ERROR 

All data received but CRC is incorrect

BL_SCRAT_WRITE_STATUS_NOT_ONGOING 

No writes have been started

BL_SCRAT_WRITE_STATUS_INVALID_START 

Byte offset is invalid

BL_SCRAT_WRITE_STATUS_INVALID_NUM_BYTES 

Number of bytes is invalid

BL_SCRAT_WRITE_STATUS_INVALID_HEADER 

Header does not seem to be correct

BL_SCRAT_WRITE_STATUS_INVALID_NULL_BYTES 

Bytes is NULL

BL_SCRAT_WRITE_STATUS_FLASH_ERROR 

Flash driver returned an error

Definition at line 144 of file bl_interface.h.

145{
bl_scrat_write_status_e
Scratchpad write status.
@ BL_SCRAT_WRITE_STATUS_INVALID_HEADER
@ BL_SCRAT_WRITE_STATUS_COMPLETED_OK
@ BL_SCRAT_WRITE_STATUS_INVALID_NULL_BYTES
@ BL_SCRAT_WRITE_STATUS_INVALID_START
@ BL_SCRAT_WRITE_STATUS_INVALID_NUM_BYTES
@ BL_SCRAT_WRITE_STATUS_OK
@ BL_SCRAT_WRITE_STATUS_NOT_ONGOING
@ BL_SCRAT_WRITE_STATUS_FLASH_ERROR
@ BL_SCRAT_WRITE_STATUS_COMPLETED_ERROR

Macro Definition Documentation

◆ BL_MEMORY_AREA_UNDEFINED

#define BL_MEMORY_AREA_UNDEFINED   0xFFFFFFFF

Value of an area that doesn't exists.

Definition at line 38 of file bl_interface.h.