1、【优化】Flash的初始化方式,提升移植时参数配置的灵活性;

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2015-04-17 16:34:36 +08:00
parent 141e048926
commit 946ffe21d9
19 changed files with 3756 additions and 659 deletions

View File

@ -2,7 +2,7 @@
<project> <project>
<fileVersion>2</fileVersion> <fileVersion>2</fileVersion>
<fileChecksum>3477300256</fileChecksum> <fileChecksum>4204672539</fileChecksum>
<configuration> <configuration>
<name>stm32f103xE</name> <name>stm32f103xE</name>
<outputs/> <outputs/>

View File

@ -951,7 +951,7 @@
<group> <group>
<name>components</name> <name>components</name>
<group> <group>
<name>flash</name> <name>easyflash</name>
<group> <group>
<name>port</name> <name>port</name>
<file> <file>
@ -966,6 +966,9 @@
<file> <file>
<name>$PROJ_DIR$\..\..\..\flash\src\flash_env.c</name> <name>$PROJ_DIR$\..\..\..\flash\src\flash_env.c</name>
</file> </file>
<file>
<name>$PROJ_DIR$\..\..\..\flash\src\flash_env_wl.c</name>
</file>
<file> <file>
<name>$PROJ_DIR$\..\..\..\flash\src\flash_iap.c</name> <name>$PROJ_DIR$\..\..\..\flash\src\flash_iap.c</name>
</file> </file>

View File

@ -19,7 +19,7 @@
<Column0>43</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths> <Column0>167</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace> </Workspace>
<Disassembly> <Disassembly>
<col-names> <col-names>
@ -73,14 +73,14 @@
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\src\app_task.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>42</SelStart2><SelEnd2>42</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\src\app.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>25</SelStart2><SelEnd2>25</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\RT-Thread-1.2.2\include\rtservice.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>69</YPos2><SelStart2>2536</SelStart2><SelEnd2>2536</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\inc\rtconfig.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>48</YPos2><SelStart2>1369</SelStart2><SelEnd2>1369</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\components\rtt_uart\usart.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>12</YPos2><SelStart2>783</SelStart2><SelEnd2>802</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\components\others\bsp.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>3</YPos2><SelStart2>908</SelStart2><SelEnd2>908</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\components\others\bsp.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>20</YPos2><SelStart2>1907</SelStart2><SelEnd2>1907</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\RT-Thread-1.2.2\libcpu\arm\cortex-m3\cpuport.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>321</YPos2><SelStart2>9301</SelStart2><SelEnd2>9301</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor> <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\src\app_task.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>54</YPos2><SelStart2>2192</SelStart2><SelEnd2>2192</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\src\app.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>25</SelStart2><SelEnd2>25</SelEnd2></Tab><ActiveTab>1</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions> <Positions>
<Top><Row0><Sizes><Toolbar-026b4f20><key>iaridepm.enu1</key></Toolbar-026b4f20><Toolbar-02dd6460><key>armjlink.enu1</key></Toolbar-02dd6460></Sizes></Row0><Row1><Sizes><Toolbar-02dd6e88><key>debuggergui.enu1</key></Toolbar-02dd6e88></Sizes></Row1></Top><Left><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>690</Bottom><Right>117</Right><x>-2</x><y>-2</y><xscreen>49</xscreen><yscreen>194</yscreen><sizeHorzCX>59466</sizeHorzCX><sizeHorzCY>203996</sizeHorzCY><sizeVertCX>144417</sizeVertCX><sizeVertCY>727655</sizeVertCY></Rect></Wnd4></Sizes></Row0></Left><Right><Row0><Sizes><Wnd5><Rect><Top>-2</Top><Left>-2</Left><Bottom>690</Bottom><Right>233</Right><x>-2</x><y>-2</y><xscreen>98</xscreen><yscreen>197</yscreen><sizeHorzCX>118932</sizeHorzCX><sizeHorzCY>207150</sizeHorzCY><sizeVertCX>285194</sizeVertCX><sizeVertCY>727655</sizeVertCY></Rect></Wnd5></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>192</Bottom><Right>826</Right><x>-2</x><y>-2</y><xscreen>828</xscreen><yscreen>194</yscreen><sizeHorzCX>1004854</sizeHorzCX><sizeHorzCY>203996</sizeHorzCY><sizeVertCX>59466</sizeVertCX><sizeVertCY>203996</sizeVertCY></Rect></Wnd2></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions> <Top><Row0><Sizes><Toolbar-03fa8f08><key>iaridepm.enu1</key></Toolbar-03fa8f08><Toolbar-07112c68><key>armjlink.enu1</key></Toolbar-07112c68><Toolbar-07112d30><key>debuggergui.enu1</key></Toolbar-07112d30></Sizes></Row0></Top><Left><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>727</Bottom><Right>241</Right><x>-2</x><y>-2</y><xscreen>100</xscreen><yscreen>197</yscreen><sizeHorzCX>59524</sizeHorzCX><sizeHorzCY>203723</sizeHorzCY><sizeVertCX>144643</sizeVertCX><sizeVertCY>753878</sizeVertCY></Rect></Wnd4></Sizes></Row0></Left><Right><Row0><Sizes><Wnd5><Rect><Top>-2</Top><Left>-2</Left><Bottom>727</Bottom><Right>477</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>206825</sizeHorzCY><sizeVertCX>285119</sizeVertCX><sizeVertCY>753878</sizeVertCY></Rect></Wnd5></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>195</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>197</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203723</sizeHorzCY><sizeVertCX>59524</sizeVertCX><sizeVertCY>203723</sizeVertCY></Rect></Wnd2></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop> </Desktop>
</Project> </Project>

View File

@ -9,7 +9,7 @@ TriggerName=main
LimitSize=0 LimitSize=0
ByteLimit=50 ByteLimit=50
[DebugChecksum] [DebugChecksum]
Checksum=-436402782 Checksum=-700699776
[Exceptions] [Exceptions]
StopOnUncaught=_ 0 StopOnUncaught=_ 0
StopOnThrow=_ 0 StopOnThrow=_ 0
@ -28,8 +28,8 @@ OverrideDefaultClocks=0
CpuClock=72000000 CpuClock=72000000
ClockAutoDetect=0 ClockAutoDetect=0
ClockWanted=2000000 ClockWanted=2000000
JtagSpeed=2000000 JtagSpeed=2250000
Prescaler=36 Prescaler=32
TimeStampPrescIndex=0 TimeStampPrescIndex=0
TimeStampPrescData=0 TimeStampPrescData=0
PcSampCYCTAP=1 PcSampCYCTAP=1

View File

@ -35,14 +35,14 @@
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\src\app_task.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>1049</SelStart2><SelEnd2>1049</SelEnd2></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor> <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\app\src\app_task.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>48</YPos2><SelStart2>1906</SelStart2><SelEnd2>1906</SelEnd2></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions> <Positions>
<Top><Row0><Sizes><Toolbar-03228f08><key>iaridepm.enu1</key></Toolbar-03228f08></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>764</Bottom><Right>314</Right><x>-2</x><y>-2</y><xscreen>510</xscreen><yscreen>51</yscreen><sizeHorzCX>303571</sizeHorzCX><sizeHorzCY>52740</sizeHorzCY><sizeVertCX>188095</sizeVertCX><sizeVertCY>792141</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>158</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>160</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>165460</sizeHorzCY><sizeVertCX>303571</sizeVertCX><sizeVertCY>52740</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions> <Top><Row0><Sizes><Toolbar-00c88f08><key>iaridepm.enu1</key></Toolbar-00c88f08></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>744</Bottom><Right>314</Right><x>-2</x><y>-2</y><xscreen>510</xscreen><yscreen>51</yscreen><sizeHorzCX>303571</sizeHorzCX><sizeHorzCY>52740</sizeHorzCY><sizeVertCX>188095</sizeVertCX><sizeVertCY>771458</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>178</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>180</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>186143</sizeHorzCY><sizeVertCX>303571</sizeVertCX><sizeVertCY>52740</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop> </Desktop>
</Workspace> </Workspace>

File diff suppressed because one or more lines are too long

View File

@ -475,6 +475,11 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\flash\src\flash_env.c</FilePath> <FilePath>..\..\..\flash\src\flash_env.c</FilePath>
</File> </File>
<File>
<FileName>flash_env_wl.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\flash\src\flash_env_wl.c</FilePath>
</File>
<File> <File>
<FileName>flash_iap.c</FileName> <FileName>flash_iap.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>

View File

