Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Infuse DFU helper APIs

Functions

void infuse_dfu_write_erase_start (const struct flash_area *fa)
 Prepare a flash area for write/erase.
void infuse_dfu_write_erase_finish (const struct flash_area *fa)
 Finalise a flash area write/erase.
int infuse_dfu_image_erase (const struct flash_area *fa, size_t image_len, infuse_progress_cb_t progress_cb, bool mcuboot_trailer)
 Erase a flash area to be ready for a new image.
int infuse_dfu_image_metadata_clear (const struct flash_area *fa, size_t image_end)
 Clear stale MCUboot metadata around an image already present in a flash area.
int infuse_dfu_nrf91_modem_delta_prepare (void)
 Prepare the nRF91 modem for a delta image upgrade.
int infuse_dfu_nrf91_modem_delta_finish (void)
 Finalise a nRF91 modem delta image upgrade.

Detailed Description

Function Documentation

◆ infuse_dfu_image_erase()

int infuse_dfu_image_erase ( const struct flash_area * fa,
size_t image_len,
infuse_progress_cb_t progress_cb,
bool mcuboot_trailer )

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/dfu/helpers.h>

Erase a flash area to be ready for a new image.

If the flash device does not require an explicit erase, the image area is not erased. Stale MCUboot metadata (data before the image start offset and the trailer) is still cleared if mcuboot_trailer is set.

Parameters
faFlash area to erase (must be already opened)
image_lenLength of image, including any offset from the start of the area. Zero erases nothing beyond the MCUboot metadata.
progress_cbOptional progress callback
mcuboot_trailerClear stale MCUboot metadata: the MCUboot trailer, and on flash that does not require an explicit erase, any data before the image start offset (see boot_get_image_start_offset)
Return values
0On success
-errnoError code from flash_get_page_info_by_offs or flash_area_flatten on failure

◆ infuse_dfu_image_metadata_clear()

int infuse_dfu_image_metadata_clear ( const struct flash_area * fa,
size_t image_end )

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/dfu/helpers.h>

Clear stale MCUboot metadata around an image already present in a flash area.

Clears any data before the image start offset (see boot_get_image_start_offset) and the MCUboot trailer, without modifying the image itself. Used when the image data already matches but an upgrade still needs to be requested.

Parameters
faFlash area containing the image (must be already opened)
image_endOffset of the end of the image within the flash area
Return values
0On success
-EINVALImage overlaps the MCUboot trailer, metadata cannot be cleared in place
-ENOTSUPMCUboot trailer location unknown
-errnoError code from flash_get_page_info_by_offs or flash_area_flatten on failure

◆ infuse_dfu_nrf91_modem_delta_finish()

int infuse_dfu_nrf91_modem_delta_finish ( void )

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/dfu/helpers.h>

Finalise a nRF91 modem delta image upgrade.

Return values
0On success
-errnoError code from nrf_modem_delta_dfu_write_done or nrf_modem_delta_dfu_update

◆ infuse_dfu_nrf91_modem_delta_prepare()

int infuse_dfu_nrf91_modem_delta_prepare ( void )

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/dfu/helpers.h>

Prepare the nRF91 modem for a delta image upgrade.

Return values
0On success
-errnoError code from nrf_modem_delta_dfu_offset, nrf_modem_delta_dfu_erase or nrf_modem_delta_dfu_write_init

◆ infuse_dfu_write_erase_finish()

void infuse_dfu_write_erase_finish ( const struct flash_area * fa)

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/dfu/helpers.h>

Finalise a flash area write/erase.

Cleanup the infuse_dfu_write_erase_start call once complete.

Parameters
faFlash area (must be already opened)

◆ infuse_dfu_write_erase_start()

void infuse_dfu_write_erase_start ( const struct flash_area * fa)

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/dfu/helpers.h>

Prepare a flash area for write/erase.

Prepare to erase or write to a flash area.

Note
MUST call infuse_dfu_write_erase_finish when complete
Parameters
faFlash area (must be already opened)