uart для платы вэп + структурирован чуть проект и описан бутлоадер

Но надо еще его дорабатывать

+ заготовка для протокола приема (не работает скорее всего, просто из чатгпт вставил)
This commit is contained in:
2025-09-19 13:32:45 +03:00
parent 0e834dfe3d
commit c61c438b8c
12 changed files with 372 additions and 290 deletions

View File

@@ -0,0 +1,16 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x0800C000 0x00040000 { ; load region size_region
ER_IROM1 0x0800C000 0x00040000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x0000C000 { ; RW data
.ANY (+RW +ZI)
}
}

View File

@@ -28,7 +28,7 @@
<TargetOption>
<CLKADS>8000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<gFlags>0</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
@@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>4</nTsel>
<nTsel>0</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@@ -114,34 +114,9 @@
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>Segger\JL2CM3.dll</pMon>
<pMon>BIN\UL2CM3.DLL</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<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>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
<Name>-U11111118 -O14 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477) -L00(4) -N01("Unknown JTAG device") -D01(06414041) -L01(5) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
@@ -149,81 +124,18 @@
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>input</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>Inputs</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>1</WinNumber>
<ItemText>duty_cycle,0x0A</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>1</WinNumber>
<ItemText>frequency,0x0A</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>uwTick,0x0A</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>modbus</ItemText>
</Ww>
<Ww>
<count>6</count>
<WinNumber>1</WinNumber>
<ItemText>msgData[0]</ItemText>
</Ww>
<Ww>
<count>7</count>
<WinNumber>1</WinNumber>
<ItemText>CMD_GOTOBOOT</ItemText>
</Ww>
<Ww>
<count>8</count>
<WinNumber>1</WinNumber>
<ItemText>hcan</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>0</SubType>
<ItemText>0x0800c000</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<MemoryWindow2>
<Mm>
<WinNumber>2</WinNumber>
<SubType>0</SubType>
<ItemText>0x08009800</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow2>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>1</periodic>
<aLwin>1</aLwin>
<periodic>0</periodic>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
<viewmode>1</viewmode>
<viewmode>0</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
@@ -254,27 +166,9 @@
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<SystemViewers>
<Entry>
<Name>System Viewer\BKP</Name>
<WinId>35902</WinId>
</Entry>
<Entry>
<Name>System Viewer\CAN</Name>
<WinId>35904</WinId>
</Entry>
<Entry>
<Name>System Viewer\GPIOB</Name>
<WinId>35905</WinId>
</Entry>
<Entry>
<Name>System Viewer\IWDG</Name>
<WinId>35903</WinId>
</Entry>
</SystemViewers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
<EnableFlashSeq>1</EnableFlashSeq>
<EnableLog>0</EnableLog>
<Protocol>2</Protocol>
<DbgClock>10000000</DbgClock>
@@ -386,7 +280,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1605,104,-1155,661,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=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@@ -413,70 +307,25 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>1300</LineNumber>
<LineNumber>368</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134222082</Address>
<Address>134230816</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c</Filename>
<Filename>..\Core\Bootloader\Src\bootloader.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\bootloader\../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c\1300</Expression>
<Expression>\\bootloader\../Core/Bootloader/Src/bootloader.c\368</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>boot,0x10</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>Inputs</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>1</WinNumber>
<ItemText>duty_cycle,0x0A</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>1</WinNumber>
<ItemText>frequency,0x0A</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>uwTick,0x0A</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>GoToApp</ItemText>
</Ww>
<Ww>
<count>6</count>
<WinNumber>1</WinNumber>
<ItemText>app_jump_adr</ItemText>
</Ww>
<Ww>
<count>7</count>
<WinNumber>1</WinNumber>
<ItemText>TXDataBoot</ItemText>
</Ww>
<Ww>
<count>8</count>
<WinNumber>1</WinNumber>
<ItemText>\\bootloader\../Core/Bootloader/boot_main.c\boot.error.bit.unknown_cmd</ItemText>
</Ww>
<Ww>
<count>9</count>
<WinNumber>1</WinNumber>
<ItemText>\\bootloader\../Core/Bootloader/boot_main.c\boot.error.bit.write_err</ItemText>
<ItemText>boot</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
@@ -537,15 +386,9 @@
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<SystemViewers>
<Entry>
<Name>System Viewer\GPIOB</Name>
<WinId>35905</WinId>
</Entry>
</SystemViewers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
<EnableFlashSeq>1</EnableFlashSeq>
<EnableLog>0</EnableLog>
<Protocol>2</Protocol>
<DbgClock>10000000</DbgClock>
@@ -555,7 +398,7 @@
<Group>
<GroupName>Application/MDK-ARM</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -575,7 +418,7 @@
<Group>
<GroupName>Application/User/Core</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -982,8 +825,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Bootloader\Src\bootloader.c</PathWithFileName>
<FilenameWithoutPath>bootloader.c</FilenameWithoutPath>
<PathWithFileName>..\Core\Bootloader\Src\boot_main.c</PathWithFileName>
<FilenameWithoutPath>boot_main.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -994,8 +837,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Bootloader\Src\boot_main.c</PathWithFileName>
<FilenameWithoutPath>boot_main.c</FilenameWithoutPath>
<PathWithFileName>..\Core\Bootloader\Src\bootloader.c</PathWithFileName>
<FilenameWithoutPath>bootloader.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -1006,6 +849,18 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Bootloader\Src\boot_uart.c</PathWithFileName>
<FilenameWithoutPath>boot_uart.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Bootloader\Src\boot_can.c</PathWithFileName>
<FilenameWithoutPath>boot_can.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
@@ -1013,7 +868,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>36</FileNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1025,7 +880,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>37</FileNumber>
<FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1037,7 +892,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>38</FileNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1047,18 +902,6 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Bootloader\Src\boot_uart.c</PathWithFileName>
<FilenameWithoutPath>boot_uart.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>

