app启动时如果boot魔数校验错误则自动升级bootloader
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -16,4 +16,5 @@ python/dist/
|
|||||||
*.xlsx
|
*.xlsx
|
||||||
*.json
|
*.json
|
||||||
quest_info.txt
|
quest_info.txt
|
||||||
*.jwt
|
*.jwt
|
||||||
|
bootcode.txt
|
||||||
|
@@ -21,6 +21,230 @@
|
|||||||
<dwHighDateTime>0</dwHighDateTime>
|
<dwHighDateTime>0</dwHighDateTime>
|
||||||
</DaveTm>
|
</DaveTm>
|
||||||
|
|
||||||
|
<Target>
|
||||||
|
<TargetName>boot</TargetName>
|
||||||
|
<ToolsetNumber>0x4</ToolsetNumber>
|
||||||
|
<ToolsetName>ARM-ADS</ToolsetName>
|
||||||
|
<TargetOption>
|
||||||
|
<CLKADS>12000000</CLKADS>
|
||||||
|
<OPTTT>
|
||||||
|
<gFlags>1</gFlags>
|
||||||
|
<BeepAtEnd>1</BeepAtEnd>
|
||||||
|
<RunSim>0</RunSim>
|
||||||
|
<RunTarget>1</RunTarget>
|
||||||
|
<RunAbUc>0</RunAbUc>
|
||||||
|
</OPTTT>
|
||||||
|
<OPTHX>
|
||||||
|
<HexSelection>1</HexSelection>
|
||||||
|
<FlashByte>65535</FlashByte>
|
||||||
|
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||||
|
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||||
|
<HexOffset>0</HexOffset>
|
||||||
|
</OPTHX>
|
||||||
|
<OPTLEX>
|
||||||
|
<PageWidth>79</PageWidth>
|
||||||
|
<PageLength>66</PageLength>
|
||||||
|
<TabStop>8</TabStop>
|
||||||
|
<ListingPath>.\Listings\</ListingPath>
|
||||||
|
</OPTLEX>
|
||||||
|
<ListingPage>
|
||||||
|
<CreateCListing>1</CreateCListing>
|
||||||
|
<CreateAListing>1</CreateAListing>
|
||||||
|
<CreateLListing>1</CreateLListing>
|
||||||
|
<CreateIListing>0</CreateIListing>
|
||||||
|
<AsmCond>1</AsmCond>
|
||||||
|
<AsmSymb>1</AsmSymb>
|
||||||
|
<AsmXref>0</AsmXref>
|
||||||
|
<CCond>1</CCond>
|
||||||
|
<CCode>0</CCode>
|
||||||
|
<CListInc>0</CListInc>
|
||||||
|
<CSymb>0</CSymb>
|
||||||
|
<LinkerCodeListing>0</LinkerCodeListing>
|
||||||
|
</ListingPage>
|
||||||
|
<OPTXL>
|
||||||
|
<LMap>1</LMap>
|
||||||
|
<LComments>1</LComments>
|
||||||
|
<LGenerateSymbols>1</LGenerateSymbols>
|
||||||
|
<LLibSym>1</LLibSym>
|
||||||
|
<LLines>1</LLines>
|
||||||
|
<LLocSym>1</LLocSym>
|
||||||
|
<LPubSym>1</LPubSym>
|
||||||
|
<LXref>0</LXref>
|
||||||
|
<LExpSel>0</LExpSel>
|
||||||
|
</OPTXL>
|
||||||
|
<OPTFL>
|
||||||
|
<tvExp>1</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<IsCurrentTarget>0</IsCurrentTarget>
|
||||||
|
</OPTFL>
|
||||||
|
<CpuCode>18</CpuCode>
|
||||||
|
<DebugOpt>
|
||||||
|
<uSim>0</uSim>
|
||||||
|
<uTrg>1</uTrg>
|
||||||
|
<sLdApp>1</sLdApp>
|
||||||
|
<sGomain>1</sGomain>
|
||||||
|
<sRbreak>1</sRbreak>
|
||||||
|
<sRwatch>1</sRwatch>
|
||||||
|
<sRmem>1</sRmem>
|
||||||
|
<sRfunc>1</sRfunc>
|
||||||
|
<sRbox>1</sRbox>
|
||||||
|
<tLdApp>1</tLdApp>
|
||||||
|
<tGomain>1</tGomain>
|
||||||
|
<tRbreak>1</tRbreak>
|
||||||
|
<tRwatch>1</tRwatch>
|
||||||
|
<tRmem>1</tRmem>
|
||||||
|
<tRfunc>0</tRfunc>
|
||||||
|
<tRbox>1</tRbox>
|
||||||
|
<tRtrace>1</tRtrace>
|
||||||
|
<sRSysVw>1</sRSysVw>
|
||||||
|
<tRSysVw>1</tRSysVw>
|
||||||
|
<sRunDeb>0</sRunDeb>
|
||||||
|
<sLrtime>0</sLrtime>
|
||||||
|
<bEvRecOn>1</bEvRecOn>
|
||||||
|
<bSchkAxf>0</bSchkAxf>
|
||||||
|
<bTchkAxf>0</bTchkAxf>
|
||||||
|
<nTsel>6</nTsel>
|
||||||
|
<sDll></sDll>
|
||||||
|
<sDllPa></sDllPa>
|
||||||
|
<sDlgDll></sDlgDll>
|
||||||
|
<sDlgPa></sDlgPa>
|
||||||
|
<sIfile></sIfile>
|
||||||
|
<tDll></tDll>
|
||||||
|
<tDllPa></tDllPa>
|
||||||
|
<tDlgDll></tDlgDll>
|
||||||
|
<tDlgPa></tDlgPa>
|
||||||
|
<tIfile></tIfile>
|
||||||
|
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||||
|
</DebugOpt>
|
||||||
|
<TargetDriverDllRegistry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>DLGUARM</Key>
|
||||||
|
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||||
|
<Name>-U52FF6E065266545441081687 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>UL2CM3</Key>
|
||||||
|
<Name>UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0GD32F30x_HD -FL040000 -FS08000000 -FP0($$Device:GD32F303RC$Flash\GD32F30x_HD.FLM)</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>JL2CM3</Key>
|
||||||
|
<Name>-U69655983 -O78 -S5 -ZTIFSpeedSel1000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>ARMRTXEVENTFLAGS</Key>
|
||||||
|
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>DLGTARM</Key>
|
||||||
|
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>ARMDBGFLAGS</Key>
|
||||||
|
<Name></Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
</TargetDriverDllRegistry>
|
||||||
|
<Breakpoint/>
|
||||||
|
<WatchWindow1>
|
||||||
|
<Ww>
|
||||||
|
<count>0</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>m_used</ItemText>
|
||||||
|
</Ww>
|
||||||
|
</WatchWindow1>
|
||||||
|
<MemoryWindow1>
|
||||||
|
<Mm>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<SubType>0</SubType>
|
||||||
|
<ItemText>0x08004000</ItemText>
|
||||||
|
<AccSizeX>0</AccSizeX>
|
||||||
|
</Mm>
|
||||||
|
</MemoryWindow1>
|
||||||
|
<MemoryWindow2>
|
||||||
|
<Mm>
|
||||||
|
<WinNumber>2</WinNumber>
|
||||||
|
<SubType>1</SubType>
|
||||||
|
<ItemText>m</ItemText>
|
||||||
|
<AccSizeX>0</AccSizeX>
|
||||||
|
</Mm>
|
||||||
|
</MemoryWindow2>
|
||||||
|
<MemoryWindow3>
|
||||||
|
<Mm>
|
||||||
|
<WinNumber>3</WinNumber>
|
||||||
|
<SubType>1</SubType>
|
||||||
|
<ItemText>0x2000CA00</ItemText>
|
||||||
|
<AccSizeX>0</AccSizeX>
|
||||||
|
</Mm>
|
||||||
|
</MemoryWindow3>
|
||||||
|
<MemoryWindow4>
|
||||||
|
<Mm>
|
||||||
|
<WinNumber>4</WinNumber>
|
||||||
|
<SubType>0</SubType>
|
||||||
|
<ItemText>0x20019bb0</ItemText>
|
||||||
|
<AccSizeX>0</AccSizeX>
|
||||||
|
</Mm>
|
||||||
|
</MemoryWindow4>
|
||||||
|
<Tracepoint>
|
||||||
|
<THDelay>0</THDelay>
|
||||||
|
</Tracepoint>
|
||||||
|
<DebugFlag>
|
||||||
|
<trace>0</trace>
|
||||||
|
<periodic>1</periodic>
|
||||||
|
<aLwin>1</aLwin>
|
||||||
|
<aCover>0</aCover>
|
||||||
|
<aSer1>0</aSer1>
|
||||||
|
<aSer2>0</aSer2>
|
||||||
|
<aPa>0</aPa>
|
||||||
|
<viewmode>1</viewmode>
|
||||||
|
<vrSel>0</vrSel>
|
||||||
|
<aSym>0</aSym>
|
||||||
|
<aTbox>0</aTbox>
|
||||||
|
<AscS1>0</AscS1>
|
||||||
|
<AscS2>0</AscS2>
|
||||||
|
<AscS3>0</AscS3>
|
||||||
|
<aSer3>0</aSer3>
|
||||||
|
<eProf>0</eProf>
|
||||||
|
<aLa>0</aLa>
|
||||||
|
<aPa1>0</aPa1>
|
||||||
|
<AscS4>0</AscS4>
|
||||||
|
<aSer4>0</aSer4>
|
||||||
|
<StkLoc>1</StkLoc>
|
||||||
|
<TrcWin>0</TrcWin>
|
||||||
|
<newCpu>0</newCpu>
|
||||||
|
<uProt>0</uProt>
|
||||||
|
</DebugFlag>
|
||||||
|
<LintExecutable></LintExecutable>
|
||||||
|
<LintConfigFile></LintConfigFile>
|
||||||
|
<bLintAuto>0</bLintAuto>
|
||||||
|
<bAutoGenD>0</bAutoGenD>
|
||||||
|
<LntExFlags>0</LntExFlags>
|
||||||
|
<pMisraName></pMisraName>
|
||||||
|
<pszMrule></pszMrule>
|
||||||
|
<pSingCmds></pSingCmds>
|
||||||
|
<pMultCmds></pMultCmds>
|
||||||
|
<pMisraNamep></pMisraNamep>
|
||||||
|
<pszMrulep></pszMrulep>
|
||||||
|
<pSingCmdsp></pSingCmdsp>
|
||||||
|
<pMultCmdsp></pMultCmdsp>
|
||||||
|
<DebugDescription>
|
||||||
|
<Enable>1</Enable>
|
||||||
|
<EnableFlashSeq>1</EnableFlashSeq>
|
||||||
|
<EnableLog>0</EnableLog>
|
||||||
|
<Protocol>2</Protocol>
|
||||||
|
<DbgClock>10000000</DbgClock>
|
||||||
|
</DebugDescription>
|
||||||
|
</TargetOption>
|
||||||
|
</Target>
|
||||||
|
|
||||||
<Target>
|
<Target>
|
||||||
<TargetName>app</TargetName>
|
<TargetName>app</TargetName>
|
||||||
<ToolsetNumber>0x4</ToolsetNumber>
|
<ToolsetNumber>0x4</ToolsetNumber>
|
||||||
@@ -246,7 +470,7 @@
|
|||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target>
|
<Target>
|
||||||
<TargetName>boot</TargetName>
|
<TargetName>app_debug</TargetName>
|
||||||
<ToolsetNumber>0x4</ToolsetNumber>
|
<ToolsetNumber>0x4</ToolsetNumber>
|
||||||
<ToolsetName>ARM-ADS</ToolsetName>
|
<ToolsetName>ARM-ADS</ToolsetName>
|
||||||
<TargetOption>
|
<TargetOption>
|
||||||
@@ -341,11 +565,6 @@
|
|||||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||||
</DebugOpt>
|
</DebugOpt>
|
||||||
<TargetDriverDllRegistry>
|
<TargetDriverDllRegistry>
|
||||||
<SetRegEntry>
|
|
||||||
<Number>0</Number>
|
|
||||||
<Key>DLGUARM</Key>
|
|
||||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
|
||||||
</SetRegEntry>
|
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||||
@@ -354,13 +573,18 @@
|
|||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>UL2CM3</Key>
|
<Key>UL2CM3</Key>
|
||||||
<Name>UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0GD32F30x_HD -FL040000 -FS08000000 -FP0($$Device:GD32F303RC$Flash\GD32F30x_HD.FLM)</Name>
|
<Name>UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0STM32F10x_512 -FL080000 -FS08000000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>JL2CM3</Key>
|
<Key>JL2CM3</Key>
|
||||||
<Name>-U69655983 -O78 -S5 -ZTIFSpeedSel1000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
<Name>-U69655983 -O78 -S5 -ZTIFSpeedSel1000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>DLGUARM</Key>
|
||||||
|
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||||
|
</SetRegEntry>
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>ARMRTXEVENTFLAGS</Key>
|
<Key>ARMRTXEVENTFLAGS</Key>
|
||||||
@@ -369,7 +593,7 @@
|
|||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>DLGTARM</Key>
|
<Key>DLGTARM</Key>
|
||||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=1165,218,1505,941,0)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
@@ -382,22 +606,22 @@
|
|||||||
<Ww>
|
<Ww>
|
||||||
<count>0</count>
|
<count>0</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>m_used</ItemText>
|
<ItemText>g_tempptr</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
</WatchWindow1>
|
</WatchWindow1>
|
||||||
<MemoryWindow1>
|
<MemoryWindow1>
|
||||||
<Mm>
|
<Mm>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<SubType>0</SubType>
|
<SubType>8</SubType>
|
||||||
<ItemText>0x08004000</ItemText>
|
<ItemText>0x0801d000</ItemText>
|
||||||
<AccSizeX>0</AccSizeX>
|
<AccSizeX>0</AccSizeX>
|
||||||
</Mm>
|
</Mm>
|
||||||
</MemoryWindow1>
|
</MemoryWindow1>
|
||||||
<MemoryWindow2>
|
<MemoryWindow2>
|
||||||
<Mm>
|
<Mm>
|
||||||
<WinNumber>2</WinNumber>
|
<WinNumber>2</WinNumber>
|
||||||
<SubType>1</SubType>
|
<SubType>0</SubType>
|
||||||
<ItemText>m</ItemText>
|
<ItemText>0x0803B000</ItemText>
|
||||||
<AccSizeX>0</AccSizeX>
|
<AccSizeX>0</AccSizeX>
|
||||||
</Mm>
|
</Mm>
|
||||||
</MemoryWindow2>
|
</MemoryWindow2>
|
||||||
@@ -943,7 +1167,7 @@
|
|||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>elec_det</GroupName>
|
<GroupName>elec_det</GroupName>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
@@ -1271,7 +1495,7 @@
|
|||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>rt_thread</GroupName>
|
<GroupName>rt_thread</GroupName>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
@@ -1507,7 +1731,7 @@
|
|||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>soft</GroupName>
|
<GroupName>soft</GroupName>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
@@ -1602,18 +1826,6 @@
|
|||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>.\source\soft\cJSON.c</PathWithFileName>
|
|
||||||
<FilenameWithoutPath>cJSON.c</FilenameWithoutPath>
|
|
||||||
<RteFlg>0</RteFlg>
|
|
||||||
<bShared>0</bShared>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<GroupNumber>9</GroupNumber>
|
|
||||||
<FileNumber>90</FileNumber>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<tvExp>0</tvExp>
|
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
|
||||||
<bDave2>0</bDave2>
|
|
||||||
<PathWithFileName>.\source\soft\debug.c</PathWithFileName>
|
<PathWithFileName>.\source\soft\debug.c</PathWithFileName>
|
||||||
<FilenameWithoutPath>debug.c</FilenameWithoutPath>
|
<FilenameWithoutPath>debug.c</FilenameWithoutPath>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
@@ -1621,7 +1833,7 @@
|
|||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>9</GroupNumber>
|
<GroupNumber>9</GroupNumber>
|
||||||
<FileNumber>91</FileNumber>
|
<FileNumber>90</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
@@ -1633,7 +1845,7 @@
|
|||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>9</GroupNumber>
|
<GroupNumber>9</GroupNumber>
|
||||||
<FileNumber>92</FileNumber>
|
<FileNumber>91</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
@@ -1643,11 +1855,23 @@
|
|||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>9</GroupNumber>
|
||||||
|
<FileNumber>92</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>.\source\soft\cJSON.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>cJSON.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>task</GroupName>
|
<GroupName>task</GroupName>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
@@ -1715,7 +1939,7 @@
|
|||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>codec</GroupName>
|
<GroupName>codec</GroupName>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -207,5 +207,6 @@
|
|||||||
2023.10.12
|
2023.10.12
|
||||||
移植Test命令,验证成功
|
移植Test命令,验证成功
|
||||||
EJ EX 写工厂信息验证成功
|
EJ EX 写工厂信息验证成功
|
||||||
|
2023.10.12
|
||||||
|
添加 app_debug 分类 ,app 分类禁用调试,程序压缩到100k以下
|
||||||
|
app启动时如果boot魔数校验错误则自动升级bootloader
|
||||||
|
@@ -195,7 +195,7 @@ array_def *protu_encode2(protu_def *p,array_def *data)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
protuc_codec_export(ym_coder,protu_decode2,protu_encode2);
|
//protuc_codec_export(ym_coder,protu_decode2,protu_encode2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ typedef struct{
|
|||||||
uint32_t reboot_curr;// 最后一次复位标志
|
uint32_t reboot_curr;// 最后一次复位标志
|
||||||
void (*wdog_refresh)(void);// 刷新看门口
|
void (*wdog_refresh)(void);// 刷新看门口
|
||||||
uint32_t reboot_times;// 软件重启次数
|
uint32_t reboot_times;// 软件重启次数
|
||||||
|
uint32_t boot_magic_number;// app校验boot是否为指定版本
|
||||||
}back_def;
|
}back_def;
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ void bk_init(void)
|
|||||||
g_back->reboot_curr=g_back->reboot_type;
|
g_back->reboot_curr=g_back->reboot_type;
|
||||||
g_back->reboot_type=REBOOT_INIT;
|
g_back->reboot_type=REBOOT_INIT;
|
||||||
g_back->wdog_refresh=0;
|
g_back->wdog_refresh=0;
|
||||||
|
g_back->boot_magic_number=BOOT_MAGIC_NUM;
|
||||||
// 每软件重启一次就增加计数
|
// 每软件重启一次就增加计数
|
||||||
if(bk_soft_reboot())
|
if(bk_soft_reboot())
|
||||||
{
|
{
|
||||||
@@ -146,4 +147,13 @@ void *bk_wdog_fun(void)
|
|||||||
return g_back->wdog_refresh;
|
return g_back->wdog_refresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验魔数,不对返回1
|
||||||
|
int bk_check_magic_num(void)
|
||||||
|
{
|
||||||
|
if(g_back->boot_magic_number!=BOOT_MAGIC_NUM){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -14,6 +14,10 @@
|
|||||||
#define REBOOT_INIT 0xffff
|
#define REBOOT_INIT 0xffff
|
||||||
|
|
||||||
|
|
||||||
|
// 定义boot魔数
|
||||||
|
#define BOOT_MAGIC_NUM ((uint32_t)(('b')<<0)|(('o')<<8)|(('o')<<16)|(('t')<<24))
|
||||||
|
|
||||||
|
|
||||||
void bk_reboot_app(void);
|
void bk_reboot_app(void);
|
||||||
void bk_reboot_boot(void);
|
void bk_reboot_boot(void);
|
||||||
void bk_reboot_updata(void);
|
void bk_reboot_updata(void);
|
||||||
@@ -26,6 +30,7 @@ const char *bk_get_currtype(void);
|
|||||||
void bk_set_wdog_fun(void (*fun)(void));
|
void bk_set_wdog_fun(void (*fun)(void));
|
||||||
void *bk_wdog_fun(void);
|
void *bk_wdog_fun(void);
|
||||||
uint32_t bk_reboot_times(void);
|
uint32_t bk_reboot_times(void);
|
||||||
|
int bk_check_magic_num(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -33,6 +33,8 @@ scheme 109~110
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
#define FLASH_SECTOR_SIZE 2048
|
#define FLASH_SECTOR_SIZE 2048
|
||||||
|
#define FLASH_BOOT_SECTOR (0)
|
||||||
|
#define FLASH_BOOT_SECTOR_NUM (8)
|
||||||
#define FLASH_APP_SECTOR (8)
|
#define FLASH_APP_SECTOR (8)
|
||||||
#define FLASH_APP_SECTOR_NUM (50)
|
#define FLASH_APP_SECTOR_NUM (50)
|
||||||
#define FLASH_BUFF_SECTOR (58)
|
#define FLASH_BUFF_SECTOR (58)
|
||||||
@@ -145,7 +147,16 @@ int flash_operate_end(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// boot区
|
||||||
|
int flash_erase_boot(void)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
for(int i=0;i<FLASH_BOOT_SECTOR_NUM;i++){
|
||||||
|
ret=flash_erase(FLASH_BOOT_SECTOR+i);
|
||||||
|
if(ret!=0) return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// 参数区2K
|
// 参数区2K
|
||||||
int flash_erase_param(void)
|
int flash_erase_param(void)
|
||||||
@@ -340,6 +351,12 @@ int flash_updata_app(uint8_t *rom,uint32_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int flash_updata_boot(uint8_t *rom,uint32_t size)
|
||||||
|
{
|
||||||
|
uint8_t *dst=(uint8_t *)0x08000000;
|
||||||
|
flash_erase_boot();
|
||||||
|
return flash_write(dst,rom,size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 保存参数
|
// 保存参数
|
||||||
|
@@ -59,6 +59,7 @@ typedef struct{
|
|||||||
uint8_t *flash_get_rom(rom_head **head);
|
uint8_t *flash_get_rom(rom_head **head);
|
||||||
|
|
||||||
int flash_updata_app(uint8_t *rom,uint32_t size);
|
int flash_updata_app(uint8_t *rom,uint32_t size);
|
||||||
|
int flash_updata_boot(uint8_t *rom,uint32_t size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -41,6 +41,10 @@
|
|||||||
commend_export(cmd_,__msh_##fun_,#desc);
|
commend_export(cmd_,__msh_##fun_,#desc);
|
||||||
|
|
||||||
|
|
||||||
|
#define ConsoleRxDisable()
|
||||||
|
|
||||||
|
#define ConsoleRxEnable()
|
||||||
|
|
||||||
int ConsoleUsart_send_bytes(uint8_t *d,int len);
|
int ConsoleUsart_send_bytes(uint8_t *d,int len);
|
||||||
|
|
||||||
int SaveBoardInfo(void);
|
int SaveBoardInfo(void);
|
||||||
|
@@ -178,7 +178,7 @@ typedef struct{
|
|||||||
uint8_t *rx_buff;
|
uint8_t *rx_buff;
|
||||||
uint32_t rx_buff_size;
|
uint32_t rx_buff_size;
|
||||||
void *sem;
|
void *sem;
|
||||||
int in_send;
|
volatile int in_send;
|
||||||
}self_data;
|
}self_data;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define BUILD_DATE "2023-10-12 18:40:51"
|
#define BUILD_DATE "2023-10-12 23:23:27"
|
||||||
#define SOFT_VERSION "0.03"
|
#define SOFT_VERSION "0.03"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -22,14 +22,26 @@
|
|||||||
#include "elec_det.h"
|
#include "elec_det.h"
|
||||||
|
|
||||||
|
|
||||||
|
// 升级bootloader
|
||||||
|
static void boot_updata(void)
|
||||||
|
{
|
||||||
|
const uint8_t ALIGN(4) bootcode[]={
|
||||||
|
#include "bootcode.txt"
|
||||||
|
};
|
||||||
|
if(sizeof(bootcode)==0)
|
||||||
|
return;
|
||||||
|
if(bk_check_magic_num())
|
||||||
|
{
|
||||||
|
flash_updata_boot((uint8_t *)bootcode,sizeof(bootcode));
|
||||||
|
bk_reboot_app();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
const sys_param_def *par=sys_param();
|
boot_updata();
|
||||||
debug_init();
|
debug_init();
|
||||||
elec_init();
|
elec_init();
|
||||||
app_init();
|
app_init();
|
||||||
@@ -45,12 +57,7 @@ int main()
|
|||||||
|
|
||||||
connect(protu2,protu_recv_signal,0,cmd,cmd_recv_slot);
|
connect(protu2,protu_recv_signal,0,cmd,cmd_recv_slot);
|
||||||
connect(cmd,cmd_reply_signal,0,protu2,protu_send_call);
|
connect(cmd,cmd_reply_signal,0,protu2,protu_send_call);
|
||||||
|
|
||||||
// DBG_LOG("询预压");
|
|
||||||
// DBG_LOG("我知道");
|
|
||||||
//--diag_suppress=550,177
|
|
||||||
|
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
elec_led2_power(1);
|
elec_led2_power(1);
|
||||||
@@ -87,7 +94,7 @@ static int test(list_def *argv)
|
|||||||
cmd_print("test num=%d,hex=%x",num,num);
|
cmd_print("test num=%d,hex=%x",num,num);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
commend_export(test,test,"cmd test")
|
//commend_export(test,test,"cmd test")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -270,7 +277,7 @@ static int sys_set(list_def *argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
commend_export(set,sys_set,"set the system params")
|
//commend_export(set,sys_set,"set the system params")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import datetime
|
import datetime
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
import mycopy
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@ SOFT_VERION = "0.03"
|
|||||||
MOD_FILE="mod_signals.c"
|
MOD_FILE="mod_signals.c"
|
||||||
MOD_PATH="./source/task/"
|
MOD_PATH="./source/task/"
|
||||||
INFO_FILE="./source/main/compiler_info.h"
|
INFO_FILE="./source/main/compiler_info.h"
|
||||||
|
BOOTCODE_ARRAY="./source/main/bootcode.txt"
|
||||||
|
|
||||||
|
|
||||||
# 找到文件夹中指定后缀的文件
|
# 找到文件夹中指定后缀的文件
|
||||||
@@ -137,9 +138,31 @@ def creat_compile_info(dst:str):
|
|||||||
f.write("\n\n\n\n\n\n\n#endif\n")
|
f.write("\n\n\n\n\n\n\n#endif\n")
|
||||||
|
|
||||||
|
|
||||||
|
# 生成bootcode数组
|
||||||
|
def creat_bootcode(dst:str):
|
||||||
|
if os.path.exists(dst):
|
||||||
|
os.remove(dst)
|
||||||
|
data=bytearray()
|
||||||
|
boot_file=mycopy.BOOT_FILE_SRC+".bin"
|
||||||
|
if(os.path.exists(boot_file)):
|
||||||
|
with open(boot_file,"rb") as f:
|
||||||
|
data=f.read()
|
||||||
|
with open(dst,"w") as f:
|
||||||
|
while len(data)>0:
|
||||||
|
if(len(data)>=20):
|
||||||
|
t=data[0:20]
|
||||||
|
data=data[20:]
|
||||||
|
else:
|
||||||
|
t=data
|
||||||
|
data=[]
|
||||||
|
s=t.hex(" ")
|
||||||
|
s="0x"+s.replace(" ",",0x")+",\n"
|
||||||
|
f.write(s)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
creat_bootcode(BOOTCODE_ARRAY)
|
||||||
creat_compile_info(INFO_FILE)
|
creat_compile_info(INFO_FILE)
|
||||||
mod_file_creat(MOD_PATH+MOD_FILE)
|
mod_file_creat(MOD_PATH+MOD_FILE)
|
||||||
print("prepare success.\n")
|
print("prepare success.\n")
|
||||||
|
@@ -175,12 +175,17 @@ void param_err_handle(const char *param,const char *file,const char *fun,int lin
|
|||||||
|
|
||||||
void cpy4byte(uint32_t *dst,uint32_t *src,int num_4byte);
|
void cpy4byte(uint32_t *dst,uint32_t *src,int num_4byte);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
// 如果s==0,则打印
|
// 如果s==0,则打印
|
||||||
#define param_check(s) \
|
#define param_check(s) \
|
||||||
if((s)==0){\
|
if((s)==0){\
|
||||||
param_err_handle(#s,__FILE__,__func__,__LINE__);}
|
param_err_handle(#s,__FILE__,__func__,__LINE__);}
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define param_check(s)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef RT_THREAD
|
#ifdef RT_THREAD
|
||||||
|
|
||||||
|
@@ -134,18 +134,18 @@
|
|||||||
// <h>Console Configuration
|
// <h>Console Configuration
|
||||||
// <c1>Using console
|
// <c1>Using console
|
||||||
// <i>Using console
|
// <i>Using console
|
||||||
#define RT_USING_CONSOLE
|
//#define RT_USING_CONSOLE
|
||||||
// </c>
|
// </c>
|
||||||
|
|
||||||
// <o>the buffer size of console <1-1024>
|
// <o>the buffer size of console <1-1024>
|
||||||
// <i>the buffer size of console
|
// <i>the buffer size of console
|
||||||
// <i>Default: 128 (128Byte)
|
// <i>Default: 128 (128Byte)
|
||||||
#define RT_CONSOLEBUF_SIZE 128
|
//#define RT_CONSOLEBUF_SIZE 128
|
||||||
|
|
||||||
// <s>The device name for console
|
// <s>The device name for console
|
||||||
// <i>The device name for console
|
// <i>The device name for console
|
||||||
// <i>Default: uart2
|
// <i>Default: uart2
|
||||||
#define RT_CONSOLE_DEVICE_NAME "uart2"
|
//#define RT_CONSOLE_DEVICE_NAME "uart2"
|
||||||
// </h>
|
// </h>
|
||||||
|
|
||||||
#if defined(RTE_USING_DEVICE)
|
#if defined(RTE_USING_DEVICE)
|
||||||
@@ -202,5 +202,8 @@
|
|||||||
#define IDLE_THREAD_STACK_SIZE 1024
|
#define IDLE_THREAD_STACK_SIZE 1024
|
||||||
|
|
||||||
|
|
||||||
|
#define RT_USING_CPU_FFS
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
int inited;
|
int inited;
|
||||||
@@ -95,7 +95,7 @@ void debug_log(const char *file,const char *fun,int line,int level,const char *f
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,8 +9,11 @@
|
|||||||
|
|
||||||
|
|
||||||
/*r{ 修改日志打印等级 }c*/
|
/*r{ 修改日志打印等级 }c*/
|
||||||
|
#ifdef DEBUG
|
||||||
#define DBG_LOG_LEVEL 0
|
#define DBG_LOG_LEVEL 0
|
||||||
|
#else
|
||||||
|
#define DBG_LOG_LEVEL 4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*r{ 定义打印数据等级 }c*/
|
/*r{ 定义打印数据等级 }c*/
|
||||||
@@ -51,9 +54,17 @@
|
|||||||
//#define DBG_LOG_(type_,msg_,...)\
|
//#define DBG_LOG_(type_,msg_,...)\
|
||||||
// debug_log("-","-",__LINE__,type_,(msg_),##__VA_ARGS__)
|
// debug_log("-","-",__LINE__,type_,(msg_),##__VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
|
||||||
int debug_init(void);
|
int debug_init(void);
|
||||||
|
|
||||||
void debug_log(const char *file,const char *fun,int line,int level,const char *fmt, ...);
|
void debug_log(const char *file,const char *fun,int line,int level,const char *fmt, ...);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define debug_init()
|
||||||
|
#define debug_log(...)
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user