20#include "fota_error.h"
29#define NUM_FLASH_PAGES 128U
32#define FOTA_PAGE_BYTES ((uint32_t)0x800U)
35#define FOTA_PING_BYTES ((uint32_t)0x1000U)
42#define FOTA_ADDR_TO_PAGE(addr) (((uintptr_t)(addr) - (uintptr_t)APP_ACTIVE_START_ADDRESS) / FOTA_PAGE_BYTES)
49#define FOTA_PAGE_TO_ADDR(page) ((uintptr_t)(page) * (uintptr_t)FOTA_PAGE_BYTES + (uintptr_t)APP_ACTIVE_START_ADDRESS)
FotaError fota_flash_read(uint32_t address, uint8_t *buffer, size_t buffer_len)
Read from flash memory.
Definition: fota_flash.c:87
FotaError fota_flash_write(uint32_t address, uint8_t *buffer, size_t buffer_len)
Write to flash memory.
Definition: fota_flash.c:40
FotaError
FOTA Error code definitions.
Definition: fota_error.h:27
FotaError fota_flash_erase(uint32_t start_page, uint8_t num_pages)
Erase some number of flash pages.
Definition: fota_flash.c:65
FotaError fota_verify_flash_memory(uintptr_t start_addr, size_t size_bytes)
Verify that the flash memory is not erased.
Definition: fota_flash.c:100