// binary
#define KALUMA_BINARY_MAX 0x100000 // 1MB
// flash
#define KALUMA_FLASH_OFFSET KALUMA_BINARY_MAX
#define KALUMA_FLASH_SECTOR_SIZE 4096
#define KALUMA_FLASH_SECTOR_COUNT 256
#define KALUMA_FLASH_PAGE_SIZE 256
// flash sector examples:
// - sector 0~15 : storage area
// - sector 16~127 : code area
// - sector 128~255 : file system (lfs)
// user program on flash
#define KALUMA_PROG_SECTOR_BASE 0
#define KALUMA_PROG_SECTOR_COUNT 128
prog.h/c
Storing and accessing user's program.
depends on flash.h and board.h.
program.h don't need to be ported.
Place on include/program.h, src/program.c
[x] #457
#include "flash.h"
extern uint8_t *km_program_base = (uint8_t *)KALUMA_PROG_BASE;
int km_prog_clear();
int km_prog_begin();
int km_prog_write(int8_t *buffer, int size);
int km_prog_end();
int km_prog_get_size();
int km_prog_max_size();
board.h
prog.h/c
Storing and accessing user's program.
flash.h
andboard.h
.program.h
don't need to be ported.include/program.h
,src/program.c