19#include "bootloader.h"
20#include "bootloader_error.h"
29#define NUM_FLASH_PAGES 128U
32#define BOOTLOADER_PAGE_BYTES ((size_t)0x800)
35#define BOOTLOADER_FLASH_WORD_SIZE 4U
42#define BOOTLOADER_ADDR_TO_PAGE(addr) (((uintptr_t)(addr) - (uintptr_t)APPLICATION_START_ADDRESS) / BOOTLOADER_PAGE_BYTES)
49#define BOOTLOADER_PAGE_TO_ADDR(page) ((uintptr_t)(page) * (uintptr_t)BOOTLOADER_PAGE_BYTES + (uintptr_t)APPLICATION_START_ADDRESS)
BootloaderError boot_flash_read(uintptr_t address, uint8_t *buffer, size_t buffer_len)
Read from flash memory.
Definition: bootloader_flash.c:25
BootloaderError boot_flash_erase(uint8_t start_page, uint8_t num_pages)
Erase some number of flash pages.
Definition: bootloader_flash.c:21
BootloaderError boot_verify_flash_memory(void)
Verify that the flash memory is not erased.
Definition: bootloader_flash.c:29
BootloaderError boot_flash_write(uintptr_t address, uint8_t *buffer, size_t buffer_len)
Write to flash memory.
Definition: bootloader_flash.c:17
BootloaderError
Bootloader error definitions.
Definition: bootloader_error.h:28