48 #define IAP_LOCATION 0x7FFFFFF1
50 #define IAP_PREPARE_SECTORS 50
51 #define IAP_COPY_RAM_TO_FLASH 51
52 #define IAP_ERASE_SECTORS 52
53 #define IAP_BLANK_CHECK_SECTORS 53
54 #define IAP_READ_PART_ID 54
55 #define IAP_COMPARE 56
89 for (i = 0; i < size; i++) {
106 iap_entry(command, result);
108 if (result[0] != 0) {
return result[0]; }
127 flash->
addr = 0x7C000;
148 iap_entry(command, result);
150 if (result[0] != 0) {
return result[0]; }
157 iap_entry(command, result);
159 if (result[0] != 0) {
return result[0]; }
165 iap_entry(command, result);
166 if (result[0] != 0) {
return result[0]; }
185 iap_entry(command, result);
187 if (result[0] != 0) {
return result[0]; }
194 command[4] =
CCLK / 1000;
196 iap_entry(command, result);
198 if (result[0] != 0) {
return result[0]; }
215 for (i = 0; i < size; i +=
BOUND) {
217 for (j = 0; j <
BOUND; j++) {
221 data[(BOUND -
FSIZ) / 4] = size;
222 data[(BOUND -
FCHK) / 4] = chksum;
228 if (i <= flash->page_size -
BOUND) {
239 for (i = 0; i < size; i++) {
253 if ((size > flash_info.
page_size -
FSIZ) || (size == 0)) {
return -2; }
268 if ((size > flash.
page_size -
FSIZ) || (size == 0)) {
return -2; }
278 for (i = 0; i < size; i++) {
int32_t persistent_write(void *ptr, uint32_t size)
#define IAP_PREPARE_SECTORS
static int32_t pflash_erase_page(FlashInfo *flash)
#define IAP_BLANK_CHECK_SECTORS
static int32_t flash_detect(FlashInfo *flash)
int32_t persistent_read(void *ptr, uint32_t size)
void(* IAP)(uint32_t[], uint32_t[])
static int32_t pflash_program_array(FlashInfo *flash, uint32_t dest, uint32_t src)
unsigned disableIRQ(void)
Persistent settings interface.
#define IAP_ERASE_SECTORS
static uint32_t pflash_checksum(uint32_t ptr, uint32_t size)
static int32_t pflash_program_bytes(FlashInfo *flash, uint32_t src, uint32_t size, uint32_t chksum)
#define IAP_COPY_RAM_TO_FLASH
int32_t persistent_clear(void)