View File

@@ -667,11 +667,6 @@
<FileType>5</FileType>
<FilePath>..\Core\Bootloader\Inc\boot_project_setup.h</FilePath>
</File>
<File>
<FileName>bootloader.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\bootloader.c</FilePath>
</File>
<File>
<FileName>boot_main.c</FileName>
<FileType>1</FileType>
@@ -728,6 +723,16 @@
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>bootloader.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\bootloader.c</FilePath>
</File>
<File>
<FileName>boot_uart.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\boot_uart.c</FilePath>
</File>
<File>
<FileName>boot_can.c</FileName>
<FileType>1</FileType>
@@ -799,11 +804,6 @@
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>boot_uart.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\boot_uart.c</FilePath>
</File>
</Files>
</Group>
<Group>
@@ -854,13 +854,13 @@
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\</OutputDirectory>
<OutputDirectory>.\bootloader\</OutputDirectory>
<OutputName>bootloader</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<BrowseInformation>0</BrowseInformation>
<ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
@@ -1490,15 +1490,20 @@
<FileType>5</FileType>
<FilePath>..\Core\Bootloader\Inc\boot_project_setup.h</FilePath>
</File>
<File>
<FileName>boot_main.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\boot_main.c</FilePath>
</File>
<File>
<FileName>bootloader.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\bootloader.c</FilePath>
</File>
<File>
<FileName>boot_main.c</FileName>
<FileName>boot_uart.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\boot_main.c</FilePath>
<FilePath>..\Core\Bootloader\Src\boot_uart.c</FilePath>
</File>
<File>
<FileName>boot_can.c</FileName>
@@ -1520,11 +1525,6 @@
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\boot_jump.c</FilePath>
</File>
<File>
<FileName>boot_uart.c</FileName>
<FileType>1</FileType>
<FilePath>..\Core\Bootloader\Src\boot_uart.c</FilePath>
</File>
</Files>
</Group>
<Group>