1、【更新】Env的Demo,以适配新添加的掉电保护功能。

Signed-off-by: armink <armink.ztl@gmail.com>
pull/7/head
armink 11 years ago
parent a8cb06b35d
commit 73725d0807

@ -43,12 +43,22 @@
#define ENV_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */
/* the minimum size of flash erasure */
#define ERASE_MIN_SIZE PAGE_SIZE /* it is one page for STM32 */
#ifdef EF_ENV_USING_WL_MODE
#ifndef EF_ENV_USING_PFS_MODE
#ifndef EF_ENV_USING_WL_MODE
/* ENV section total bytes size in normal mode. */
#define ENV_SECTION_SIZE (ERASE_MIN_SIZE)
#else
/* ENV section total bytes size in wear leveling mode. */
#define ENV_SECTION_SIZE (4 * ERASE_MIN_SIZE) /* 8K */
#define ENV_SECTION_SIZE (4 * ERASE_MIN_SIZE)
#endif
#else
/* ENV section total bytes size in normal mode. It's equal with FLASH_USER_SETTING_ENV_SIZE */
#define ENV_SECTION_SIZE (EF_USER_SETTING_ENV_SIZE)
#ifndef EF_ENV_USING_WL_MODE
/* ENV section total bytes size in normal and power fail safeguard mode. */
#define ENV_SECTION_SIZE (2 * ERASE_MIN_SIZE)
#else
/* ENV section total bytes size in wear leveling and power fail safeguard mode. */
#define ENV_SECTION_SIZE (5 * ERASE_MIN_SIZE)
#endif
#endif
/* print debug information of flash */
#define PRINT_DEBUG

@ -42,12 +42,22 @@
#define ENV_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */
/* the minimum size of flash erasure */
#define ERASE_MIN_SIZE PAGE_SIZE /* it is one page for STM32 */
#ifdef EF_ENV_USING_WL_MODE
#ifndef EF_ENV_USING_PFS_MODE
#ifndef EF_ENV_USING_WL_MODE
/* ENV section total bytes size in normal mode. */
#define ENV_SECTION_SIZE (ERASE_MIN_SIZE)
#else
/* ENV section total bytes size in wear leveling mode. */
#define ENV_SECTION_SIZE (4 * ERASE_MIN_SIZE) /* 8K */
#define ENV_SECTION_SIZE (4 * ERASE_MIN_SIZE)
#endif
#else
/* ENV section total bytes size in normal mode. It's equal with FLASH_USER_SETTING_ENV_SIZE */
#define ENV_SECTION_SIZE (EF_USER_SETTING_ENV_SIZE)
#ifndef EF_ENV_USING_WL_MODE
/* ENV section total bytes size in normal and power fail safeguard mode. */
#define ENV_SECTION_SIZE (2 * ERASE_MIN_SIZE)
#else
/* ENV section total bytes size in wear leveling and power fail safeguard mode. */
#define ENV_SECTION_SIZE (5 * ERASE_MIN_SIZE)
#endif
#endif
/* print debug information of flash */
#define PRINT_DEBUG

@ -32,15 +32,25 @@
#include <stm32f4xx_conf.h>
/* ENV start address */
#define ENV_START_ADDR (FLASH_BASE + 256 * 1024) /* on the chip position: 256KB */
#define ENV_START_ADDR (FLASH_BASE + 128 * 1024) /* on the chip position: 128KB */
/* the minimum size of flash erasure */
#define ERASE_MIN_SIZE (128 * 1024) /* it is 128K for compatibility */
#ifdef EF_ENV_USING_WL_MODE
#ifndef EF_ENV_USING_PFS_MODE
#ifndef EF_ENV_USING_WL_MODE
/* ENV section total bytes size in normal mode. */
#define ENV_SECTION_SIZE (ERASE_MIN_SIZE) /* 128K */
#else
/* ENV section total bytes size in wear leveling mode. */
#define ENV_SECTION_SIZE (4 * ERASE_MIN_SIZE) /* 512K */
#endif
#else
/* ENV section total bytes size in normal mode. It's equal with EF_USER_SETTING_ENV_SIZE */
#define ENV_SECTION_SIZE (EF_USER_SETTING_ENV_SIZE)
#ifndef EF_ENV_USING_WL_MODE
/* ENV section total bytes size in normal and power fail safeguard mode. */
#define ENV_SECTION_SIZE (2 * ERASE_MIN_SIZE) /* 256K */
#else
/* ENV section total bytes size in wear leveling and power fail safeguard mode. */
#define ENV_SECTION_SIZE (5 * ERASE_MIN_SIZE) /* 640K */
#endif
#endif
/* print debug information of flash */
#define PRINT_DEBUG

Loading…
Cancel
Save