diff --git a/demo/os/rt-thread/stm32f10x/components/easyflash/inc/easyflash.h b/demo/os/rt-thread/stm32f10x/components/easyflash/inc/easyflash.h index 0daedcb..dff426f 100644 --- a/demo/os/rt-thread/stm32f10x/components/easyflash/inc/easyflash.h +++ b/demo/os/rt-thread/stm32f10x/components/easyflash/inc/easyflash.h @@ -67,7 +67,7 @@ if (!(EXPR)) \ while (1); \ } /* EasyFlash software version number */ -#define EF_SW_VERSION "1.09.12" +#define EF_SW_VERSION "1.09.16" typedef struct _eflash_env{ char *key; diff --git a/demo/os/rt-thread/stm32f10x/components/easyflash/src/ef_log.c b/demo/os/rt-thread/stm32f10x/components/easyflash/src/ef_log.c index 187df82..088af3f 100644 --- a/demo/os/rt-thread/stm32f10x/components/easyflash/src/ef_log.c +++ b/demo/os/rt-thread/stm32f10x/components/easyflash/src/ef_log.c @@ -173,7 +173,12 @@ static void find_start_and_end_addr(void) { log_start_addr = log_area_start_addr; cur_using_sec_addr = log_area_start_addr + cur_size; } else { - /* state 1 or 2*/ + /* like state 2 when the sector is the last one */ + if (cur_size + EF_ERASE_MIN_SIZE >= LOG_AREA_SIZE) { + cur_log_sec_state = 2; + log_start_addr = log_area_start_addr + cur_size; + cur_using_sec_addr = log_area_start_addr + cur_size - EF_ERASE_MIN_SIZE; + } } break; case FLASH_SECTOR_FULL: