35#ifndef _INCLUDE_FREERTOS_BOOTLOADER_HAL_H_
36#define _INCLUDE_FREERTOS_BOOTLOADER_HAL_H_
50#define CHECKSUM_COUNT 4
166 const void *address,
const void **page_start, uint32_t *page_length_bytes);
196 const void *address,
const void *data, uint32_t size_bytes);
208 const void *address,
const void *data, uint32_t size_bytes);
221extern void checksum_data(
const void* data, uint32_t size, uint32_t* checksum);
bool try_send_can_frame(const struct can_frame &frame)
Callback from the bootloader to transmit a single CAN frame.
void get_flash_boundaries(const void **flash_min, const void **flash_max, const struct app_header **app_header)
Returns the boundaries of the user flash.
void raw_write_flash(const void *address, const void *data, uint32_t size_bytes)
Writes data to the flash.
void bootloader_reboot(void)
Resets the microcontroller.
void application_entry(void)
Enters the application.
uint32_t __bootloader_magic_ptr
This is the place where REQUEST_BOOTLOADER has to be written before rebooting the MCU to force enteri...
static const uint32_t REQUEST_BOOTLOADER
Write this value to __bootloader_magic_ptr and jump to the bootloader entry point in order to explici...
unsigned bool
Hack to allow compiling this code in C context too.
BootloaderLed
Parametrizes the bootloader_led function with logical functions that can be assigned to physical LEDs...
void erase_flash_page(const void *address)
Erases the flash page at a specific address.
void get_flash_page_info(const void *address, const void **page_start, uint32_t *page_length_bytes)
Rounds a flash address into a flash page.
void raw_erase_flash_page(const void *address)
Erases the flash page at a specific address.
void bootloader_led(enum BootloaderLed led, bool value)
Sets status LEDs.
void bootloader_hw_set_to_safe(void)
Initializes the hardware to a safe state of the outputs.
#define CHECKSUM_COUNT
Number of 32-bit words in one checksum data.
uint16_t flash_complete(void)
Signals that the bootloading operation is complete.
void checksum_data(const void *data, uint32_t size, uint32_t *checksum)
Computes checksum over a block of data.
bool request_bootloader(void)
void bootloader_hw_init(void)
Called after hw_set_to_safe and after the bss and data segments are initialized.
bool read_can_frame(struct can_frame *frame)
Checks if there is an incoming CAN frame from the hardware.
uint16_t nmranet_alias(void)
Suggests an NMRAnet CAN alias for use.
uint64_t nmranet_nodeid(void)
Callback from the bootloader to obtain the node-id to use.
void write_flash(const void *address, const void *data, uint32_t size_bytes)
Writes data to the flash.