diff --git a/demo/env/stm32f4xx/EWARM/EasyFlash.ewt b/demo/env/stm32f4xx/EWARM/EasyFlash.ewt new file mode 100644 index 0000000..43d2384 --- /dev/null +++ b/demo/env/stm32f4xx/EWARM/EasyFlash.ewt @@ -0,0 +1,1484 @@ + + + + 2 + + STM32F405RG + + ARM + + 1 + + C-STAT + 259 + + 259 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.3.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + app + + $PROJ_DIR$\..\app\src\app.c + + + $PROJ_DIR$\..\app\src\app_task.c + + + $PROJ_DIR$\..\app\inc\rtconfig.h + + + $PROJ_DIR$\..\app\src\stm32f4xx_it.c + + + $PROJ_DIR$\..\app\src\user_finsh_cmd.c + + + + components + + easyflash + + port + + $PROJ_DIR$\..\components\easyflash\port\ef_port.c + + + + src + + $PROJ_DIR$\..\..\..\..\easyflash\src\easyflash.c + + + $PROJ_DIR$\..\..\..\..\easyflash\src\ef_env.c + + + $PROJ_DIR$\..\..\..\..\easyflash\src\ef_env_wl.c + + + $PROJ_DIR$\..\..\..\..\easyflash\src\ef_iap.c + + + $PROJ_DIR$\..\..\..\..\easyflash\src\ef_utils.c + + + + + others + + $PROJ_DIR$\..\components\others\bsp.c + + + $PROJ_DIR$\..\components\others\utils.c + + + + rtt_uart + + $PROJ_DIR$\..\components\rtt_uart\usart.c + + + + + libs + + cmsis + + $PROJ_DIR$\..\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\iar\startup_stm32f40_41xxx.s + + + $PROJ_DIR$\..\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c + + + + std_periph_driver + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\misc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_adc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_can.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_crc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_aes.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_tdes.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dac.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dbgmcu.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dcmi.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma2d.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_exti.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_flash.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_flash_ramfunc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_fsmc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_gpio.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_md5.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_sha1.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_iwdg.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_ltdc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_pwr.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rcc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rng.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rtc.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_sai.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_sdio.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_spi.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_syscfg.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_tim.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_usart.c + + + $PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_wwdg.c + + + + + rt_thread_1.2.2 + + drivers + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\completion.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\dataqueue.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\pipe.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\portal.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\ringbuffer.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\serial\serial.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\wrokqueue.c + + + + finsh + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\cmd.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_compiler.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_error.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_heap.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_init.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_node.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_ops.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_parser.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_token.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_var.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_vm.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\msh.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\msh_cmd.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\shell.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\symbol.c + + + + kernel + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\clock.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\cpuusage.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\device.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\idle.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\ipc.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\irq.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\kservice.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\mem.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\memheap.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\mempool.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\module.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\module.h + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\object.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\scheduler.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\slab.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\thread.c + + + $PROJ_DIR$\..\RT-Thread-1.2.2\src\timer.c + + + + libcpu + + $PROJ_DIR$\..\RT-Thread-1.2.2\libcpu\arm\cortex-m4\context_iar.S + + + $PROJ_DIR$\..\RT-Thread-1.2.2\libcpu\arm\cortex-m4\cpuport.c + + + + + + diff --git a/docs/zh/design.md b/docs/zh/design.md index b8a6137..8e565e6 100644 --- a/docs/zh/design.md +++ b/docs/zh/design.md @@ -84,7 +84,11 @@ NG 版本差不多在 2017 年底就已经设计完毕,但一直没时间去 ### 3.2 数据结构 -结合上面的算法不难发现,其实所有的操作都围绕着 **扇区状态** 及 **ENV状态** ,这些状态将被存放在扇区及 ENV 头部,并且保证在不擦除扇区数据的前提下进行单向修改,在程序代码实现上称这些状态及其他一些数据信息为 **元数据**。出于后期扩展性的考虑这里也预留了一些保留属性,还有一些提前规划好的状态及属性后面将用过多扇区存储、加密、压缩功能的实现。 +结合上面的算法不难发现,其实所有的操作都围绕着 **扇区状态** 及 **ENV状态** ,这些状态将被存放在扇区及 ENV 头部,并且保证在不擦除扇区数据的前提下进行单向修改,在程序代码实现上称这些状态及其他一些数据信息为 **元数据**。 + +除了常规功能外,还有一项重要指标是 EasyFlash 非常看重的,那就是掉电保护能力,相当于在任何操作出现掉电异常,整个 EasyFlash 的容错能力是否过硬,是否可以进行掉电恢复。像 准备写入、准备删除这些中间状态就是为了掉电保护功能而设计。 + +出于后期扩展性的考虑这里也预留了一些保留属性,还有一些提前规划好的状态及属性后面将用过多扇区存储、加密、压缩功能的实现。 设计完成后,整个 ENV 的数据结构如下图,该图最终也可转换为对应的结构体。 diff --git a/docs/zh/images/env_op1_step1.png b/docs/zh/images/env_op1_step1.png index c8b477a..2b85ce8 100644 Binary files a/docs/zh/images/env_op1_step1.png and b/docs/zh/images/env_op1_step1.png differ diff --git a/docs/zh/images/env_op1_step2.png b/docs/zh/images/env_op1_step2.png index a40e57e..cc9e9fb 100644 Binary files a/docs/zh/images/env_op1_step2.png and b/docs/zh/images/env_op1_step2.png differ diff --git a/docs/zh/images/env_op1_step3.png b/docs/zh/images/env_op1_step3.png index f44d79e..b40799c 100644 Binary files a/docs/zh/images/env_op1_step3.png and b/docs/zh/images/env_op1_step3.png differ diff --git a/docs/zh/images/env_op1_step4.png b/docs/zh/images/env_op1_step4.png index 1e12bb5..f5722da 100644 Binary files a/docs/zh/images/env_op1_step4.png and b/docs/zh/images/env_op1_step4.png differ