19#include "fota_error.h"
28#define NUM_FLASH_PAGES 128U
31#define FOTA_PAGE_BYTES ((uint32_t)0x800U)
34#define FOTA_PING_BYTES ((uint32_t)0x1000U)
37#define FOTA_FLASH_WORD_SIZE 4U
44#define FOTA_ADDR_TO_PAGE(addr) (((uintptr_t)(addr) - (uintptr_t)APPLICATION_START_ADDRESS) / FOTA_PAGE_BYTES)
51#define FOTA_PAGE_TO_ADDR(page) ((uintptr_t)(page) * (uintptr_t)FOTA_PAGE_BYTES + (uintptr_t)APPLICATION_START_ADDRESS)
FotaError fota_verify_flash_memory(void)
Verify that the flash memory is not erased.
FotaError fota_flash_read(uintptr_t address, uint8_t *buffer, uint32_t buffer_len)
Read from flash memory.
FotaError fota_flash_write(uintptr_t address, uint8_t *buffer, uint32_t buffer_len)
Write to flash memory.
FotaError
FOTA Error code definitions.
Definition: fota_error.h:27
FotaError fota_flash_erase(uint8_t start_page, uint8_t num_pages)
Erase some number of flash pages.