Skip to content

Commit

Permalink
Boards mtb4 and mtb4c: added SWO debug capabilities + multisda source…
Browse files Browse the repository at this point in the history
… files are now shared (#505)

Co-authored-by: marco.accame <[email protected]>
  • Loading branch information
simeonedussoni and marcoaccame authored Aug 5, 2024
1 parent ec8ab04 commit 67ad11e
Show file tree
Hide file tree
Showing 22 changed files with 300 additions and 3,524 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


FUNC void DebugSetup (void) {
_WDWORD(0x40023830, _RDWORD(0x40023830) | 0x00000010); // RCC_AHB1ENR: IO port E clock enable
_WDWORD(0x40021000, 0x00002AA0); // GPIOE_MODER: PE2..PE6 = Alternate function mode
_WDWORD(0x40021008, 0x00003FF0); // GPIOE_OSPEEDR: PE2..PE6 = 100 MHz speed
_WDWORD(0x4002100C, 0x00000000); // GPIOE_PUPDR: PE2..PE6 = No Pull-up/Pull-down
_WDWORD(0x40021020, 0x00000000); // GPIOE_AFRL: PE2..PE6 = AF0
// _WDWORD(0x40023830, _RDWORD(0x40023830) | 0x00000010); // RCC_AHB1ENR: IO port E clock enable
// _WDWORD(0x40021000, 0x00002AA0); // GPIOE_MODER: PE2..PE6 = Alternate function mode
// _WDWORD(0x40021008, 0x00003FF0); // GPIOE_OSPEEDR: PE2..PE6 = 100 MHz speed
// _WDWORD(0x4002100C, 0x00000000); // GPIOE_PUPDR: PE2..PE6 = No Pull-up/Pull-down
// _WDWORD(0x40021020, 0x00000000); // GPIOE_AFRL: PE2..PE6 = AF0

// <h> Debug MCU Configuration
// <o1.0> DBG_SLEEP <i> Debug Sleep Mode
Expand All @@ -29,37 +29,37 @@ FUNC void DebugSetup (void) {
// <2=> Synchronous: TRACEDATA Size 2
// <3=> Synchronous: TRACEDATA Size 4
// </h>
_WDWORD(0xE0042004, 0x00000027); // DBGMCU_CR
// _WDWORD(0xE0042004, 0x00000027); // DBGMCU_CR

// <h> Debug MCU APB1 Freeze
// <o1.0> DBG_TIM2_STOP <i> Timer 2 Stopped when Core is halted
// <o1.1> DBG_TIM3_STOP <i> Timer 3 Stopped when Core is halted
// <o1.2> DBG_TIM4_STOP <i> Timer 4 Stopped when Core is halted
// <o1.3> DBG_TIM5_STOP <i> Timer 5 Stopped when Core is halted
// <o1.4> DBG_TIM6_STOP <i> Timer 6 Stopped when Core is halted
// <o1.5> DBG_TIM7_STOP <i> Timer 7 Stopped when Core is halted
// <o1.6> DBG_TIM12_STOP <i> Timer 12 Stopped when Core is halted
// <o1.7> DBG_TIM13_STOP <i> Timer 13 Stopped when Core is halted
// <o1.8> DBG_TIM14_STOP <i> Timer 14 Stopped when Core is halted
// <o1.10> DBG_RTC_STOP <i> RTC Stopped when Core is halted
// <o1.11> DBG_WWDG_STOP <i> Window Watchdog Stopped when Core is halted
// <o1.12> DBG_IWDG_STOP <i> Independent Watchdog Stopped when Core is halted
// <o1.21> DBG_I2C1_SMBUS_TIMEOUT <i> I2C1 SMBUS Timeout Mode Stopped when Core is halted
// <o1.22> DBG_I2C2_SMBUS_TIMEOUT <i> I2C2 SMBUS Timeout Mode Stopped when Core is halted
// <o1.23> DBG_I2C3_SMBUS_TIMEOUT <i> I2C3 SMBUS Timeout Mode Stopped when Core is halted
// <o1.25> DBG_CAN1_STOP <i> CAN1 Stopped when Core is halted
// <o1.26> DBG_CAN2_STOP <i> CAN2 Stopped when Core is halted
// </h>
_WDWORD(0xE0042008, 0x06E01DFF); // DBGMCU_APB1_FZ
//// <h> Debug MCU APB1 Freeze
//// <o1.0> DBG_TIM2_STOP <i> Timer 2 Stopped when Core is halted
//// <o1.1> DBG_TIM3_STOP <i> Timer 3 Stopped when Core is halted
//// <o1.2> DBG_TIM4_STOP <i> Timer 4 Stopped when Core is halted
//// <o1.3> DBG_TIM5_STOP <i> Timer 5 Stopped when Core is halted
//// <o1.4> DBG_TIM6_STOP <i> Timer 6 Stopped when Core is halted
//// <o1.5> DBG_TIM7_STOP <i> Timer 7 Stopped when Core is halted
//// <o1.6> DBG_TIM12_STOP <i> Timer 12 Stopped when Core is halted
//// <o1.7> DBG_TIM13_STOP <i> Timer 13 Stopped when Core is halted
//// <o1.8> DBG_TIM14_STOP <i> Timer 14 Stopped when Core is halted
//// <o1.10> DBG_RTC_STOP <i> RTC Stopped when Core is halted
//// <o1.11> DBG_WWDG_STOP <i> Window Watchdog Stopped when Core is halted
//// <o1.12> DBG_IWDG_STOP <i> Independent Watchdog Stopped when Core is halted
//// <o1.21> DBG_I2C1_SMBUS_TIMEOUT <i> I2C1 SMBUS Timeout Mode Stopped when Core is halted
//// <o1.22> DBG_I2C2_SMBUS_TIMEOUT <i> I2C2 SMBUS Timeout Mode Stopped when Core is halted
//// <o1.23> DBG_I2C3_SMBUS_TIMEOUT <i> I2C3 SMBUS Timeout Mode Stopped when Core is halted
//// <o1.25> DBG_CAN1_STOP <i> CAN1 Stopped when Core is halted
//// <o1.26> DBG_CAN2_STOP <i> CAN2 Stopped when Core is halted
//// </h>
// _WDWORD(0xE0042008, 0x06E01DFF); // DBGMCU_APB1_FZ

// <h> Debug MCU APB2 Freeze
// <o1.0> DBG_TIM1_STOP <i> Timer 1 Stopped when Core is halted
// <o1.1> DBG_TIM8_STOP <i> Timer 8 Stopped when Core is halted
// <o1.16> DBG_TIM9_STOP <i> Timer 9 Stopped when Core is halted
// <o1.17> DBG_TIM10_STOP <i> Timer 10 Stopped when Core is halted
// <o1.18> DBG_TIM11_STOP <i> Timer 11 Stopped when Core is halted
// </h>
_WDWORD(0xE004200C, 0x00070003); // DBGMCU_APB2_FZ
//// <h> Debug MCU APB2 Freeze
//// <o1.0> DBG_TIM1_STOP <i> Timer 1 Stopped when Core is halted
//// <o1.1> DBG_TIM8_STOP <i> Timer 8 Stopped when Core is halted
//// <o1.16> DBG_TIM9_STOP <i> Timer 9 Stopped when Core is halted
//// <o1.17> DBG_TIM10_STOP <i> Timer 10 Stopped when Core is halted
//// <o1.18> DBG_TIM11_STOP <i> Timer 11 Stopped when Core is halted
//// </h>
// _WDWORD(0xE004200C, 0x00070003); // DBGMCU_APB2_FZ

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,17 +410,17 @@
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0STM32L4xx_256 -FL040000 -FS08000000 -FP0($$Device:STM32L433RCTx$CMSIS\Flash\STM32L4xx_256.FLM)</Name>
<Name>-UAny -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65555 -TC40000000 -TT10000000 -TP21 -TDS801F -TDT0 -TDC1F -TIE80000001 -TIP9 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L433RCTx$CMSIS\Flash\STM32L4xx_256.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ULP2CM3</Key>
<Name>-UAny -O206 -S8 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP18 -TDX0 -TDD0 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L433RCTx$CMSIS\Flash\STM32L4xx_256.FLM)</Name>
<Name>-UP1123153 -O206 -S8 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO98323 -TC40000000 -TT10000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE80000001 -TIP9 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L433RCTx$CMSIS\Flash\STM32L4xx_256.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
<Name>-L200 -Z18 -C0 -M1 -T1</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
Expand All @@ -442,50 +442,34 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>212</LineNumber>
<LineNumber>263</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134402072</Address>
<Address>134422882</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\..\..\..\..\..\eBcode\arch-arm\embot\app\embot_app_application_theIMU.cpp</Filename>
<Filename>..\src\others\AD7147.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\\../../../../../../eBcode/arch-arm/embot/app/embot_app_application_theIMU.cpp\212</Expression>
<Expression>\\mtb4_a\../src/others/AD7147.c\263</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>87</LineNumber>
<Type>2</Type>
<LineNumber>0</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<Address>536890767</Address>
<ByteObject>1</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<ManyObjects>1</ManyObjects>
<SizeOfObject>1</SizeOfObject>
<BreakByAccess>2</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\..\bsp\embot_hw_bsp_mtb4.cpp</Filename>
<Filename></Filename>
<ExecCommand></ExecCommand>
<Expression>\\mtb4_v190\../../bsp/embot_hw_bsp_mtb4.cpp\87</Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>84</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134423098</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../src/main-appcan.cpp</Filename>
<ExecCommand></ExecCommand>
<Expression>\\mtb4_v190\../src/main-appcan.cpp\84</Expression>
<Expression>0x20004D8F</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
Expand All @@ -494,6 +478,41 @@
<WinNumber>1</WinNumber>
<ItemText>SystemCoreClock/1000000,0x0A</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>the12rawvalues</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>1</WinNumber>
<ItemText>SKV,0x0A</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>1</WinNumber>
<ItemText>rawvalues5th</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>taxsel0</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>taxsel4</ItemText>
</Ww>
<Ww>
<count>6</count>
<WinNumber>1</WinNumber>
<ItemText>taxsel5</ItemText>
</Ww>
<Ww>
<count>7</count>
<WinNumber>1</WinNumber>
<ItemText>dbg</ItemText>
</Ww>
</WatchWindow1>
<WatchWindow2>
<Ww>
Expand All @@ -516,23 +535,36 @@
<WinNumber>2</WinNumber>
<ItemText>s_AD7147Registers[3]</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>2</WinNumber>
<ItemText>taxsel120</ItemText>
</Ww>
</WatchWindow2>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>0</SubType>
<ItemText>0x20003E7E</ItemText>
<ItemText>s_AD7147Registers_5th</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>
<MemoryWindow2>
<Mm>
<WinNumber>2</WinNumber>
<SubType>0</SubType>
<ItemText>the12capoffsets</ItemText>
<ItemText>ext_capoffsets5th</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow2>
<MemoryWindow3>
<Mm>
<WinNumber>3</WinNumber>
<SubType>0</SubType>
<ItemText>s_CapOffset_5th</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow3>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
Expand All @@ -552,13 +584,13 @@
<AscS2>0</AscS2>
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<eProf>1</eProf>
<aLa>1</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<TrcWin>1</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
Expand All @@ -575,6 +607,13 @@
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<LogicAnalyzers>
<Wi>
<IntNumber>0</IntNumber>
<FirstString>`SKV</FirstString>
<SecondString>FF0000000000000000000000000000000000494000000000000000000000000000000000534B5600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F1700000000000000000000000000000000000000D60A0308</SecondString>
</Wi>
</LogicAnalyzers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
Expand All @@ -587,7 +626,7 @@

<Group>
<GroupName>main</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -683,7 +722,7 @@

<Group>
<GroupName>rtos</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -715,7 +754,7 @@

<Group>
<GroupName>embot-core</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -843,7 +882,7 @@

<Group>
<GroupName>embot-app-protocol</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -1015,7 +1054,7 @@

<Group>
<GroupName>embot-application</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -1131,7 +1170,7 @@

<Group>
<GroupName>embot-hw</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -1319,7 +1358,7 @@

<Group>
<GroupName>other-hw</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -1395,7 +1434,7 @@

<Group>
<GroupName>embot::hw::bsp</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<TargetCommonOption>
<Device>STM32L433RCTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<PackID>Keil.STM32L4xx_DFP.2.7.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x0000C000) IRAM2(0x10000000,0x00004000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M4") FPU2 DSP CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
Expand Down Expand Up @@ -873,14 +873,15 @@
<TargetName>mtb4-v1D3</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6190000::V6.19::ARMCLANG</pCCUsed>
<pArmCC>6190000::V6.19::.\armclang-r6p19-00rel0</pArmCC>
<pCCUsed>6190000::V6.19::.\armclang-r6p19-00rel0</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32L433RCTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<PackID>Keil.STM32L4xx_DFP.2.7.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x0000C000) IRAM2(0x10000000,0x00004000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M4") FPU2 DSP CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
Expand Down Expand Up @@ -945,7 +946,7 @@
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>cmd.exe /C copy .\Obj\mtb4_a.hex ..\bin\mtb4.v1D3.hex</UserProg1Name>
<UserProg1Name>cmd.exe /C copy .\Obj\mtb4_a.hex ..\bin\mtb4_hand5_1.v1D3.hex</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
Expand Down
Loading

0 comments on commit 67ad11e

Please sign in to comment.