@ -1,82 +0,0 @@
Dependencies for Project 'EasyFlash', Target 'stm32f103xE': (DO NOT MODIFY !)
F (..\APP\src\app.c)(0x54BE0FA9)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\app.o" --omf_browse ".\Output\app.crf" --depend ".\Output\app.d")
F (..\APP\src\app_task.c)(0x54C2E4A6)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\app_task.o" --omf_browse ".\Output\app_task.crf" --depend ".\Output\app_task.d")
F (..\app\src\user_finsh_cmd.c)(0x54C0D9F6)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\user_finsh_cmd.o" --omf_browse ".\Output\user_finsh_cmd.crf" --depend ".\Output\user_finsh_cmd.d")
F (..\APP\src\stm32f10x_it.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_it.o" --omf_browse ".\Output\stm32f10x_it.crf" --depend ".\Output\stm32f10x_it.d")
F (..\APP\inc\delay_conf.h)(0x54C30EE8)()
F (..\APP\inc\stm32f10x_conf.h)(0x545CB528)()
F (..\APP\inc\rtconfig.h)(0x54C0D528)()
F (..\components\others\bsp.c)(0x54C30F71)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\bsp.o" --omf_browse ".\Output\bsp.crf" --depend ".\Output\bsp.d")
F (..\components\others\utils.c)(0x54C30EAD)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\utils.o" --omf_browse ".\Output\utils.crf" --depend ".\Output\utils.d")
F (..\components\rtt_uart\usart.c)(0x54C0D275)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\usart.o" --omf_browse ".\Output\usart.crf" --depend ".\Output\usart.d")
F (..\RT-Thread-1.2.2\libcpu\arm\cortex-m3\cpuport.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\cpuport.o" --omf_browse ".\Output\cpuport.crf" --depend ".\Output\cpuport.d")
F (..\RT-Thread-1.2.2\libcpu\arm\cortex-m3\context_rvds.S)(0x545CB528)(--cpu Cortex-M3 -g --apcs=interwork -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" --list ".\Output\list\context_rvds.lst" --xref -o ".\Output\context_rvds.o" --depend ".\Output\context_rvds.d")
F (..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd.s)(0x545CB527)(--cpu Cortex-M3 -g --apcs=interwork -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" --list ".\Output\list\startup_stm32f10x_hd.lst" --xref -o ".\Output\startup_stm32f10x_hd.o" --depend ".\Output\startup_stm32f10x_hd.d")
F (..\components\flash\port\flash_port.c)(0x54F7D57A)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\flash_port.o" --omf_browse ".\Output\flash_port.crf" --depend ".\Output\flash_port.d")
F (..\..\..\flash\src\flash.c)(0x54F7D49B)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\flash.o" --omf_browse ".\Output\flash.crf" --depend ".\Output\flash.d")
F (..\..\..\flash\src\flash_env.c)(0x55029D3A)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\flash_env.o" --omf_browse ".\Output\flash_env.crf" --depend ".\Output\flash_env.d")
F (..\..\..\flash\src\flash_iap.c)(0x5524EE4B)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\flash_iap.o" --omf_browse ".\Output\flash_iap.crf" --depend ".\Output\flash_iap.d")
F (..\..\..\flash\src\flash_utils.c)(0x54F7D4A7)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\flash_utils.o" --omf_browse ".\Output\flash_utils.crf" --depend ".\Output\flash_utils.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\misc.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\misc.o" --omf_browse ".\Output\misc.crf" --depend ".\Output\misc.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_adc.o" --omf_browse ".\Output\stm32f10x_adc.crf" --depend ".\Output\stm32f10x_adc.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_bkp.o" --omf_browse ".\Output\stm32f10x_bkp.crf" --depend ".\Output\stm32f10x_bkp.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_can.o" --omf_browse ".\Output\stm32f10x_can.crf" --depend ".\Output\stm32f10x_can.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_cec.o" --omf_browse ".\Output\stm32f10x_cec.crf" --depend ".\Output\stm32f10x_cec.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_crc.o" --omf_browse ".\Output\stm32f10x_crc.crf" --depend ".\Output\stm32f10x_crc.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_dac.o" --omf_browse ".\Output\stm32f10x_dac.crf" --depend ".\Output\stm32f10x_dac.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_dbgmcu.o" --omf_browse ".\Output\stm32f10x_dbgmcu.crf" --depend ".\Output\stm32f10x_dbgmcu.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_dma.o" --omf_browse ".\Output\stm32f10x_dma.crf" --depend ".\Output\stm32f10x_dma.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_exti.o" --omf_browse ".\Output\stm32f10x_exti.crf" --depend ".\Output\stm32f10x_exti.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_flash.o" --omf_browse ".\Output\stm32f10x_flash.crf" --depend ".\Output\stm32f10x_flash.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_fsmc.o" --omf_browse ".\Output\stm32f10x_fsmc.crf" --depend ".\Output\stm32f10x_fsmc.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_gpio.o" --omf_browse ".\Output\stm32f10x_gpio.crf" --depend ".\Output\stm32f10x_gpio.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_i2c.o" --omf_browse ".\Output\stm32f10x_i2c.crf" --depend ".\Output\stm32f10x_i2c.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_iwdg.o" --omf_browse ".\Output\stm32f10x_iwdg.crf" --depend ".\Output\stm32f10x_iwdg.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_pwr.o" --omf_browse ".\Output\stm32f10x_pwr.crf" --depend ".\Output\stm32f10x_pwr.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_rcc.o" --omf_browse ".\Output\stm32f10x_rcc.crf" --depend ".\Output\stm32f10x_rcc.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_rtc.o" --omf_browse ".\Output\stm32f10x_rtc.crf" --depend ".\Output\stm32f10x_rtc.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_sdio.o" --omf_browse ".\Output\stm32f10x_sdio.crf" --depend ".\Output\stm32f10x_sdio.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_spi.o" --omf_browse ".\Output\stm32f10x_spi.crf" --depend ".\Output\stm32f10x_spi.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_tim.o" --omf_browse ".\Output\stm32f10x_tim.crf" --depend ".\Output\stm32f10x_tim.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_usart.o" --omf_browse ".\Output\stm32f10x_usart.crf" --depend ".\Output\stm32f10x_usart.d")
F (..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\stm32f10x_wwdg.o" --omf_browse ".\Output\stm32f10x_wwdg.crf" --depend ".\Output\stm32f10x_wwdg.d")
F (..\Libraries\CMSIS_RVMDK\CM3\CoreSupport\core_cm3.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\core_cm3.o" --omf_browse ".\Output\core_cm3.crf" --depend ".\Output\core_cm3.d")
F (..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\system_stm32f10x.o" --omf_browse ".\Output\system_stm32f10x.crf" --depend ".\Output\system_stm32f10x.d")
F (..\RT-Thread-1.2.2\src\clock.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\clock.o" --omf_browse ".\Output\clock.crf" --depend ".\Output\clock.d")
F (..\RT-Thread-1.2.2\src\cpuusage.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\cpuusage.o" --omf_browse ".\Output\cpuusage.crf" --depend ".\Output\cpuusage.d")
F (..\RT-Thread-1.2.2\src\device.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\device.o" --omf_browse ".\Output\device.crf" --depend ".\Output\device.d")
F (..\RT-Thread-1.2.2\src\idle.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\idle.o" --omf_browse ".\Output\idle.crf" --depend ".\Output\idle.d")
F (..\RT-Thread-1.2.2\src\ipc.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\ipc.o" --omf_browse ".\Output\ipc.crf" --depend ".\Output\ipc.d")
F (..\RT-Thread-1.2.2\src\irq.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\irq.o" --omf_browse ".\Output\irq.crf" --depend ".\Output\irq.d")
F (..\RT-Thread-1.2.2\src\kservice.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\kservice.o" --omf_browse ".\Output\kservice.crf" --depend ".\Output\kservice.d")
F (..\RT-Thread-1.2.2\src\mem.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\mem.o" --omf_browse ".\Output\mem.crf" --depend ".\Output\mem.d")
F (..\RT-Thread-1.2.2\src\memheap.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\memheap.o" --omf_browse ".\Output\memheap.crf" --depend ".\Output\memheap.d")
F (..\RT-Thread-1.2.2\src\mempool.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\mempool.o" --omf_browse ".\Output\mempool.crf" --depend ".\Output\mempool.d")
F (..\RT-Thread-1.2.2\src\module.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\module.o" --omf_browse ".\Output\module.crf" --depend ".\Output\module.d")
F (..\RT-Thread-1.2.2\src\object.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\object.o" --omf_browse ".\Output\object.crf" --depend ".\Output\object.d")
F (..\RT-Thread-1.2.2\src\scheduler.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\scheduler.o" --omf_browse ".\Output\scheduler.crf" --depend ".\Output\scheduler.d")
F (..\RT-Thread-1.2.2\src\slab.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\slab.o" --omf_browse ".\Output\slab.crf" --depend ".\Output\slab.d")
F (..\RT-Thread-1.2.2\src\thread.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\thread.o" --omf_browse ".\Output\thread.crf" --depend ".\Output\thread.d")
F (..\RT-Thread-1.2.2\src\timer.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\timer.o" --omf_browse ".\Output\timer.crf" --depend ".\Output\timer.d")
F (..\RT-Thread-1.2.2\components\drivers\src\completion.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\completion.o" --omf_browse ".\Output\completion.crf" --depend ".\Output\completion.d")
F (..\RT-Thread-1.2.2\components\drivers\src\dataqueue.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\dataqueue.o" --omf_browse ".\Output\dataqueue.crf" --depend ".\Output\dataqueue.d")
F (..\RT-Thread-1.2.2\components\drivers\src\pipe.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\pipe.o" --omf_browse ".\Output\pipe.crf" --depend ".\Output\pipe.d")
F (..\RT-Thread-1.2.2\components\drivers\src\portal.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\portal.o" --omf_browse ".\Output\portal.crf" --depend ".\Output\portal.d")
F (..\RT-Thread-1.2.2\components\drivers\src\ringbuffer.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\ringbuffer.o" --omf_browse ".\Output\ringbuffer.crf" --depend ".\Output\ringbuffer.d")
F (..\RT-Thread-1.2.2\components\drivers\src\wrokqueue.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\wrokqueue.o" --omf_browse ".\Output\wrokqueue.crf" --depend ".\Output\wrokqueue.d")
F (..\RT-Thread-1.2.2\components\drivers\serial\serial.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\serial.o" --omf_browse ".\Output\serial.crf" --depend ".\Output\serial.d")
F (..\RT-Thread-1.2.2\components\finsh\cmd.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\cmd.o" --omf_browse ".\Output\cmd.crf" --depend ".\Output\cmd.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_compiler.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_compiler.o" --omf_browse ".\Output\finsh_compiler.crf" --depend ".\Output\finsh_compiler.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_error.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_error.o" --omf_browse ".\Output\finsh_error.crf" --depend ".\Output\finsh_error.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_heap.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_heap.o" --omf_browse ".\Output\finsh_heap.crf" --depend ".\Output\finsh_heap.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_init.c)(0x545CB529)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_init.o" --omf_browse ".\Output\finsh_init.crf" --depend ".\Output\finsh_init.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_node.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_node.o" --omf_browse ".\Output\finsh_node.crf" --depend ".\Output\finsh_node.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_ops.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_ops.o" --omf_browse ".\Output\finsh_ops.crf" --depend ".\Output\finsh_ops.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_parser.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_parser.o" --omf_browse ".\Output\finsh_parser.crf" --depend ".\Output\finsh_parser.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_token.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_token.o" --omf_browse ".\Output\finsh_token.crf" --depend ".\Output\finsh_token.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_var.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_var.o" --omf_browse ".\Output\finsh_var.crf" --depend ".\Output\finsh_var.d")
F (..\RT-Thread-1.2.2\components\finsh\finsh_vm.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\finsh_vm.o" --omf_browse ".\Output\finsh_vm.crf" --depend ".\Output\finsh_vm.d")
F (..\RT-Thread-1.2.2\components\finsh\msh.c)(0x545CB527)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\msh.o" --omf_browse ".\Output\msh.crf" --depend ".\Output\msh.d")
F (..\RT-Thread-1.2.2\components\finsh\msh_cmd.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\msh_cmd.o" --omf_browse ".\Output\msh_cmd.crf" --depend ".\Output\msh_cmd.d")
F (..\RT-Thread-1.2.2\components\finsh\shell.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\shell.o" --omf_browse ".\Output\shell.crf" --depend ".\Output\shell.d")
F (..\RT-Thread-1.2.2\components\finsh\symbol.c)(0x545CB528)(-c --cpu Cortex-M3 -g -O0 -Otime --apcs=interwork --split_sections -I..\app\inc -I..\components\rtt_uart -I..\components\others -I..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x -I..\RT-Thread-1.2.2\include -I..\RT-Thread-1.2.2\components\drivers\include -I..\RT-Thread-1.2.2\components\drivers\include\drivers -I..\RT-Thread-1.2.2\components\finsh -I..\..\..\flash\inc -I "C:\Program Files\Keil\ARM\INC" -I "C:\Program Files\Keil\ARM\INC\ST\STM32F10x" -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_FULL_ASSERT -o ".\Output\symbol.o" --omf_browse ".\Output\symbol.crf" --depend ".\Output\symbol.d")

File diff suppressed because one or more lines are too long

View File

@ -345,7 +345,7 @@
<MiscControls></MiscControls> <MiscControls></MiscControls>
<Define>USE_STDPERIPH_DRIVER,STM32F10X_HD,USE_FULL_ASSERT</Define> <Define>USE_STDPERIPH_DRIVER,STM32F10X_HD,USE_FULL_ASSERT</Define>
<Undefine></Undefine> <Undefine></Undefine>
<IncludePath>..\app\inc;..\components\rtt_uart;..\components\others;..\Libaries\STM32F10x_StdPeriph_Driver\inc;..\Libaries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x;..\RT-Thread-1.2.2\include;..\RT-Thread-1.2.2\components\drivers\include;..\RT-Thread-1.2.2\components\drivers\include\drivers;..\RT-Thread-1.2.2\components\finsh;..\..\..\flash\inc</IncludePath> <IncludePath>..\app\inc;..\components\rtt_uart;..\components\others;..\Libraries\STM32F10x_StdPeriph_Driver\inc;..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x;..\RT-Thread-1.2.2\include;..\RT-Thread-1.2.2\components\drivers\include;..\RT-Thread-1.2.2\components\drivers\include\drivers;..\RT-Thread-1.2.2\components\finsh;..\..\..\flash\inc</IncludePath>
</VariousControls> </VariousControls>
</Cads> </Cads>
<Aads> <Aads>
@ -453,7 +453,7 @@
<File> <File>
<FileName>startup_stm32f10x_hd.s</FileName> <FileName>startup_stm32f10x_hd.s</FileName>
<FileType>2</FileType> <FileType>2</FileType>
<FilePath>..\Libaries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd.s</FilePath> <FilePath>..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd.s</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>
@ -493,112 +493,117 @@
<File> <File>
<FileName>misc.c</FileName> <FileName>misc.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\misc.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\misc.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_adc.c</FileName> <FileName>stm32f10x_adc.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_bkp.c</FileName> <FileName>stm32f10x_bkp.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_can.c</FileName> <FileName>stm32f10x_can.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c</FilePath>
</File>
<File>
<FileName>stm32f10x_cec.c</FileName>
<FileType>1</FileType>
<FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_crc.c</FileName> <FileName>stm32f10x_crc.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_dac.c</FileName> <FileName>stm32f10x_dac.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_dbgmcu.c</FileName> <FileName>stm32f10x_dbgmcu.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_dma.c</FileName> <FileName>stm32f10x_dma.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_exti.c</FileName> <FileName>stm32f10x_exti.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_flash.c</FileName> <FileName>stm32f10x_flash.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_fsmc.c</FileName> <FileName>stm32f10x_fsmc.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_gpio.c</FileName> <FileName>stm32f10x_gpio.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_i2c.c</FileName> <FileName>stm32f10x_i2c.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_iwdg.c</FileName> <FileName>stm32f10x_iwdg.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_pwr.c</FileName> <FileName>stm32f10x_pwr.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_rcc.c</FileName> <FileName>stm32f10x_rcc.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_rtc.c</FileName> <FileName>stm32f10x_rtc.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_sdio.c</FileName> <FileName>stm32f10x_sdio.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_spi.c</FileName> <FileName>stm32f10x_spi.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_tim.c</FileName> <FileName>stm32f10x_tim.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_usart.c</FileName> <FileName>stm32f10x_usart.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c</FilePath>
</File> </File>
<File> <File>
<FileName>stm32f10x_wwdg.c</FileName> <FileName>stm32f10x_wwdg.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c</FilePath> <FilePath>..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>
@ -608,12 +613,12 @@
<File> <File>
<FileName>core_cm3.c</FileName> <FileName>core_cm3.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\CMSIS_RVMDK\CM3\CoreSupport\core_cm3.c</FilePath> <FilePath>..\Libraries\CMSIS_RVMDK\CM3\CoreSupport\core_cm3.c</FilePath>
</File> </File>
<File> <File>
<FileName>system_stm32f10x.c</FileName> <FileName>system_stm32f10x.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\Libaries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c</FilePath> <FilePath>..\Libraries\CMSIS_RVMDK\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>

File diff suppressed because it is too large Load Diff

View File

@ -23,10 +23,8 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h" #include "stm32f10x_it.h"
#include <rtthread.h> #include <rtthread.h>
#include "delay_conf.h"
#include "bsp.h" #include "bsp.h"
uint32_t ulUsart2RxNum = 0;
/** @addtogroup Template_Project /** @addtogroup Template_Project
* @{ * @{
@ -133,13 +131,6 @@ void WWDG_IRQHandler(void)
/* enter interrupt */ /* enter interrupt */
rt_interrupt_enter(); rt_interrupt_enter();
/* Clear EWI flag */
WWDG_ClearFlag();
/**
*
*/
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
} }
@ -155,12 +146,6 @@ void TIM4_IRQHandler(void)
{ {
rt_interrupt_enter(); rt_interrupt_enter();
if (TIM_GetITStatus(TIM4, TIM_IT_Update) == SET) {
TIM_ClearFlag(TIM4, TIM_FLAG_Update); //清中断标记
TIM_ClearITPendingBit(TIM4, TIM_IT_Update); //清除 TIM2 的中断待处理位
}
rt_interrupt_leave(); rt_interrupt_leave();
} }
/******************************************************************************/ /******************************************************************************/

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* Function: Portable interface for each platform. * Function: Portable interface for stm32f10x platform.
* Created on: 2015-01-16 * Created on: 2015-01-16
*/ */
@ -36,8 +36,15 @@
#define FLASH_ENV_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */ #define FLASH_ENV_START_ADDR (FLASH_BASE + 100 * 1024) /* from the chip position: 100KB */
/* the minimum size of flash erasure */ /* the minimum size of flash erasure */
#define FLASH_ERASE_MIN_SIZE PAGE_SIZE /* it is one page for STM32 */ #define FLASH_ERASE_MIN_SIZE PAGE_SIZE /* it is one page for STM32 */
/* Environment variables bytes size */ /* the user setting size of ENV */
#define FLASH_ENV_SECTION_SIZE (4*PAGE_SIZE) /* 4 pages */ #define FLASH_USER_SETTING_ENV_SIZE PAGE_SIZE /* a page size */
#ifdef FLASH_ENV_USING_WEAR_LEVELING_MODE
/* ENV section total bytes size in wear leveling mode. */
#define FLASH_ENV_SECTION_SIZE (4 * FLASH_ERASE_MIN_SIZE)/* 8K */
#else
/* ENV section total bytes size in normal mode. It's equal with FLASH_USER_SETTING_ENV_SIZE */
#define FLASH_ENV_SECTION_SIZE (FLASH_USER_SETTING_ENV_SIZE)
#endif
/* print debug information of flash */ /* print debug information of flash */
#define FLASH_PRINT_DEBUG #define FLASH_PRINT_DEBUG
@ -55,22 +62,25 @@ static char log_buf[RT_CONSOLEBUF_SIZE];
/** /**
* Flash port for hardware initialize. * Flash port for hardware initialize.
* *
* @param env_addr environment variables start address * @param env_addr ENV start address
* @param env_size environment variables bytes size (@note must be word alignment) * @param env_user_size user setting ENV bytes size (@note must be word alignment)
* @param env_total_size ENV sector total bytes size (@note must be word alignment)
* @param erase_min_size the minimum size of Flash erasure * @param erase_min_size the minimum size of Flash erasure
* @param default_env default environment variables set for user * @param default_env default ENV set for user
* @param default_env_size default environment variables size * @param default_env_size default ENV size
* *
* @return result * @return result
*/ */
FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_size, size_t *erase_min_size, FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_user_size, size_t *env_total_size,
flash_env const **default_env, size_t *default_env_size) { size_t *erase_min_size, flash_env const **default_env, size_t *default_env_size) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
FLASH_ASSERT(FLASH_USER_SETTING_ENV_SIZE % 4 == 0);
FLASH_ASSERT(FLASH_ENV_SECTION_SIZE % 4 == 0); FLASH_ASSERT(FLASH_ENV_SECTION_SIZE % 4 == 0);
*env_addr = FLASH_ENV_START_ADDR; *env_addr = FLASH_ENV_START_ADDR;
*env_size = FLASH_ENV_SECTION_SIZE; *env_user_size = FLASH_USER_SETTING_ENV_SIZE;
*env_total_size = FLASH_ENV_SECTION_SIZE;
*erase_min_size = FLASH_ERASE_MIN_SIZE; *erase_min_size = FLASH_ERASE_MIN_SIZE;
*default_env = default_env_set; *default_env = default_env_set;
*default_env_size = sizeof(default_env_set)/sizeof(default_env_set[0]); *default_env_size = sizeof(default_env_set)/sizeof(default_env_set[0]);
@ -117,6 +127,9 @@ FlashErrCode flash_erase(uint32_t addr, size_t size) {
FLASH_Status flash_status; FLASH_Status flash_status;
size_t erase_pages, i; size_t erase_pages, i;
/* make sure the start address is a multiple of FLASH_ERASE_MIN_SIZE */
FLASH_ASSERT(addr % FLASH_ERASE_MIN_SIZE == 0);
/* calculate pages */ /* calculate pages */
erase_pages = size / PAGE_SIZE; erase_pages = size / PAGE_SIZE;
if (size % PAGE_SIZE != 0) { if (size % PAGE_SIZE != 0) {

View File

@ -39,51 +39,6 @@ void rt_hw_board_init()
*/ */
static void RCC_Configuration(void) static void RCC_Configuration(void)
{ {
ErrorStatus HSEStartUpStatus;
//使能外部晶振
RCC_HSEConfig(RCC_HSE_ON);
//等待外部晶振稳定
HSEStartUpStatus = RCC_WaitForHSEStartUp();
//如果外部晶振启动成功,则进行下一步操作
if(HSEStartUpStatus==SUCCESS)
{
//设置HCLKAHB时钟=SYSCLK = 72MHz
RCC_HCLKConfig(RCC_SYSCLK_Div1);
//PCLK1(APB1) = HCLK/2,RCC_HCLK_Div2——>PCLK1=36MHz,最大36MHz
RCC_PCLK1Config(RCC_HCLK_Div2);
//PCLK2(APB2) = HCLK = 72MHz
RCC_PCLK2Config(RCC_HCLK_Div1);
//FLASH时序控制
//推荐值SYSCLK = 0~24MHz Latency=0
// SYSCLK = 24~48MHz Latency=1
// SYSCLK = 48~72MHz Latency=2
FLASH_SetLatency(FLASH_Latency_2);
//开启FLASH预取指功能
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
//PLL设置 SYSCLK/1 * 9 = 8*1*9 = 72MHz
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
//启动PLL
RCC_PLLCmd(ENABLE);
//等待PLL稳定
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
//系统时钟SYSCLK来自PLL输出
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
//切换时钟后等待系统时钟稳定
while(RCC_GetSYSCLKSource()!=0x08);
/*
//设置系统SYSCLK时钟为HSE输入
RCC_SYSCLKConfig(RCC_SYSCLKSource_HSE);
//等待时钟切换成功
while(RCC_GetSYSCLKSource() != 0x04);
*/
}
//下面是给各模块开启时钟 //下面是给各模块开启时钟
//启动GPIO //启动GPIO
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | \ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | \
@ -110,8 +65,6 @@ static void RCC_Configuration(void)
*/ */
static void NVIC_Configuration(void) static void NVIC_Configuration(void)
{ {
NVIC_InitTypeDef NVIC_InitStructure;
#if defined(VECT_TAB_RAM) #if defined(VECT_TAB_RAM)
// Set the Vector Table base location at 0x20000000 // Set the Vector Table base location at 0x20000000
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x00); NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x00);
@ -125,13 +78,6 @@ static void NVIC_Configuration(void)
//设置NVIC优先级分组为Group20-3抢占式优先级0-3的响应式优先级 //设置NVIC优先级分组为Group20-3抢占式优先级0-3的响应式优先级
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
//窗口看门狗中断配置
NVIC_InitStructure.NVIC_IRQChannel = WWDG_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
} }
/** /**
@ -154,43 +100,21 @@ static void GPIO_Configuration(void)
/******************系统运行LED指示灯配置*******************/ /******************system run led*******************/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_Init(GPIOA, &GPIO_InitStructure);
} }
/**
* WWDG Configuration
*/
static void WWDG_Configuration(void)
{
//在PCLK1驱动看门狗计时之前,首先要经过既定的4096分频(详情查看STM32技术参考手册),再经过Prescaler = 8分频
/* WWDG clock counter = (PCLK1/4096)/8 = 1098.6 Hz (~0.910 ms) */
WWDG_SetPrescaler(WWDG_Prescaler_8);
/* Set Window value to 127 */
//范围1ms-58ms
WWDG_SetWindowValue(0x7F);
/* Enable WWDG and set counter value to 127, WWDG timeout = ~4 ms * (0x7F - 0x3F) = 58.24 ms */
WWDG_Enable(127);
/* Clear EWI flag */
WWDG_ClearFlag();
/* Enable EW interrupt */
WWDG_EnableIT();
}
/** /**
* IWDG_Configuration * IWDG_Configuration
*/ */
static void IWDG_Configuration(void) static void IWDG_Configuration(void)
{ {
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);//使能对IWDG->PR和IWDG->RLR的写 IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);
IWDG_SetPrescaler(IWDG_Prescaler_64);//64分频 IWDG_SetPrescaler(IWDG_Prescaler_64);
IWDG_SetReload(1875); IWDG_SetReload(1875);
IWDG_ReloadCounter(); IWDG_ReloadCounter();
IWDG_Enable(); IWDG_Enable();

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* Function: Is is an head file in this library. You can see all be called functions. * Function: Is is an head file for this library. You can see all be called functions.
* Created on: 2014-09-10 * Created on: 2014-09-10
*/ */
@ -29,8 +29,8 @@
/* using CRC32 check when load environment variable from Flash */ /* using CRC32 check when load environment variable from Flash */
#define FLASH_ENV_USING_CRC_CHECK #define FLASH_ENV_USING_CRC_CHECK
/* using wear leveling mode or normal mode */ /* using wear leveling mode or normal mode */
/* #define FLASH_ENV_USING_WEAR_LEVELING_MODE */ #define FLASH_ENV_USING_WEAR_LEVELING_MODE
#define FLASH_ENV_USING_NORMAL_MODE /* #define FLASH_ENV_USING_NORMAL_MODE */
/* Flash debug print function. Must be implement by user. */ /* Flash debug print function. Must be implement by user. */
#define FLASH_DEBUG(...) flash_log_debug(__FILE__, __LINE__, __VA_ARGS__) #define FLASH_DEBUG(...) flash_log_debug(__FILE__, __LINE__, __VA_ARGS__)
@ -44,7 +44,7 @@ if (!(EXPR)) \
while (1); \ while (1); \
} }
/* EasyFlash software version number */ /* EasyFlash software version number */
#define FLASH_SW_VERSION "1.04.08" #define FLASH_SW_VERSION "1.04.17"
typedef struct _flash_env{ typedef struct _flash_env{
char *key; char *key;
@ -64,15 +64,15 @@ typedef enum {
/* flash.c */ /* flash.c */
FlashErrCode flash_init(void); FlashErrCode flash_init(void);
/* flash_env.c */ /* flash_env.c flash_env_wl.c */
void flash_load_env(void); void flash_load_env(void);
void flash_print_env(void); void flash_print_env(void);
char *flash_get_env(const char *key); char *flash_get_env(const char *key);
FlashErrCode flash_set_env(const char *key, const char *value); FlashErrCode flash_set_env(const char *key, const char *value);
FlashErrCode flash_save_env(void); FlashErrCode flash_save_env(void);
FlashErrCode flash_env_set_default(void); FlashErrCode flash_env_set_default(void);
uint32_t flash_get_env_total_size(void); size_t flash_get_env_total_size(void);
uint32_t flash_get_env_used_size(void); size_t flash_get_env_write_bytes(void);
/* flash_iap.c */ /* flash_iap.c */
FlashErrCode flash_erase_bak_app(size_t app_size); FlashErrCode flash_erase_bak_app(size_t app_size);

View File

@ -25,9 +25,16 @@
/* environment variables start address */ /* environment variables start address */
#define FLASH_ENV_START_ADDR /* @note you must define it for a value */ #define FLASH_ENV_START_ADDR /* @note you must define it for a value */
/* the minimum size of flash erasure */ /* the minimum size of flash erasure */
#define #define FLASH_ERASE_MIN_SIZE /* @note you must define it for a value */ #define FLASH_ERASE_MIN_SIZE /* @note you must define it for a value */
/* environment variables bytes size */ /* the user setting size of ENV */
#define FLASH_USER_SETTING_ENV_SIZE /* @note you must define it for a value */
#ifdef FLASH_ENV_USING_WEAR_LEVELING_MODE
/* ENV section total bytes size in wear leveling mode. */
#define FLASH_ENV_SECTION_SIZE /* @note you must define it for a value */ #define FLASH_ENV_SECTION_SIZE /* @note you must define it for a value */
#else
/* ENV section total bytes size in normal mode. It's equal with FLASH_USER_SETTING_ENV_SIZE */
#define FLASH_ENV_SECTION_SIZE (FLASH_USER_SETTING_ENV_SIZE)
#endif
/* print debug information of flash */ /* print debug information of flash */
#define FLASH_PRINT_DEBUG #define FLASH_PRINT_DEBUG
@ -39,22 +46,25 @@ static const flash_env default_env_set[] = {
/** /**
* Flash port for hardware initialize. * Flash port for hardware initialize.
* *
* @param env_addr environment variables start address * @param env_addr ENV start address
* @param env_size environment variables bytes size (@note must be word alignment) * @param env_user_size user setting ENV bytes size (@note must be word alignment)
* @param env_total_size ENV sector total bytes size (@note must be word alignment)
* @param erase_min_size the minimum size of Flash erasure * @param erase_min_size the minimum size of Flash erasure
* @param default_env default environment variables set for user * @param default_env default ENV set for user
* @param default_env_size default environment variables size * @param default_env_size default ENV size
* *
* @return result * @return result
*/ */
FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_size, size_t *erase_min_size, FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_user_size, size_t *env_total_size,
flash_env const **default_env, size_t *default_env_size) { size_t *erase_min_size, flash_env const **default_env, size_t *default_env_size) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
FLASH_ASSERT(FLASH_USER_SETTING_ENV_SIZE % 4 == 0);
FLASH_ASSERT(FLASH_ENV_SECTION_SIZE % 4 == 0); FLASH_ASSERT(FLASH_ENV_SECTION_SIZE % 4 == 0);
*env_addr = FLASH_ENV_START_ADDR; *env_addr = FLASH_ENV_START_ADDR;
*env_size = FLASH_ENV_SECTION_SIZE; *env_user_size = FLASH_USER_SETTING_ENV_SIZE;
*env_total_size = FLASH_ENV_SECTION_SIZE;
*erase_min_size = FLASH_ERASE_MIN_SIZE; *erase_min_size = FLASH_ERASE_MIN_SIZE;
*default_env = default_env_set; *default_env = default_env_set;
*default_env_size = sizeof(default_env_set)/sizeof(default_env_set[0]); *default_env_size = sizeof(default_env_set)/sizeof(default_env_set[0]);
@ -75,6 +85,9 @@ FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_size, size_t *erase
FlashErrCode flash_read(uint32_t addr, uint32_t *buf, size_t size) { FlashErrCode flash_read(uint32_t addr, uint32_t *buf, size_t size) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
FLASH_ASSERT(size >= 4);
FLASH_ASSERT(size % 4 == 0);
/* You can add your code under here. */ /* You can add your code under here. */
return result; return result;
@ -93,6 +106,9 @@ FlashErrCode flash_read(uint32_t addr, uint32_t *buf, size_t size) {
FlashErrCode flash_erase(uint32_t addr, size_t size) { FlashErrCode flash_erase(uint32_t addr, size_t size) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
/* make sure the start address is a multiple of FLASH_ERASE_MIN_SIZE */
FLASH_ASSERT(addr % FLASH_ERASE_MIN_SIZE == 0);
/* You can add your code under here. */ /* You can add your code under here. */
return result; return result;
@ -124,7 +140,9 @@ FlashErrCode flash_write(uint32_t addr, const uint32_t *buf, size_t size) {
* @return pointer to allocated memory or NULL if no free memory was found. * @return pointer to allocated memory or NULL if no free memory was found.
*/ */
void *flash_malloc(size_t size) { void *flash_malloc(size_t size) {
return rt_malloc(size);
/* You can add your code under here. */
} }
/** /**

View File

@ -50,23 +50,24 @@
* @return result * @return result
*/ */
FlashErrCode flash_init(void) { FlashErrCode flash_init(void) {
extern FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_size, extern FlashErrCode flash_port_init(uint32_t *env_addr, size_t *env_user_size,
size_t *erase_min_size, flash_env const **default_env, size_t *default_env_size); size_t *env_total_size, size_t *erase_min_size, flash_env const **default_env,
extern FlashErrCode flash_env_init(uint32_t start_addr, size_t total_size, size_t *default_env_size);
extern FlashErrCode flash_env_init(uint32_t start_addr, size_t user_size, size_t total_size,
size_t erase_min_size, flash_env const *default_env, size_t default_env_size); size_t erase_min_size, flash_env const *default_env, size_t default_env_size);
extern FlashErrCode flash_iap_init(uint32_t start_addr); extern FlashErrCode flash_iap_init(uint32_t start_addr);
uint32_t env_start_addr; uint32_t env_start_addr;
size_t env_total_size, erase_min_size, default_env_set_size; size_t env_user_size, env_total_size, erase_min_size, default_env_set_size;
const flash_env *default_env_set; const flash_env *default_env_set;
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
result = flash_port_init(&env_start_addr, &env_total_size, &erase_min_size, &default_env_set, result = flash_port_init(&env_start_addr, &env_user_size, &env_total_size, &erase_min_size,
&default_env_set_size); &default_env_set, &default_env_set_size);
if (result == FLASH_NO_ERR) { if (result == FLASH_NO_ERR) {
result = flash_env_init(env_start_addr, env_total_size, erase_min_size, default_env_set, result = flash_env_init(env_start_addr, env_user_size, env_total_size, erase_min_size,
default_env_set_size); default_env_set, default_env_set_size);
} }
if (result == FLASH_NO_ERR) { if (result == FLASH_NO_ERR) {

View File

@ -29,17 +29,17 @@
/** /**
* Environment variables area has 2 sections * Environment variables area has 2 sections
* 1. System section * 1. System section
* It storage environment variables parameters. (Units: Word) * It storage ENV parameters. (Units: Word)
* 2. Data section * 2. Data section
* It storage all environment variables. Storage format is key=value\0. * It storage all ENV. Storage format is key=value\0.
* All environment variables must be 4 bytes alignment. The remaining part must fill '\0'. * All ENV must be 4 bytes alignment. The remaining part must fill '\0'.
* *
* @note Word = 4 Bytes in this file * @note Word = 4 Bytes in this file
*/ */
/* flash ENV system section index and size */ /* flash ENV system section index and size */
enum { enum {
/* data section environment variables end address index in system section */ /* data section ENV end address index in system section */
FLASH_ENV_SYSTEM_INDEX_END_ADDR = 0, FLASH_ENV_SYSTEM_INDEX_END_ADDR = 0,
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
@ -47,21 +47,21 @@ enum {
FLASH_ENV_SYSTEM_INDEX_DATA_CRC, FLASH_ENV_SYSTEM_INDEX_DATA_CRC,
#endif #endif
/* flash environment variables system section word size */ /* flash ENV system section word size */
FLASH_ENV_SYSTEM_WORD_SIZE, FLASH_ENV_SYSTEM_WORD_SIZE,
/* flash environment variables system section byte size */ /* flash ENV system section byte size */
FLASH_ENV_SYSTEM_BYTE_SIZE = FLASH_ENV_SYSTEM_WORD_SIZE * 4, FLASH_ENV_SYSTEM_BYTE_SIZE = FLASH_ENV_SYSTEM_WORD_SIZE * 4,
}; };
/* default environment variables set, must be initialized by user */ /* default ENV set, must be initialized by user */
static flash_env const *default_env_set = NULL; static flash_env const *default_env_set = NULL;
/* default environment variables set size, must be initialized by user */ /* default ENV set size, must be initialized by user */
static size_t default_env_set_size = NULL; static size_t default_env_set_size = NULL;
/* flash environment variables all section total size */ /* flash ENV all section total size */
static size_t env_total_size = NULL; static size_t env_total_size = NULL;
/* environment variables RAM cache */ /* ENV RAM cache */
static uint32_t *env_cache = NULL; static uint32_t *env_cache = NULL;
/* environment variables start address in flash */ /* ENV start address in flash */
static uint32_t env_start_addr = NULL; static uint32_t env_start_addr = NULL;
static uint32_t get_env_system_addr(void); static uint32_t get_env_system_addr(void);
@ -79,25 +79,31 @@ static bool_t env_crc_is_ok(void);
#endif #endif
/** /**
* Flash environment variables initialize. * Flash ENV initialize.
* *
* @param start_addr environment variables start address in flash * @param start_addr ENV start address in flash
* @param total_size environment variables section total size (@note must be word alignment) * @param user_size user setting ENV bytes size (@note must be word alignment)
* @param erase_min_size the minimum size of flash erasure * @param total_size ENV section total size (@note must be word alignment)
* @param default_env default environment variables set for user * @param erase_min_size the minimum size of flash erasure. it isn't be used in normal mode.
* @param default_env_size default environment variables set size * @param default_env default ENV set for user
* @param default_env_size default ENV set size
*
* @note user_size must equal with total_size in normal mode
* *
* @return result * @return result
*/ */
FlashErrCode flash_env_init(uint32_t start_addr, size_t total_size, size_t erase_min_size, FlashErrCode flash_env_init(uint32_t start_addr, size_t user_size, size_t total_size,
flash_env const *default_env, size_t default_env_size) { size_t erase_min_size, flash_env const *default_env, size_t default_env_size) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
FLASH_ASSERT(start_addr); FLASH_ASSERT(start_addr);
FLASH_ASSERT(user_size);
FLASH_ASSERT(total_size); FLASH_ASSERT(total_size);
/* user_size must equal with total_size in normal mode */
FLASH_ASSERT(user_size == total_size);
FLASH_ASSERT(default_env); FLASH_ASSERT(default_env);
FLASH_ASSERT(default_env_size < total_size); FLASH_ASSERT(default_env_size < total_size);
/* must be word alignment for environment variables */ /* must be word alignment for ENV */
FLASH_ASSERT(total_size % 4 == 0); FLASH_ASSERT(total_size % 4 == 0);
/* make true only be initialized once */ /* make true only be initialized once */
FLASH_ASSERT(!env_cache); FLASH_ASSERT(!env_cache);
@ -109,8 +115,8 @@ FlashErrCode flash_env_init(uint32_t start_addr, size_t total_size, size_t erase
FLASH_DEBUG("Env start address is 0x%08X, size is %d bytes.\n", start_addr, total_size); FLASH_DEBUG("Env start address is 0x%08X, size is %d bytes.\n", start_addr, total_size);
/* create environment variables ram cache */ /* create ENV ram cache */
env_cache = (uint32_t *) flash_malloc(sizeof(uint8_t) * total_size); env_cache = (uint32_t *) flash_malloc(sizeof(uint8_t) * user_size);
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
flash_load_env(); flash_load_env();
@ -134,7 +140,7 @@ FlashErrCode flash_env_set_default(void){
/* set environment end address is at data section start address */ /* set environment end address is at data section start address */
set_env_end_addr(get_env_data_addr()); set_env_end_addr(get_env_data_addr());
/* create default environment variables */ /* create default ENV */
for (i = 0; i < default_env_set_size; i++) { for (i = 0; i < default_env_set_size; i++) {
create_env(default_env_set[i].key, default_env_set[i].value); create_env(default_env_set[i].key, default_env_set[i].value);
} }
@ -145,7 +151,7 @@ FlashErrCode flash_env_set_default(void){
} }
/** /**
* Get environment variables system section start address. * Get ENV system section start address.
* *
* @return system section start address * @return system section start address
*/ */
@ -155,7 +161,7 @@ static uint32_t get_env_system_addr(void) {
} }
/** /**
* Get environment variables data section start address. * Get ENV data section start address.
* *
* @return data section start address * @return data section start address
*/ */
@ -165,10 +171,10 @@ static uint32_t get_env_data_addr(void) {
} }
/** /**
* Get environment variables end address. * Get ENV end address.
* It's the first word in environment variables. * It's the first word in ENV.
* *
* @return environment variables end address * @return ENV end address
*/ */
static uint32_t get_env_end_addr(void) { static uint32_t get_env_end_addr(void) {
/* it is the first word */ /* it is the first word */
@ -176,17 +182,17 @@ static uint32_t get_env_end_addr(void) {
} }
/** /**
* Set environment variables end address. * Set ENV end address.
* It's the first word in environment variables. * It's the first word in ENV.
* *
* @param end_addr environment variables end address * @param end_addr ENV end address
*/ */
static void set_env_end_addr(uint32_t end_addr) { static void set_env_end_addr(uint32_t end_addr) {
env_cache[FLASH_ENV_SYSTEM_INDEX_END_ADDR] = end_addr; env_cache[FLASH_ENV_SYSTEM_INDEX_END_ADDR] = end_addr;
} }
/** /**
* Get current environment variables data section size. * Get current ENV data section size.
* *
* @return size * @return size
*/ */
@ -195,7 +201,7 @@ static size_t get_env_data_size(void) {
} }
/** /**
* Get current environment variables section total size. * Get current ENV section total size.
* *
* @return size * @return size
*/ */
@ -207,12 +213,12 @@ size_t flash_get_env_total_size(void) {
} }
/** /**
* Get current environment variables used byte size. * Get current ENV already write bytes.
* *
* @return size * @return write bytes
*/ */
uint32_t flash_get_env_used_size(void) { uint32_t flash_get_env_write_bytes(void) {
return FLASH_ENV_SYSTEM_BYTE_SIZE + get_env_data_size(); return get_env_end_addr() - env_start_addr;
} }
/** /**
@ -228,12 +234,12 @@ static FlashErrCode write_env(const char *key, const char *value) {
uint16_t env_str_index = 0, env_str_length, i; uint16_t env_str_index = 0, env_str_length, i;
char *env_str; char *env_str;
/* calculate environment variables storage length, contain '=' and '\0'. */ /* calculate ENV storage length, contain '=' and '\0'. */
env_str_length = strlen(key) + strlen(value) + 2; env_str_length = strlen(key) + strlen(value) + 2;
if (env_str_length % 4 != 0) { if (env_str_length % 4 != 0) {
env_str_length = (env_str_length / 4 + 1) * 4; env_str_length = (env_str_length / 4 + 1) * 4;
} }
/* check capacity of environment variables */ /* check capacity of ENV */
if (env_str_length + get_env_data_size() >= flash_get_env_total_size()) { if (env_str_length + get_env_data_size() >= flash_get_env_total_size()) {
return FLASH_ENV_FULL; return FLASH_ENV_FULL;
} }
@ -254,7 +260,7 @@ static FlashErrCode write_env(const char *key, const char *value) {
} }
//TODO ¿¼ÂÇ¿É·ñÓÅ»¯ //TODO ¿¼ÂÇ¿É·ñÓÅ»¯
memcpy((char *) env_cache + flash_get_env_used_size(), (uint32_t *) env_str, memcpy((char *) env_cache + flash_get_env_write_bytes(), (uint32_t *) env_str,
env_str_length); env_str_length);
set_env_end_addr(get_env_end_addr() + env_str_length); set_env_end_addr(get_env_end_addr() + env_str_length);
@ -266,11 +272,11 @@ static FlashErrCode write_env(const char *key, const char *value) {
} }
/** /**
* Find environment variables. * Find ENV.
* *
* @param key environment variables name * @param key ENV name
* *
* @return index of environment variables in ram cache * @return index of ENV in ram cache
*/ */
static uint32_t *find_env(const char *key) { static uint32_t *find_env(const char *key) {
uint32_t *env_cache_addr = NULL; uint32_t *env_cache_addr = NULL;
@ -279,15 +285,15 @@ static uint32_t *find_env(const char *key) {
FLASH_ASSERT(env_start_addr); FLASH_ASSERT(env_start_addr);
if (*key == NULL) { if (*key == NULL) {
FLASH_INFO("Flash environment variables name must be not empty!\n"); FLASH_INFO("Flash ENV name must be not empty!\n");
return NULL; return NULL;
} }
/* from data section start to data section end */ /* from data section start to data section end */
env_start = (char *) ((char *) env_cache + FLASH_ENV_SYSTEM_BYTE_SIZE); env_start = (char *) ((char *) env_cache + FLASH_ENV_SYSTEM_BYTE_SIZE);
env_end = (char *) ((char *) env_cache + flash_get_env_used_size()); env_end = (char *) ((char *) env_cache + flash_get_env_write_bytes());
/* environment variables is null */ /* ENV is null */
if (env_start == env_end) { if (env_start == env_end) {
return NULL; return NULL;
} }
@ -301,7 +307,7 @@ static uint32_t *find_env(const char *key) {
env_cache_addr = (uint32_t *) env; env_cache_addr = (uint32_t *) env;
break; break;
} else { } else {
/* next environment variables */ /* next ENV */
env += strlen(env) + 1; env += strlen(env) + 1;
} }
} }
@ -324,21 +330,21 @@ static FlashErrCode create_env(const char *key, const char *value) {
FLASH_ASSERT(value); FLASH_ASSERT(value);
if (*key == NULL) { if (*key == NULL) {
FLASH_INFO("Flash environment variables name must be not empty!\n"); FLASH_INFO("Flash ENV name must be not empty!\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
if (strstr(key, "=")) { if (strstr(key, "=")) {
FLASH_INFO("Flash environment variables name can't contain '='.\n"); FLASH_INFO("Flash ENV name can't contain '='.\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
/* find environment variables */ /* find ENV */
if (find_env(key)) { if (find_env(key)) {
FLASH_INFO("The name of \"%s\" is already exist.\n", key); FLASH_INFO("The name of \"%s\" is already exist.\n", key);
return FLASH_ENV_NAME_EXIST; return FLASH_ENV_NAME_EXIST;
} }
/* write environment variables to flash */ /* write ENV at the end of cache */
result = write_env(key, value); result = write_env(key, value);
return result; return result;
@ -360,19 +366,19 @@ FlashErrCode flash_del_env(const char *key){
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
if (*key == NULL) { if (*key == NULL) {
FLASH_INFO("Flash environment variables name must be not NULL!\n"); FLASH_INFO("Flash ENV name must be not NULL!\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
if (strstr(key, "=")) { if (strstr(key, "=")) {
FLASH_INFO("Flash environment variables name or value can't contain '='.\n"); FLASH_INFO("Flash ENV name or value can't contain '='.\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
/* find environment variables */ /* find ENV */
del_env_str = (char *) find_env(key); del_env_str = (char *) find_env(key);
if (!del_env_str) { if (!del_env_str) {
FLASH_INFO("Not find \"%s\" in environment variables.\n", key); FLASH_INFO("Not find \"%s\" in ENV.\n", key);
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
del_env_length = strlen(del_env_str); del_env_length = strlen(del_env_str);
@ -382,12 +388,12 @@ FlashErrCode flash_del_env(const char *key){
if (del_env_length % 4 != 0) { if (del_env_length % 4 != 0) {
del_env_length = (del_env_length / 4 + 1) * 4; del_env_length = (del_env_length / 4 + 1) * 4;
} }
/* calculate remain environment variables length */ /* calculate remain ENV length */
remain_env_length = remain_env_length =
get_env_data_size() - ((uint32_t) del_env_str - (uint32_t) env_cache); get_env_data_size() - ((uint32_t) del_env_str - (uint32_t) env_cache);
/* remain environment variables move forward */ /* remain ENV move forward */
memcpy(del_env_str, del_env_str + del_env_length, remain_env_length); memcpy(del_env_str, del_env_str + del_env_length, remain_env_length);
/* reset environment variables end address */ /* reset ENV end address */
set_env_end_addr(get_env_end_addr() - del_env_length); set_env_end_addr(get_env_end_addr() - del_env_length);
return result; return result;
@ -395,7 +401,7 @@ FlashErrCode flash_del_env(const char *key){
/** /**
* Set an environment variable. If it value is empty, delete it. * Set an environment variable. If it value is empty, delete it.
* If not find it in environment variables table, then create it. * If not find it in ENV table, then create it.
* *
* @param key environment variable name * @param key environment variable name
* @param value environment variable value * @param value environment variable value
@ -435,7 +441,7 @@ char *flash_get_env(const char *key) {
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
/* find environment variables */ /* find ENV */
env_cache_addr = find_env(key); env_cache_addr = find_env(key);
if (env_cache_addr == NULL) { if (env_cache_addr == NULL) {
return NULL; return NULL;
@ -449,7 +455,7 @@ char *flash_get_env(const char *key) {
return value; return value;
} }
/** /**
* Print environment variables. * Print ENV.
*/ */
void flash_print_env(void) { void flash_print_env(void) {
uint32_t *env_cache_data_addr = env_cache + FLASH_ENV_SYSTEM_WORD_SIZE, uint32_t *env_cache_data_addr = env_cache + FLASH_ENV_SYSTEM_WORD_SIZE,
@ -471,36 +477,36 @@ void flash_print_env(void) {
} }
} }
flash_print("\nEnvironment variables size: %ld/%ld bytes, mode: normal.\n", flash_print("\nEnvironment variables size: %ld/%ld bytes, mode: normal.\n",
flash_get_env_used_size(), flash_get_env_total_size()); flash_get_env_write_bytes(), flash_get_env_total_size());
} }
/** /**
* Load flash environment variables to ram. * Load flash ENV to ram.
*/ */
void flash_load_env(void) { void flash_load_env(void) {
uint32_t *env_cache_bak, env_end_addr; uint32_t *env_cache_bak, env_end_addr;
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
/* read environment variables end address from flash */ /* read ENV end address from flash */
flash_read(get_env_system_addr() + FLASH_ENV_SYSTEM_INDEX_END_ADDR * 4, &env_end_addr, 4); flash_read(get_env_system_addr() + FLASH_ENV_SYSTEM_INDEX_END_ADDR * 4, &env_end_addr, 4);
/* if environment variables is not initialize or flash has dirty data, set default for it */ /* if ENV is not initialize or flash has dirty data, set default for it */
if ((env_end_addr == 0xFFFFFFFF) || (env_end_addr > env_start_addr + env_total_size)) { if ((env_end_addr == 0xFFFFFFFF) || (env_end_addr > env_start_addr + env_total_size)) {
flash_env_set_default(); flash_env_set_default();
} else { } else {
/* set environment variables end address */ /* set ENV end address */
set_env_end_addr(env_end_addr); set_env_end_addr(env_end_addr);
env_cache_bak = env_cache + FLASH_ENV_SYSTEM_WORD_SIZE; env_cache_bak = env_cache + FLASH_ENV_SYSTEM_WORD_SIZE;
/* read all environment variables from flash */ /* read all ENV from flash */
flash_read(get_env_data_addr(), env_cache_bak, get_env_data_size()); flash_read(get_env_data_addr(), env_cache_bak, get_env_data_size());
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
/* read environment variables CRC code from flash */ /* read ENV CRC code from flash */
flash_read(get_env_system_addr() + FLASH_ENV_SYSTEM_INDEX_DATA_CRC * 4, flash_read(get_env_system_addr() + FLASH_ENV_SYSTEM_INDEX_DATA_CRC * 4,
&env_cache[FLASH_ENV_SYSTEM_INDEX_DATA_CRC] , 4); &env_cache[FLASH_ENV_SYSTEM_INDEX_DATA_CRC] , 4);
/* if environment variables CRC32 check is fault, set default for it */ /* if ENV CRC32 check is fault, set default for it */
if (!env_crc_is_ok()) { if (!env_crc_is_ok()) {
FLASH_INFO("Warning: Environment variables CRC check failed. Set it to default.\n"); FLASH_INFO("Warning: Environment variables CRC check failed. Set it to default.\n");
flash_env_set_default(); flash_env_set_default();
@ -511,7 +517,7 @@ void flash_load_env(void) {
} }
/** /**
* Save environment variables to flash. * Save ENV to flash.
*/ */
FlashErrCode flash_save_env(void) { FlashErrCode flash_save_env(void) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
@ -523,29 +529,29 @@ FlashErrCode flash_save_env(void) {
env_cache[FLASH_ENV_SYSTEM_INDEX_DATA_CRC] = calc_env_crc(); env_cache[FLASH_ENV_SYSTEM_INDEX_DATA_CRC] = calc_env_crc();
#endif #endif
/* erase environment variables */ /* erase ENV */
result = flash_erase(get_env_system_addr(), flash_get_env_used_size()); result = flash_erase(get_env_system_addr(), flash_get_env_write_bytes());
switch (result) { switch (result) {
case FLASH_NO_ERR: { case FLASH_NO_ERR: {
FLASH_INFO("Erased environment variables OK.\n"); FLASH_INFO("Erased ENV OK.\n");
break; break;
} }
case FLASH_ERASE_ERR: { case FLASH_ERASE_ERR: {
FLASH_INFO("Warning: Erased environment variables fault!\n"); FLASH_INFO("Warning: Erased ENV fault!\n");
/* will return when erase fault */ /* will return when erase fault */
return result; return result;
} }
} }
/* write environment variables to flash */ /* write ENV to flash */
result = flash_write(get_env_system_addr(), env_cache, flash_get_env_used_size()); result = flash_write(get_env_system_addr(), env_cache, flash_get_env_write_bytes());
switch (result) { switch (result) {
case FLASH_NO_ERR: { case FLASH_NO_ERR: {
FLASH_INFO("Saved environment variables OK.\n"); FLASH_INFO("Saved ENV OK.\n");
break; break;
} }
case FLASH_WRITE_ERR: { case FLASH_WRITE_ERR: {
FLASH_INFO("Warning: Saved environment variables fault!\n"); FLASH_INFO("Warning: Saved ENV fault!\n");
break; break;
} }
} }
@ -555,7 +561,7 @@ FlashErrCode flash_save_env(void) {
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
/** /**
* Calculate the cached environment variables CRC32 value. * Calculate the cached ENV CRC32 value.
* *
* @return CRC32 value * @return CRC32 value
*/ */
@ -563,8 +569,8 @@ static uint32_t calc_env_crc(void) {
uint32_t crc32 = 0; uint32_t crc32 = 0;
extern uint32_t calc_crc32(uint32_t crc, const void *buf, size_t size); extern uint32_t calc_crc32(uint32_t crc, const void *buf, size_t size);
/* Calculate the environment variables end address and all environment variables data CRC32. /* Calculate the ENV end address and all ENV data CRC32.
* The 4 is environment variables end address bytes size. */ * The 4 is ENV end address bytes size. */
crc32 = calc_crc32(crc32, &env_cache[FLASH_ENV_SYSTEM_INDEX_END_ADDR], 4); crc32 = calc_crc32(crc32, &env_cache[FLASH_ENV_SYSTEM_INDEX_END_ADDR], 4);
crc32 = calc_crc32(crc32, &env_cache[FLASH_ENV_SYSTEM_WORD_SIZE], get_env_data_size()); crc32 = calc_crc32(crc32, &env_cache[FLASH_ENV_SYSTEM_WORD_SIZE], get_env_data_size());
FLASH_DEBUG("Calculate Env CRC32 number is 0x%08X.\n", crc32); FLASH_DEBUG("Calculate Env CRC32 number is 0x%08X.\n", crc32);
@ -575,7 +581,7 @@ static uint32_t calc_env_crc(void) {
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
/** /**
* Check the environment variables CRC32 * Check the ENV CRC32
* *
* @return true is ok * @return true is ok
*/ */

View File

@ -32,21 +32,21 @@
* Storage Environment variables current using data section address. * Storage Environment variables current using data section address.
* Units: Word. Total size: @see FLASH_ERASE_MIN_SIZE. * Units: Word. Total size: @see FLASH_ERASE_MIN_SIZE.
* 2. Data section * 2. Data section
* The data section storage environment variables's parameters and detail. * The data section storage ENV's parameters and detail.
* When an exception has occurred on flash erase or write. The current using data section * When an exception has occurred on flash erase or write. The current using data section
* address will move to next available position. This position depends on FLASH_MIN_ERASE_SIZE. * address will move to next available position. This position depends on FLASH_MIN_ERASE_SIZE.
* 2.1 Environment variables parameters part * 2.1 Environment variables parameters part
* It storage environment variables's parameters. * It storage ENV's parameters.
* 2.2 Environment variables detail part * 2.2 Environment variables detail part
* It storage all environment variables. Storage format is key=value\0. * It storage all ENV. Storage format is key=value\0.
* All environment variables must be 4 bytes alignment. The remaining part must fill '\0'. * All ENV must be 4 bytes alignment. The remaining part must fill '\0'.
* *
* @note Word = 4 Bytes in this file * @note Word = 4 Bytes in this file
*/ */
/* flash ENV parameters part index and size */ /* flash ENV parameters part index and size */
enum { enum {
/* data section environment variables detail part end address index */ /* data section ENV detail part end address index */
ENV_PARAM_PART_INDEX_END_ADDR = 0, ENV_PARAM_PART_INDEX_END_ADDR = 0,
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
@ -54,23 +54,25 @@ enum {
ENV_PARAM_PART_INDEX_DATA_CRC, ENV_PARAM_PART_INDEX_DATA_CRC,
#endif #endif
/* environment variables parameters part word size */ /* ENV parameters part word size */
ENV_PARAM_PART_WORD_SIZE, ENV_PARAM_PART_WORD_SIZE,
/* environment variables parameters part byte size */ /* ENV parameters part byte size */
ENV_PARAM_PART_BYTE_SIZE = ENV_PARAM_PART_WORD_SIZE * 4, ENV_PARAM_PART_BYTE_SIZE = ENV_PARAM_PART_WORD_SIZE * 4,
}; };
/* default environment variables set, must be initialized by user */ /* default ENV set, must be initialized by user */
static flash_env const *default_env_set = NULL; static flash_env const *default_env_set = NULL;
/* default environment variables set size, must be initialized by user */ /* default ENV set size, must be initialized by user */
static size_t default_env_set_size = NULL; static size_t default_env_set_size = NULL;
/* flash environment variables all section total size */ /* flash user setting ENV size */
static size_t env_user_size = NULL;
/* flash ENV all section total size */
static size_t env_total_size = NULL; static size_t env_total_size = NULL;
/* the minimum size of flash erasure */ /* the minimum size of flash erasure */
static size_t flash_erase_min_size = NULL; static size_t flash_erase_min_size = NULL;
/* environment variables RAM cache */ /* ENV RAM cache */
static uint32_t *env_cache = NULL; static uint32_t *env_cache = NULL;
/* environment variables start address in flash */ /* ENV start address in flash */
static uint32_t env_start_addr = NULL; static uint32_t env_start_addr = NULL;
/* current using data section address */ /* current using data section address */
static uint32_t cur_using_data_addr = NULL; static uint32_t cur_using_data_addr = NULL;
@ -84,6 +86,8 @@ static void set_env_detail_end_addr(uint32_t end_addr);
static FlashErrCode write_env(const char *key, const char *value); static FlashErrCode write_env(const char *key, const char *value);
static uint32_t *find_env(const char *key); static uint32_t *find_env(const char *key);
static size_t get_env_detail_size(void); static size_t get_env_detail_size(void);
static size_t get_env_user_size(void);
static size_t get_env_user_used_size(void);
static FlashErrCode create_env(const char *key, const char *value); static FlashErrCode create_env(const char *key, const char *value);
static FlashErrCode save_cur_using_data_addr(uint32_t cur_data_addr); static FlashErrCode save_cur_using_data_addr(uint32_t cur_data_addr);
@ -93,31 +97,35 @@ static bool_t env_crc_is_ok(void);
#endif #endif
/** /**
* Flash environment variables initialize. * Flash ENV initialize.
* *
* @param start_addr environment variables start address in flash * @param start_addr ENV start address in flash
* @param total_size environment variables section total size (@note must be word alignment) * @param user_size user setting ENV bytes size (@note must be word alignment)
* @param total_size ENV section total size (@note must be word alignment)
* @param erase_min_size the minimum size of flash erasure * @param erase_min_size the minimum size of flash erasure
* @param default_env default environment variables set for user * @param default_env default ENV set for user
* @param default_env_size default environment variables set size * @param default_env_size default ENV set size
* *
* @return result * @return result
*/ */
FlashErrCode flash_env_init(uint32_t start_addr, size_t total_size, size_t erase_min_size, FlashErrCode flash_env_init(uint32_t start_addr, size_t user_size, size_t total_size,
flash_env const *default_env, size_t default_env_size) { size_t erase_min_size, flash_env const *default_env, size_t default_env_size) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
FLASH_ASSERT(start_addr); FLASH_ASSERT(start_addr);
FLASH_ASSERT(user_size);
FLASH_ASSERT(total_size); FLASH_ASSERT(total_size);
FLASH_ASSERT(erase_min_size); FLASH_ASSERT(erase_min_size);
FLASH_ASSERT(default_env); FLASH_ASSERT(default_env);
FLASH_ASSERT(default_env_size < total_size); FLASH_ASSERT(default_env_size < user_size);
/* must be word alignment for environment variables */ /* must be word alignment for ENV */
FLASH_ASSERT(user_size % 4 == 0);
FLASH_ASSERT(total_size % 4 == 0); FLASH_ASSERT(total_size % 4 == 0);
/* make true only be initialized once */ /* make true only be initialized once */
FLASH_ASSERT(!env_cache); FLASH_ASSERT(!env_cache);
env_start_addr = start_addr; env_start_addr = start_addr;
env_user_size = user_size;
env_total_size = total_size; env_total_size = total_size;
flash_erase_min_size = erase_min_size; flash_erase_min_size = erase_min_size;
default_env_set = default_env; default_env_set = default_env;
@ -125,8 +133,8 @@ FlashErrCode flash_env_init(uint32_t start_addr, size_t total_size, size_t erase
FLASH_DEBUG("Env start address is 0x%08X, size is %d bytes.\n", start_addr, total_size); FLASH_DEBUG("Env start address is 0x%08X, size is %d bytes.\n", start_addr, total_size);
/* create environment variables ram cache */ /* create ENV ram cache */
env_cache = (uint32_t *) flash_malloc(sizeof(uint8_t) * total_size); env_cache = (uint32_t *) flash_malloc(sizeof(uint8_t) * user_size);
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
flash_load_env(); flash_load_env();
@ -150,7 +158,7 @@ FlashErrCode flash_env_set_default(void){
/* set ENV detail part end address is at ENV detail part start address */ /* set ENV detail part end address is at ENV detail part start address */
set_env_detail_end_addr(get_env_detail_addr()); set_env_detail_end_addr(get_env_detail_addr());
/* create default environment variables */ /* create default ENV */
for (i = 0; i < default_env_set_size; i++) { for (i = 0; i < default_env_set_size; i++) {
create_env(default_env_set[i].key, default_env_set[i].value); create_env(default_env_set[i].key, default_env_set[i].value);
} }
@ -161,9 +169,9 @@ FlashErrCode flash_env_set_default(void){
} }
/** /**
* Get environment variables start address in flash. * Get ENV start address in flash.
* *
* @return environment variables start address in flash * @return ENV start address in flash
*/ */
static uint32_t get_env_start_addr(void) { static uint32_t get_env_start_addr(void) {
FLASH_ASSERT(env_start_addr); FLASH_ASSERT(env_start_addr);
@ -189,20 +197,20 @@ static void set_cur_using_data_addr(uint32_t using_data_addr) {
} }
/** /**
* Get environment variables detail part start address. * Get ENV detail part start address.
* *
* @return detail part start address * @return detail part start address
*/ */
static uint32_t get_env_detail_addr(void) { static uint32_t get_env_detail_addr(void) {
FLASH_ASSERT(cur_using_data_addr); FLASH_ASSERT(cur_using_data_addr);
return cur_using_data_addr + ENV_PARAM_PART_BYTE_SIZE; return get_cur_using_data_addr() + ENV_PARAM_PART_BYTE_SIZE;
} }
/** /**
* Get environment variables detail part end address. * Get ENV detail part end address.
* It's the first word in environment variables. * It's the first word in ENV.
* *
* @return environment variables end address * @return ENV end address
*/ */
static uint32_t get_env_detail_end_addr(void) { static uint32_t get_env_detail_end_addr(void) {
/* it is the first word */ /* it is the first word */
@ -210,17 +218,17 @@ static uint32_t get_env_detail_end_addr(void) {
} }
/** /**
* Set environment variables detail part end address. * Set ENV detail part end address.
* It's the first word in environment variables. * It's the first word in ENV.
* *
* @param end_addr environment variables end address * @param end_addr ENV end address
*/ */
static void set_env_detail_end_addr(uint32_t end_addr) { static void set_env_detail_end_addr(uint32_t end_addr) {
env_cache[ENV_PARAM_PART_INDEX_END_ADDR] = end_addr; env_cache[ENV_PARAM_PART_INDEX_END_ADDR] = end_addr;
} }
/** /**
* Get current environment variables detail part size. * Get current ENV detail part size.
* *
* @return size * @return size
*/ */
@ -229,7 +237,44 @@ static size_t get_env_detail_size(void) {
} }
/** /**
* Get current environment variables section total size. * Get current user setting ENV size.
*
* @return size
*/
static size_t get_env_user_size(void) {
/* must be initialized */
FLASH_ASSERT(env_user_size);
return env_user_size;
}
/**
* Get current user used ENV size.
*
* @see get_env_user_size
*
* @return size
*/
/* must be initialized */
static size_t get_env_user_used_size(void) {
FLASH_ASSERT(env_user_size);
return get_env_detail_end_addr() - get_cur_using_data_addr();
}
/**
* Get current ENV already write bytes.
*
* @return write bytes
*/
uint32_t flash_get_env_write_bytes(void) {
return get_env_detail_end_addr() - get_env_start_addr();
}
/**
* Get current ENV section total size.
*
* @see flash_get_env_total_size
* *
* @return size * @return size
*/ */
@ -240,15 +285,6 @@ size_t flash_get_env_total_size(void) {
return env_total_size; return env_total_size;
} }
/**
* Get current environment variables used byte size.
*
* @return size
*/
uint32_t flash_get_env_used_size(void) {
return get_env_detail_end_addr() - get_env_start_addr();
}
/** /**
* Write an environment variable at the end of cache. * Write an environment variable at the end of cache.
* *
@ -262,13 +298,13 @@ static FlashErrCode write_env(const char *key, const char *value) {
uint16_t env_str_index = 0, env_str_length, i; uint16_t env_str_index = 0, env_str_length, i;
char *env_str; char *env_str;
/* calculate environment variables storage length, contain '=' and '\0'. */ /* calculate ENV storage length, contain '=' and '\0'. */
env_str_length = strlen(key) + strlen(value) + 2; env_str_length = strlen(key) + strlen(value) + 2;
if (env_str_length % 4 != 0) { if (env_str_length % 4 != 0) {
env_str_length = (env_str_length / 4 + 1) * 4; env_str_length = (env_str_length / 4 + 1) * 4;
} }
/* check capacity of environment variables */ /* check capacity of ENV */
if (env_str_length + get_env_detail_size() >= flash_get_env_total_size()) { if (env_str_length + get_env_detail_size() >= get_env_user_size()) {
return FLASH_ENV_FULL; return FLASH_ENV_FULL;
} }
/* use ram to process string key=value\0 */ /* use ram to process string key=value\0 */
@ -300,11 +336,11 @@ static FlashErrCode write_env(const char *key, const char *value) {
} }
/** /**
* Find environment variables. * Find ENV.
* *
* @param key environment variables name * @param key ENV name
* *
* @return index of environment variables in ram cache * @return index of ENV in ram cache
*/ */
static uint32_t *find_env(const char *key) { static uint32_t *find_env(const char *key) {
uint32_t *env_cache_addr = NULL; uint32_t *env_cache_addr = NULL;
@ -313,7 +349,7 @@ static uint32_t *find_env(const char *key) {
FLASH_ASSERT(cur_using_data_addr); FLASH_ASSERT(cur_using_data_addr);
if (*key == NULL) { if (*key == NULL) {
FLASH_INFO("Flash environment variables name must be not empty!\n"); FLASH_INFO("Flash ENV name must be not empty!\n");
return NULL; return NULL;
} }
@ -321,7 +357,7 @@ static uint32_t *find_env(const char *key) {
env_start = (char *) ((char *) env_cache + ENV_PARAM_PART_BYTE_SIZE); env_start = (char *) ((char *) env_cache + ENV_PARAM_PART_BYTE_SIZE);
env_end = (char *) ((char *) env_cache + ENV_PARAM_PART_BYTE_SIZE + get_env_detail_size()); env_end = (char *) ((char *) env_cache + ENV_PARAM_PART_BYTE_SIZE + get_env_detail_size());
/* environment variables is null */ /* ENV is null */
if (env_start == env_end) { if (env_start == env_end) {
return NULL; return NULL;
} }
@ -335,7 +371,7 @@ static uint32_t *find_env(const char *key) {
env_cache_addr = (uint32_t *) env; env_cache_addr = (uint32_t *) env;
break; break;
} else { } else {
/* next environment variables */ /* next ENV */
env += strlen(env) + 1; env += strlen(env) + 1;
} }
} }
@ -358,21 +394,21 @@ static FlashErrCode create_env(const char *key, const char *value) {
FLASH_ASSERT(value); FLASH_ASSERT(value);
if (*key == NULL) { if (*key == NULL) {
FLASH_INFO("Flash environment variables name must be not empty!\n"); FLASH_INFO("Flash ENV name must be not empty!\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
if (strstr(key, "=")) { if (strstr(key, "=")) {
FLASH_INFO("Flash environment variables name can't contain '='.\n"); FLASH_INFO("Flash ENV name can't contain '='.\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
/* find environment variables */ /* find ENV */
if (find_env(key)) { if (find_env(key)) {
FLASH_INFO("The name of \"%s\" is already exist.\n", key); FLASH_INFO("The name of \"%s\" is already exist.\n", key);
return FLASH_ENV_NAME_EXIST; return FLASH_ENV_NAME_EXIST;
} }
/* write environment variables to flash */ /* write ENV at the end of cache */
result = write_env(key, value); result = write_env(key, value);
return result; return result;
@ -394,19 +430,19 @@ FlashErrCode flash_del_env(const char *key){
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
if (*key == NULL) { if (*key == NULL) {
FLASH_INFO("Flash environment variables name must be not NULL!\n"); FLASH_INFO("Flash ENV name must be not NULL!\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
if (strstr(key, "=")) { if (strstr(key, "=")) {
FLASH_INFO("Flash environment variables name or value can't contain '='.\n"); FLASH_INFO("Flash ENV name or value can't contain '='.\n");
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
/* find environment variables */ /* find ENV */
del_env_str = (char *) find_env(key); del_env_str = (char *) find_env(key);
if (!del_env_str) { if (!del_env_str) {
FLASH_INFO("Not find \"%s\" in environment variables.\n", key); FLASH_INFO("Not find \"%s\" in ENV.\n", key);
return FLASH_ENV_NAME_ERR; return FLASH_ENV_NAME_ERR;
} }
del_env_length = strlen(del_env_str); del_env_length = strlen(del_env_str);
@ -416,11 +452,11 @@ FlashErrCode flash_del_env(const char *key){
if (del_env_length % 4 != 0) { if (del_env_length % 4 != 0) {
del_env_length = (del_env_length / 4 + 1) * 4; del_env_length = (del_env_length / 4 + 1) * 4;
} }
/* calculate remain environment variables length */ /* calculate remain ENV length */
remain_env_length = get_env_detail_size() - ((uint32_t) del_env_str - (uint32_t) env_cache); remain_env_length = get_env_detail_size() - ((uint32_t) del_env_str - (uint32_t) env_cache);
/* remain environment variables move forward */ /* remain ENV move forward */
memcpy(del_env_str, del_env_str + del_env_length, remain_env_length); memcpy(del_env_str, del_env_str + del_env_length, remain_env_length);
/* reset environment variables detail part end address */ /* reset ENV detail part end address */
set_env_detail_end_addr(get_env_detail_end_addr() - del_env_length); set_env_detail_end_addr(get_env_detail_end_addr() - del_env_length);
return result; return result;
@ -428,7 +464,7 @@ FlashErrCode flash_del_env(const char *key){
/** /**
* Set an environment variable. If it value is empty, delete it. * Set an environment variable. If it value is empty, delete it.
* If not find it in environment variables table, then create it. * If not find it in ENV table, then create it.
* *
* @param key environment variable name * @param key environment variable name
* @param value environment variable value * @param value environment variable value
@ -468,7 +504,7 @@ char *flash_get_env(const char *key) {
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
/* find environment variables */ /* find ENV */
env_cache_addr = find_env(key); env_cache_addr = find_env(key);
if (env_cache_addr == NULL) { if (env_cache_addr == NULL) {
return NULL; return NULL;
@ -482,7 +518,7 @@ char *flash_get_env(const char *key) {
return value; return value;
} }
/** /**
* Print environment variables. * Print ENV.
*/ */
void flash_print_env(void) { void flash_print_env(void) {
uint32_t *env_cache_detail_addr = env_cache + ENV_PARAM_PART_WORD_SIZE, uint32_t *env_cache_detail_addr = env_cache + ENV_PARAM_PART_WORD_SIZE,
@ -503,12 +539,13 @@ void flash_print_env(void) {
} }
} }
} }
flash_print("\nEnvironment variables size: %ld/%ld bytes, mode: wear leveling.\n", flash_print("\nEnvironment variables size: %ld/%ld bytes, write bytes %ld/%ld, mode: wear leveling.\n",
flash_get_env_used_size(), flash_get_env_total_size()); get_env_user_used_size(), get_env_user_size(), flash_get_env_write_bytes(),
flash_get_env_total_size());
} }
/** /**
* Load flash environment variables to ram. * Load flash ENV to ram.
*/ */
void flash_load_env(void) { void flash_load_env(void) {
uint32_t *env_cache_bak, env_end_addr, using_data_addr; uint32_t *env_cache_bak, env_end_addr, using_data_addr;
@ -517,36 +554,38 @@ void flash_load_env(void) {
/* read current using data section address */ /* read current using data section address */
flash_read(get_env_start_addr(), &using_data_addr, 4); flash_read(get_env_start_addr(), &using_data_addr, 4);
/* if environment variables is not initialize or flash has dirty data, set default for it */ /* if ENV is not initialize or flash has dirty data, set default for it */
if ((using_data_addr == 0xFFFFFFFF) || (using_data_addr > env_start_addr + env_total_size)) { if ((using_data_addr == 0xFFFFFFFF)
|| (using_data_addr > get_env_start_addr() + flash_get_env_total_size())
|| (using_data_addr < get_env_start_addr() + flash_erase_min_size)) {
/* initialize current using data section address */ /* initialize current using data section address */
set_cur_using_data_addr(get_env_start_addr() + flash_erase_min_size); set_cur_using_data_addr(get_env_start_addr() + flash_erase_min_size);
/* save current using data section address to flash*/ /* save current using data section address to flash*/
save_cur_using_data_addr(get_cur_using_data_addr()); save_cur_using_data_addr(get_cur_using_data_addr());
/* set default environment variables */ /* set default ENV */
flash_env_set_default(); flash_env_set_default();
} else { } else {
/* set current using data section address */ /* set current using data section address */
set_cur_using_data_addr(using_data_addr); set_cur_using_data_addr(using_data_addr);
/* read environment variables detail part end address from flash */ /* read ENV detail part end address from flash */
flash_read(get_cur_using_data_addr() + ENV_PARAM_PART_INDEX_END_ADDR * 4, &env_end_addr, 4); flash_read(get_cur_using_data_addr() + ENV_PARAM_PART_INDEX_END_ADDR * 4, &env_end_addr, 4);
/* if environment variables end address has error, set default for environment variables */ /* if ENV end address has error, set default for ENV */
if (env_end_addr > env_start_addr + env_total_size) { if (env_end_addr > get_env_start_addr() + flash_get_env_total_size()) {
flash_env_set_default(); flash_env_set_default();
} else { } else {
/* set environment variables detail part end address */ /* set ENV detail part end address */
set_env_detail_end_addr(env_end_addr); set_env_detail_end_addr(env_end_addr);
env_cache_bak = env_cache + ENV_PARAM_PART_WORD_SIZE; env_cache_bak = env_cache + ENV_PARAM_PART_WORD_SIZE;
/* read all environment variables from flash */ /* read all ENV from flash */
flash_read(get_env_detail_addr(), env_cache_bak, get_env_detail_size()); flash_read(get_env_detail_addr(), env_cache_bak, get_env_detail_size());
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
/* read environment variables CRC code from flash */ /* read ENV CRC code from flash */
flash_read(get_cur_using_data_addr() + ENV_PARAM_PART_INDEX_DATA_CRC * 4, flash_read(get_cur_using_data_addr() + ENV_PARAM_PART_INDEX_DATA_CRC * 4,
&env_cache[ENV_PARAM_PART_INDEX_DATA_CRC], 4); &env_cache[ENV_PARAM_PART_INDEX_DATA_CRC], 4);
/* if environment variables CRC32 check is fault, set default for it */ /* if ENV CRC32 check is fault, set default for it */
if (!env_crc_is_ok()) { if (!env_crc_is_ok()) {
FLASH_INFO("Warning: Environment variables CRC check failed. Set it to default.\n"); FLASH_INFO("Warning: Environment variables CRC check failed. Set it to default.\n");
flash_env_set_default(); flash_env_set_default();
@ -558,7 +597,7 @@ void flash_load_env(void) {
} }
/** /**
* Save environment variables to flash. * Save ENV to flash.
*/ */
FlashErrCode flash_save_env(void) { FlashErrCode flash_save_env(void) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
@ -567,7 +606,7 @@ FlashErrCode flash_save_env(void) {
FLASH_ASSERT(env_cache); FLASH_ASSERT(env_cache);
/* wear leveling process, automatic move environment variables to next available position */ /* wear leveling process, automatic move ENV to next available position */
while (get_cur_using_data_addr() + env_detail_size while (get_cur_using_data_addr() + env_detail_size
< get_env_start_addr() + flash_get_env_total_size()) { < get_env_start_addr() + flash_get_env_total_size()) {
@ -575,50 +614,50 @@ FlashErrCode flash_save_env(void) {
/* calculate and cache CRC32 code */ /* calculate and cache CRC32 code */
env_cache[ENV_PARAM_PART_INDEX_DATA_CRC] = calc_env_crc(); env_cache[ENV_PARAM_PART_INDEX_DATA_CRC] = calc_env_crc();
#endif #endif
/* erase environment variables */ /* erase ENV */
result = flash_erase(get_cur_using_data_addr(), ENV_PARAM_PART_BYTE_SIZE + env_detail_size); result = flash_erase(get_cur_using_data_addr(), ENV_PARAM_PART_BYTE_SIZE + env_detail_size);
switch (result) { switch (result) {
case FLASH_NO_ERR: { case FLASH_NO_ERR: {
FLASH_INFO("Erased environment variables OK.\n"); FLASH_INFO("Erased ENV OK.\n");
break; break;
} }
case FLASH_ERASE_ERR: { case FLASH_ERASE_ERR: {
FLASH_INFO("Warning: Erased environment variables fault!\n"); FLASH_INFO("Warning: Erased ENV fault!\n");
FLASH_INFO("Moving environment variables to next available position.\n"); FLASH_INFO("Moving ENV to next available position.\n");
/* Calculate move offset address. /* Calculate move offset address.
* Current strategy is optimistic. It will offset the flash erasure minimum size. * Current strategy is optimistic. It will offset the flash erasure minimum size.
*/ */
move_offset_addr = flash_erase_min_size; move_offset_addr = flash_erase_min_size;
/* calculate and set next available data section address */ /* calculate and set next available data section address */
set_cur_using_data_addr(get_cur_using_data_addr() + move_offset_addr); set_cur_using_data_addr(get_cur_using_data_addr() + move_offset_addr);
/* calculate and set next available environment variables detail part end address */ /* calculate and set next available ENV detail part end address */
set_env_detail_end_addr(get_env_detail_end_addr() + move_offset_addr); set_env_detail_end_addr(get_env_detail_end_addr() + move_offset_addr);
continue; continue;
} }
} }
/* write environment variables to flash */ /* write ENV to flash */
result = flash_write(get_cur_using_data_addr(), env_cache, result = flash_write(get_cur_using_data_addr(), env_cache,
ENV_PARAM_PART_BYTE_SIZE + env_detail_size); ENV_PARAM_PART_BYTE_SIZE + env_detail_size);
switch (result) { switch (result) {
case FLASH_NO_ERR: { case FLASH_NO_ERR: {
FLASH_INFO("Saved environment variables OK.\n"); FLASH_INFO("Saved ENV OK.\n");
break; break;
} }
case FLASH_WRITE_ERR: { case FLASH_WRITE_ERR: {
FLASH_INFO("Warning: Saved environment variables fault!\n"); FLASH_INFO("Warning: Saved ENV fault!\n");
FLASH_INFO("Moving environment variables to next available position.\n"); FLASH_INFO("Moving ENV to next available position.\n");
/* Calculate move offset address. /* Calculate move offset address.
* Current strategy is optimistic. It will offset the flash erasure minimum size. * Current strategy is optimistic. It will offset the flash erasure minimum size.
*/ */
move_offset_addr = flash_erase_min_size; move_offset_addr = flash_erase_min_size;
/* calculate and set next available data section address */ /* calculate and set next available data section address */
set_cur_using_data_addr(get_cur_using_data_addr() + move_offset_addr); set_cur_using_data_addr(get_cur_using_data_addr() + move_offset_addr);
/* calculate and set next available environment variables detail part end address */ /* calculate and set next available ENV detail part end address */
set_env_detail_end_addr(get_env_detail_end_addr() + move_offset_addr); set_env_detail_end_addr(get_env_detail_end_addr() + move_offset_addr);
continue; continue;
} }
} }
/* save environment variables success */ /* save ENV success */
if (result == FLASH_NO_ERR) { if (result == FLASH_NO_ERR) {
break; break;
} }
@ -632,7 +671,7 @@ FlashErrCode flash_save_env(void) {
} }
} else { } else {
result = FLASH_ENV_FULL; result = FLASH_ENV_FULL;
FLASH_INFO("Error: The flash has no available space to save environment variables.\n"); FLASH_INFO("Error: The flash has no available space to save ENV.\n");
/* clear current using data section address on flash */ /* clear current using data section address on flash */
save_cur_using_data_addr(0xFFFFFFFF); save_cur_using_data_addr(0xFFFFFFFF);
} }
@ -642,7 +681,7 @@ FlashErrCode flash_save_env(void) {
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
/** /**
* Calculate the cached environment variables CRC32 value. * Calculate the cached ENV CRC32 value.
* *
* @return CRC32 value * @return CRC32 value
*/ */
@ -650,8 +689,8 @@ static uint32_t calc_env_crc(void) {
uint32_t crc32 = 0; uint32_t crc32 = 0;
extern uint32_t calc_crc32(uint32_t crc, const void *buf, size_t size); extern uint32_t calc_crc32(uint32_t crc, const void *buf, size_t size);
/* Calculate the environment variables end address and all environment variables data CRC32. /* Calculate the ENV end address and all ENV data CRC32.
* The 4 is environment variables end address bytes size. */ * The 4 is ENV end address bytes size. */
crc32 = calc_crc32(crc32, &env_cache[ENV_PARAM_PART_INDEX_END_ADDR], 4); crc32 = calc_crc32(crc32, &env_cache[ENV_PARAM_PART_INDEX_END_ADDR], 4);
crc32 = calc_crc32(crc32, &env_cache[ENV_PARAM_PART_WORD_SIZE], get_env_detail_size()); crc32 = calc_crc32(crc32, &env_cache[ENV_PARAM_PART_WORD_SIZE], get_env_detail_size());
FLASH_DEBUG("Calculate Env CRC32 number is 0x%08X.\n", crc32); FLASH_DEBUG("Calculate Env CRC32 number is 0x%08X.\n", crc32);
@ -662,7 +701,7 @@ static uint32_t calc_env_crc(void) {
#ifdef FLASH_ENV_USING_CRC_CHECK #ifdef FLASH_ENV_USING_CRC_CHECK
/** /**
* Check the environment variables CRC32 * Check the ENV CRC32
* *
* @return true is ok * @return true is ok
*/ */
@ -685,18 +724,18 @@ static bool_t env_crc_is_ok(void) {
*/ */
static FlashErrCode save_cur_using_data_addr(uint32_t cur_data_addr) { static FlashErrCode save_cur_using_data_addr(uint32_t cur_data_addr) {
FlashErrCode result = FLASH_NO_ERR; FlashErrCode result = FLASH_NO_ERR;
/* erase environment variables system section */ /* erase ENV system section */
result = flash_erase(get_env_start_addr(), 4); result = flash_erase(get_env_start_addr(), 4);
if (result == FLASH_NO_ERR) { if (result == FLASH_NO_ERR) {
/* write current using data section address to flash */ /* write current using data section address to flash */
result = flash_write(get_env_start_addr(), &cur_data_addr, 4); result = flash_write(get_env_start_addr(), &cur_data_addr, 4);
if (result == FLASH_WRITE_ERR) { if (result == FLASH_WRITE_ERR) {
FLASH_INFO("Error: Write system section fault!\n"); FLASH_INFO("Error: Write system section fault!\n");
FLASH_INFO("Note: The environment variables can not be used.\n"); FLASH_INFO("Note: The ENV can not be used.\n");
} }
} else { } else {
FLASH_INFO("Error: Erased system section fault!\n"); FLASH_INFO("Error: Erased system section fault!\n");
FLASH_INFO("Note: The environment variables can not be used\n"); FLASH_INFO("Note: The ENV can not be used\n");
} }
return result; return result;
} }