Ota#

group drv_ota

Firmware update library either over the air (OTA) or via Bootloader.

Author

Alexandre Abadie alexandre.abadie@inria.fr

Copyright

Inria, 2023

Defines

DB_OTA_CHUNK_SIZE#

Size of a firmware chunk.

DB_OTA_SHA256_LENGTH#
DB_OTA_SIGNATURE_LENGTH#

Typedefs

typedef void (*db_ota_reply_t)(const uint8_t*, size_t)#

Transport agnostic function used to reply to the flasher script.

Firmware update mode

Enums

enum db_ota_mode_t#

Values:

enumerator DB_OTA_MODE_DEFAULT#

Default mode: OTA.

enumerator DB_OTA_MODE_BOOTLOADER#

Bootloader mode.

enum db_ota_cpu_type_t#

Values:

enumerator DB_OTA_CPU_NRF52833#
enumerator DB_OTA_CPU_NRF52840#
enumerator DB_OTA_CPU_NRF5340_APP#
enumerator DB_OTA_CPU_UNKNOWN#
enum db_ota_message_type_t#

Values:

enumerator DB_OTA_MESSAGE_TYPE_START#
enumerator DB_OTA_MESSAGE_TYPE_START_ACK#
enumerator DB_OTA_MESSAGE_TYPE_FW#
enumerator DB_OTA_MESSAGE_TYPE_FW_ACK#
enumerator DB_OTA_MESSAGE_TYPE_INFO#

Functions

void db_ota_init(const db_ota_conf_t *config)#

Initialize the OTA firmware update.

Parameters:
  • config[in] Pointer to the OTA configuration

void db_ota_start(void)#

Start the OTA process.

void db_ota_finish(void)#

Finalize the OTA process: switch the active partition and reboot.

void db_ota_write_chunk(const db_ota_pkt_t *pkt)#

Write a chunk of the firmware on the inactive partition.

Parameters:
  • pkt[in] Pointer the OTA packet

void db_ota_handle_message(const uint8_t *message)#

Handle received OTA message.

Parameters:
  • message[in] The message to handle

struct db_ota_conf_t#

Public Members

db_ota_reply_t reply#

Pointer to the function used to reply to the flasher script.

db_ota_mode_t mode#

Firmware update mode.

struct db_ota_start_notification_t#

Public Members

uint32_t chunk_count#

Number of chunks.

struct db_ota_pkt_t#

Public Members

uint32_t index#

Index of the chunk.

uint32_t chunk_count#

Total number of chunks.

uint8_t fw_chunk[DB_OTA_CHUNK_SIZE]#

Bytes array of the firmware chunk.

struct db_ota_message_info_t#

Public Members

db_ota_cpu_type_t cpu#
uint32_t target_partition#
db_partitions_table_t table#