From 38693b14c073e26edb30ee44f63161cb30425fb4 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 8 Feb 2019 21:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E5=90=84?= =?UTF-8?q?=E4=B8=AA=20demo=20=E4=B8=AD=E7=9A=84=20easyflash=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- .../non_os/components/easyflash/inc/ef_cfg.h | 61 ++++++------------- .../components/easyflash/inc/ef_cfg.h | 60 ++++++------------ .../rtt/components/easyflash/inc/ef_cfg.h | 59 ++++++------------ .../components/easyflash/inc/ef_cfg.h | 59 ++++++------------ easyflash/inc/ef_cfg.h | 47 ++++++-------- 5 files changed, 88 insertions(+), 198 deletions(-) diff --git a/demo/env/stm32f10x/non_os/components/easyflash/inc/ef_cfg.h b/demo/env/stm32f10x/non_os/components/easyflash/inc/ef_cfg.h index 75fa43b..d75110a 100644 --- a/demo/env/stm32f10x/non_os/components/easyflash/inc/ef_cfg.h +++ b/demo/env/stm32f10x/non_os/components/easyflash/inc/ef_cfg.h @@ -1,7 +1,7 @@ /* * This file is part of the EasyFlash Library. * - * Copyright (c) 2015, Armink, + * Copyright (c) 2015-2019, Armink, * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -32,12 +32,8 @@ #include -/* using ENV function */ +/* using ENV function, default is NG (Next Generation) mode start from V4.0 */ #define EF_USING_ENV -/* using wear leveling mode for ENV */ -/* #define EF_ENV_USING_WL_MODE */ -/* using power fail safeguard mode for ENV */ -/* #define EF_ENV_USING_PFS_MODE */ /* using IAP function */ #define EF_USING_IAP @@ -55,13 +51,15 @@ /* the minimum size of flash erasure */ #define EF_ERASE_MIN_SIZE PAGE_SIZE /* it is one page for STM3210x */ -/** +/* the flash write granularity, unit: bit + * only support 1(nor flash)/ 8(stm32f4)/ 32(stm32f1)/ 64(stm32l4) */ +#define EF_WRITE_GRAN 32 + +/* * * This all Backup Area Flash storage index. All used flash area configure is under here. * |----------------------------| Storage Size * | Environment variables area | ENV area size @see ENV_AREA_SIZE - * | 1.system section | ENV_SYSTEM_SIZE - * | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE * |----------------------------| * | Saved log area | Log area size @see LOG_AREA_SIZE * |----------------------------| @@ -69,42 +67,19 @@ * |----------------------------| * * @note all area sizes must be aligned with EF_ERASE_MIN_SIZE - * @note EasyFlash will use ram to buffer the ENV. At some point flash's EF_ERASE_MIN_SIZE may become so big, - * and you want to keep ENV size smaller. To do it you must define ENV_USER_SETTING_SIZE for ENV. - * @note ENV area size has some limitations in different modes. - * 1.Normal mode: no limitations - * 2.Wear leveling mode: system section will used a flash section and the data section will use at least 2 flash sections - * 3.Power fail safeguard mode: ENV area will has a backup. It is twice as normal mode. - * 4.Wear leveling and power fail safeguard mode: The required capacity will be 2 times the total capacity in wear leveling mode. - * For example: - * The EF_ERASE_MIN_SIZE is 128K and the ENV_USER_SETTING_SIZE: 2K. The ENV_AREA_SIZE in different mode you can define - * 1.Normal mode: 1*EF_ERASE_MIN_SIZE - * 2.Wear leveling mode: 3*EF_ERASE_MIN_SIZE (It has 2 data section to store ENV. So ENV can erase at least 200,000 times) - * 3.Power fail safeguard mode: 2*EF_ERASE_MIN_SIZE - * 4.Wear leveling and power fail safeguard mode: 6*EF_ERASE_MIN_SIZE - * @note the log area size must be more than twice of EF_ERASE_MIN_SIZE + * + * The EasyFlash add the NG (Next Generation) mode start from V4.0. All old mode before V4.0, called LEGACY mode. + * + * - NG (Next Generation) mode is default mode from V4.0. It's easy to settings, only defined the ENV_AREA_SIZE. + * - The LEGACY mode has been DEPRECATED. It is NOT RECOMMENDED to continue using. + * Beacuse it will use ram to buffer the ENV and spend more flash erase times. + * If you want use it please using the V3.X version. */ + /* backup area start address */ -#define EF_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */ -/* the user setting size of ENV, must be word alignment */ -#define ENV_USER_SETTING_SIZE (2 * 1024) -#ifndef EF_ENV_USING_PFS_MODE - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in normal mode. */ - #define ENV_AREA_SIZE (1 * EF_ERASE_MIN_SIZE) /* 2K */ - #else - /* ENV area total bytes size in wear leveling mode. */ - #define ENV_AREA_SIZE (3 * EF_ERASE_MIN_SIZE) /* 6K */ - #endif -#else - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in power fail safeguard mode. */ - #define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 4K */ - #else - /* ENV area total bytes size in wear leveling and power fail safeguard mode. */ - #define ENV_AREA_SIZE (6 * EF_ERASE_MIN_SIZE) /* 12K */ - #endif -#endif +#define EF_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */ +/* ENV area size. It's at least one empty sector for GC. So it's definination must more then or equal 2 flash sector size. */ +#define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 8K */ /* saved log area size */ /* #define LOG_AREA_SIZE (10 * EF_ERASE_MIN_SIZE)*/ /* 20K */ diff --git a/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/inc/ef_cfg.h b/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/inc/ef_cfg.h index c14938e..b70e64e 100644 --- a/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/inc/ef_cfg.h +++ b/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/inc/ef_cfg.h @@ -1,7 +1,7 @@ /* * This file is part of the EasyFlash Library. * - * Copyright (c) 2015, Armink, + * Copyright (c) 2015-2019, Armink, * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,16 +26,11 @@ * Created on: 2015-07-14 */ - #ifndef EF_CFG_H_ #define EF_CFG_H_ -/* using ENV function */ +/* using ENV function, default is NG (Next Generation) mode start from V4.0 */ #define EF_USING_ENV -/* using wear leveling mode for ENV */ -/* #define EF_ENV_USING_WL_MODE */ -/* using power fail safeguard mode for ENV */ -/* #define EF_ENV_USING_PFS_MODE */ /* using IAP function */ #define EF_USING_IAP @@ -46,13 +41,15 @@ /* the minimum size of flash erasure */ #define EF_ERASE_MIN_SIZE 4096 -/** +/* the flash write granularity, unit: bit + * only support 1(nor flash)/ 8(stm32f4)/ 32(stm32f1)/ 64(stm32l4) */ +#define EF_WRITE_GRAN 1 + +/* * * This all Backup Area Flash storage index. All used flash area configure is under here. * |----------------------------| Storage Size * | Environment variables area | ENV area size @see ENV_AREA_SIZE - * | 1.system section | ENV_SYSTEM_SIZE - * | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE * |----------------------------| * | Saved log area | Log area size @see LOG_AREA_SIZE * |----------------------------| @@ -60,42 +57,19 @@ * |----------------------------| * * @note all area sizes must be aligned with EF_ERASE_MIN_SIZE - * @note EasyFlash will use ram to buffer the ENV. At some point flash's EF_ERASE_MIN_SIZE may become so big, - * and you want to keep ENV size smaller. To do it you must define ENV_USER_SETTING_SIZE for ENV. - * @note ENV area size has some limitations in different modes. - * 1.Normal mode: no limitations - * 2.Wear leveling mode: system section will used a flash section and the data section will use at least 2 flash sections - * 3.Power fail safeguard mode: ENV area will has a backup. It is twice as normal mode. - * 4.Wear leveling and power fail safeguard mode: The required capacity will be 2 times the total capacity in wear leveling mode. - * For example: - * The EF_ERASE_MIN_SIZE is 128K and the ENV_USER_SETTING_SIZE: 2K. The ENV_AREA_SIZE in different mode you can define - * 1.Normal mode: 1*EF_ERASE_MIN_SIZE - * 2.Wear leveling mode: 3*EF_ERASE_MIN_SIZE (It has 2 data section to store ENV. So ENV can erase at least 200,000 times) - * 3.Power fail safeguard mode: 2*EF_ERASE_MIN_SIZE - * 4.Wear leveling and power fail safeguard mode: 6*EF_ERASE_MIN_SIZE - * @note the log area size must be more than twice of EF_ERASE_MIN_SIZE + * + * The EasyFlash add the NG (Next Generation) mode start from V4.0. All old mode before V4.0, called LEGACY mode. + * + * - NG (Next Generation) mode is default mode from V4.0. It's easy to settings, only defined the ENV_AREA_SIZE. + * - The LEGACY mode has been DEPRECATED. It is NOT RECOMMENDED to continue using. + * Beacuse it will use ram to buffer the ENV and spend more flash erase times. + * If you want use it please using the V3.X version. */ + /* backup area start address */ #define EF_START_ADDR (0) /* from the SPI Flash position: 0KB*/ -/* the user setting size of ENV, must be word alignment */ -#define ENV_USER_SETTING_SIZE (2 * 1024) -#ifndef EF_ENV_USING_PFS_MODE - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in normal mode. */ - #define ENV_AREA_SIZE (1 * EF_ERASE_MIN_SIZE) /* 4K */ - #else - /* ENV area total bytes size in wear leveling mode. */ - #define ENV_AREA_SIZE (3 * EF_ERASE_MIN_SIZE) /* 12K */ - #endif -#else - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in power fail safeguard mode. */ - #define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 8K */ - #else - /* ENV area total bytes size in wear leveling and power fail safeguard mode. */ - #define ENV_AREA_SIZE (6 * EF_ERASE_MIN_SIZE) /* 24K */ - #endif -#endif +/* ENV area size. It's at least one empty sector for GC. So it's definination must more then or equal 2 flash sector size. */ +#define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 8K */ /* saved log area size */ /* #define LOG_AREA_SIZE (10 * EF_ERASE_MIN_SIZE)*/ /* 40K */ diff --git a/demo/env/stm32f10x/rtt/components/easyflash/inc/ef_cfg.h b/demo/env/stm32f10x/rtt/components/easyflash/inc/ef_cfg.h index 75fa43b..9963873 100644 --- a/demo/env/stm32f10x/rtt/components/easyflash/inc/ef_cfg.h +++ b/demo/env/stm32f10x/rtt/components/easyflash/inc/ef_cfg.h @@ -1,7 +1,7 @@ /* * This file is part of the EasyFlash Library. * - * Copyright (c) 2015, Armink, + * Copyright (c) 2015-2019, Armink, * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -32,12 +32,8 @@ #include -/* using ENV function */ +/* using ENV function, default is NG (Next Generation) mode start from V4.0 */ #define EF_USING_ENV -/* using wear leveling mode for ENV */ -/* #define EF_ENV_USING_WL_MODE */ -/* using power fail safeguard mode for ENV */ -/* #define EF_ENV_USING_PFS_MODE */ /* using IAP function */ #define EF_USING_IAP @@ -55,13 +51,15 @@ /* the minimum size of flash erasure */ #define EF_ERASE_MIN_SIZE PAGE_SIZE /* it is one page for STM3210x */ -/** +/* the flash write granularity, unit: bit + * only support 1(nor flash)/ 8(stm32f4)/ 32(stm32f1)/ 64(stm32l4) */ +#define EF_WRITE_GRAN 32 + +/* * * This all Backup Area Flash storage index. All used flash area configure is under here. * |----------------------------| Storage Size * | Environment variables area | ENV area size @see ENV_AREA_SIZE - * | 1.system section | ENV_SYSTEM_SIZE - * | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE * |----------------------------| * | Saved log area | Log area size @see LOG_AREA_SIZE * |----------------------------| @@ -69,42 +67,19 @@ * |----------------------------| * * @note all area sizes must be aligned with EF_ERASE_MIN_SIZE - * @note EasyFlash will use ram to buffer the ENV. At some point flash's EF_ERASE_MIN_SIZE may become so big, - * and you want to keep ENV size smaller. To do it you must define ENV_USER_SETTING_SIZE for ENV. - * @note ENV area size has some limitations in different modes. - * 1.Normal mode: no limitations - * 2.Wear leveling mode: system section will used a flash section and the data section will use at least 2 flash sections - * 3.Power fail safeguard mode: ENV area will has a backup. It is twice as normal mode. - * 4.Wear leveling and power fail safeguard mode: The required capacity will be 2 times the total capacity in wear leveling mode. - * For example: - * The EF_ERASE_MIN_SIZE is 128K and the ENV_USER_SETTING_SIZE: 2K. The ENV_AREA_SIZE in different mode you can define - * 1.Normal mode: 1*EF_ERASE_MIN_SIZE - * 2.Wear leveling mode: 3*EF_ERASE_MIN_SIZE (It has 2 data section to store ENV. So ENV can erase at least 200,000 times) - * 3.Power fail safeguard mode: 2*EF_ERASE_MIN_SIZE - * 4.Wear leveling and power fail safeguard mode: 6*EF_ERASE_MIN_SIZE - * @note the log area size must be more than twice of EF_ERASE_MIN_SIZE + * + * The EasyFlash add the NG (Next Generation) mode start from V4.0. All old mode before V4.0, called LEGACY mode. + * + * - NG (Next Generation) mode is default mode from V4.0. It's easy to settings, only defined the ENV_AREA_SIZE. + * - The LEGACY mode has been DEPRECATED. It is NOT RECOMMENDED to continue using. + * Beacuse it will use ram to buffer the ENV and spend more flash erase times. + * If you want use it please using the V3.X version. */ + /* backup area start address */ #define EF_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */ -/* the user setting size of ENV, must be word alignment */ -#define ENV_USER_SETTING_SIZE (2 * 1024) -#ifndef EF_ENV_USING_PFS_MODE - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in normal mode. */ - #define ENV_AREA_SIZE (1 * EF_ERASE_MIN_SIZE) /* 2K */ - #else - /* ENV area total bytes size in wear leveling mode. */ - #define ENV_AREA_SIZE (3 * EF_ERASE_MIN_SIZE) /* 6K */ - #endif -#else - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in power fail safeguard mode. */ - #define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 4K */ - #else - /* ENV area total bytes size in wear leveling and power fail safeguard mode. */ - #define ENV_AREA_SIZE (6 * EF_ERASE_MIN_SIZE) /* 12K */ - #endif -#endif +/* ENV area size. It's at least one empty sector for GC. So it's definination must more then or equal 2 flash sector size. */ +#define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 4K */ /* saved log area size */ /* #define LOG_AREA_SIZE (10 * EF_ERASE_MIN_SIZE)*/ /* 20K */ diff --git a/demo/env/stm32f4xx/components/easyflash/inc/ef_cfg.h b/demo/env/stm32f4xx/components/easyflash/inc/ef_cfg.h index 3626129..d86d01c 100644 --- a/demo/env/stm32f4xx/components/easyflash/inc/ef_cfg.h +++ b/demo/env/stm32f4xx/components/easyflash/inc/ef_cfg.h @@ -1,7 +1,7 @@ /* * This file is part of the EasyFlash Library. * - * Copyright (c) 2015, Armink, + * Copyright (c) 2015-2019, Armink, * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -32,12 +32,8 @@ #include -/* using ENV function */ +/* using ENV function, default is NG (Next Generation) mode start from V4.0 */ #define EF_USING_ENV -/* using wear leveling mode for ENV */ -/* #define EF_ENV_USING_WL_MODE */ -/* using power fail safeguard mode for ENV */ -/* #define EF_ENV_USING_PFS_MODE */ /* using IAP function */ #define EF_USING_IAP @@ -48,13 +44,15 @@ /* the minimum size of flash erasure */ #define EF_ERASE_MIN_SIZE (128 * 1024) /* it is 128K for compatibility */ -/** +/* the flash write granularity, unit: bit + * only support 1(nor flash)/ 8(stm32f4)/ 32(stm32f1)/ 64(stm32l4) */ +#define EF_WRITE_GRAN 8 + +/* * * This all Backup Area Flash storage index. All used flash area configure is under here. * |----------------------------| Storage Size * | Environment variables area | ENV area size @see ENV_AREA_SIZE - * | 1.system section | ENV_SYSTEM_SIZE - * | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE * |----------------------------| * | Saved log area | Log area size @see LOG_AREA_SIZE * |----------------------------| @@ -62,42 +60,19 @@ * |----------------------------| * * @note all area sizes must be aligned with EF_ERASE_MIN_SIZE - * @note EasyFlash will use ram to buffer the ENV. At some point flash's EF_ERASE_MIN_SIZE may become so big, - * and you want to keep ENV size smaller. To do it you must define ENV_USER_SETTING_SIZE for ENV. - * @note ENV area size has some limitations in different modes. - * 1.Normal mode: no limitations - * 2.Wear leveling mode: system section will used a flash section and the data section will use at least 2 flash sections - * 3.Power fail safeguard mode: ENV area will has a backup. It is twice as normal mode. - * 4.Wear leveling and power fail safeguard mode: The required capacity will be 2 times the total capacity in wear leveling mode. - * For example: - * The EF_ERASE_MIN_SIZE is 128K and the ENV_USER_SETTING_SIZE: 2K. The ENV_AREA_SIZE in different mode you can define - * 1.Normal mode: 1*EF_ERASE_MIN_SIZE - * 2.Wear leveling mode: 3*EF_ERASE_MIN_SIZE (It has 2 data section to store ENV. So ENV can erase at least 200,000 times) - * 3.Power fail safeguard mode: 2*EF_ERASE_MIN_SIZE - * 4.Wear leveling and power fail safeguard mode: 6*EF_ERASE_MIN_SIZE - * @note the log area size must be more than twice of EF_ERASE_MIN_SIZE + * + * The EasyFlash add the NG (Next Generation) mode start from V4.0. All old mode before V4.0, called LEGACY mode. + * + * - NG (Next Generation) mode is default mode from V4.0. It's easy to settings, only defined the ENV_AREA_SIZE. + * - The LEGACY mode has been DEPRECATED. It is NOT RECOMMENDED to continue using. + * Beacuse it will use ram to buffer the ENV and spend more flash erase times. + * If you want use it please using the V3.X version. */ + /* backup area start address */ #define EF_START_ADDR (FLASH_BASE + 128 * 1024) /* on the chip position: 128KB */ -/* the user setting size of ENV, must be word alignment */ -#define ENV_USER_SETTING_SIZE (2 * 1024) -#ifndef EF_ENV_USING_PFS_MODE - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in normal mode. */ - #define ENV_AREA_SIZE (1 * EF_ERASE_MIN_SIZE) /* 128K */ - #else - /* ENV area total bytes size in wear leveling mode. */ - #define ENV_AREA_SIZE (3 * EF_ERASE_MIN_SIZE) /* 384K */ - #endif -#else - #ifndef EF_ENV_USING_WL_MODE - /* ENV area total bytes size in power fail safeguard mode. */ - #define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 256K */ - #else - /* ENV area total bytes size in wear leveling and power fail safeguard mode. */ - #define ENV_AREA_SIZE (6 * EF_ERASE_MIN_SIZE) /* 768K */ - #endif -#endif +/* ENV area size. It's at least one empty sector for GC. So it's definination must more then or equal 2 flash sector size. */ +#define ENV_AREA_SIZE (2 * EF_ERASE_MIN_SIZE) /* 256K */ /* saved log area size */ /* #define LOG_AREA_SIZE (2 * EF_ERASE_MIN_SIZE)*/ /* 256K */ diff --git a/easyflash/inc/ef_cfg.h b/easyflash/inc/ef_cfg.h index b327ec4..c28e0e2 100644 --- a/easyflash/inc/ef_cfg.h +++ b/easyflash/inc/ef_cfg.h @@ -1,7 +1,7 @@ /* * This file is part of the EasyFlash Library. * - * Copyright (c) 2015, Armink, + * Copyright (c) 2015-2019, Armink, * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,16 +26,11 @@ * Created on: 2015-07-14 */ - #ifndef EF_CFG_H_ #define EF_CFG_H_ -/* using ENV function */ +/* using ENV function, default is NG (Next Generation) mode start from V4.0 */ #define EF_USING_ENV -/* using wear leveling mode for ENV */ -/* #define EF_ENV_USING_WL_MODE */ -/* using power fail safeguard mode for ENV */ -/* #define EF_ENV_USING_PFS_MODE */ #ifdef EF_USING_ENV /* Auto update ENV to latest default when current ENV version number is changed. */ @@ -53,16 +48,18 @@ /* using save log function */ /* #define EF_USING_LOG */ -/* the minimum size of flash erasure */ +/* The minimum size of flash erasure. May be a flash sector size. */ #define EF_ERASE_MIN_SIZE /* @note you must define it for a value */ -/** +/* the flash write granularity, unit: bit + * only support 1(nor flash)/ 8(stm32f4)/ 32(stm32f1)/ 64(stm32l4) */ +#define EF_WRITE_GRAN /* @note you must define it for a value */ + +/* * * This all Backup Area Flash storage index. All used flash area configure is under here. * |----------------------------| Storage Size * | Environment variables area | ENV area size @see ENV_AREA_SIZE - * | 1.system section | ENV_SYSTEM_SIZE - * | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE * |----------------------------| * | Saved log area | Log area size @see LOG_AREA_SIZE * |----------------------------| @@ -70,27 +67,21 @@ * |----------------------------| * * @note all area sizes must be aligned with EF_ERASE_MIN_SIZE - * @note EasyFlash will use ram to buffer the ENV. At some point flash's EF_ERASE_MIN_SIZE may become so big, - * and you want to keep ENV size smaller. To do it you must define ENV_USER_SETTING_SIZE for ENV. - * @note ENV area size has some limitations in different modes. - * 1.Normal mode: no limitations - * 2.Wear leveling mode: system section will used a flash section and the data section will use at least 2 flash sections - * 3.Power fail safeguard mode: ENV area will has a backup. It is twice as normal mode. - * 4.Wear leveling and power fail safeguard mode: The required capacity will be 2 times the total capacity in wear leveling mode. - * For example: - * The EF_ERASE_MIN_SIZE is 128K and the ENV_USER_SETTING_SIZE: 2K. The ENV_AREA_SIZE in different mode you can define - * 1.Normal mode: 1*EF_ERASE_MIN_SIZE - * 2.Wear leveling mode: 3*EF_ERASE_MIN_SIZE (It has 2 data section to store ENV. So ENV can erase at least 200,000 times) - * 3.Power fail safeguard mode: 2*EF_ERASE_MIN_SIZE - * 4.Wear leveling and power fail safeguard mode: 6*EF_ERASE_MIN_SIZE - * @note the log area size must be more than twice of EF_ERASE_MIN_SIZE + * + * The EasyFlash add the NG (Next Generation) mode start from V4.0. All old mode before V4.0, called LEGACY mode. + * + * - NG (Next Generation) mode is default mode from V4.0. It's easy to settings, only defined the ENV_AREA_SIZE. + * - The LEGACY mode has been DEPRECATED. It is NOT RECOMMENDED to continue using. + * Beacuse it will use ram to buffer the ENV and spend more flash erase times. + * If you want use it please using the V3.X version. */ + /* backup area start address */ #define EF_START_ADDR /* @note you must define it for a value */ -/* the user setting size of ENV, must be word alignment */ -#define ENV_USER_SETTING_SIZE /* @note you must define it for a value if you used ENV */ -/* ENV area total bytes size in normal mode. */ + +/* ENV area size. It's at least one empty sector for GC. So it's definination must more then or equal 2 flash sector size. */ #define ENV_AREA_SIZE /* @note you must define it for a value if you used ENV */ + /* saved log area size */ #define LOG_AREA_SIZE /* @note you must define it for a value if you used log */