Trident IoT SDK
 
Loading...
Searching...
No Matches
bootloader.h
Go to the documentation of this file.
1
10#ifndef BOOTLOADER_H
11#define BOOTLOADER_H
12
13#include "tr_hal_config.h"
14#include "tr_printf.h"
15
16#define FLASH_PAGE_PROGRAMMING_SIZE 256
17#define SIZE_OF_FLASH_SECTOR_ERASE 4096
18#define FLASH_PAGE_MASK (~(256 - 1))
19
20#ifndef PRINT_ENABLE
21#define PRINT_ENABLE 0
22#endif
23
24// this define controls how the bootloader looks for the start of xmodem
25// if it is a 1, it looks for an 'x', otherwise it simply starts by sending
26// the NAK and hopes for a response.
27// rignt now leave this set to 1
28#define LOOK_FOR_START_CHAR 1
29
30#if PRINT_ENABLE
31#define PRINT(...) tr_printf(__VA_ARGS__)
32#else
33#define PRINT(...)
34#endif
35
36void set_flash_erase(uint32_t flash_addr,
37 uint32_t image_size);
38int serial_read(int length,
39 int timeout_ms);
40uint32_t crc32(uint32_t flash_addr,
41 uint32_t data_len);
42
43#endif // BOOTLAODER_H
void set_flash_erase(uint32_t flash_addr, uint32_t image_size)
int serial_read(int length, int timeout_ms)
uint32_t crc32(uint32_t flash_addr, uint32_t data_len)
A simple printf utility for debug prints and cli support. Required for remote CLI to function properl...