2018-08-09 03:33 AM
After implementing this video: https://www.youtube.com/watch?v=BwgPV3uKuzY we expected the printf output to work but for some reason, there is no output.
I checked the SB10 link and it is connected under the board with a 0 ohm resistor.
Any ideas or help would be much appreciated. Thanks
2018-08-09 03:49 AM
I found this link below, Not having a good day (referring to me and ST together)
Confirming here that SWV output working with NUCLEO-H743ZI
<LINK NO LONGER ACTIVE>
2018-08-09 04:03 AM
Some good info here. Hopefully closing in on the issue now, hope to have it solved before retirement.
https://community.st.com/s/question/0D50X00009XkWZQSA3/no-traceswo-output-on-stm32h7xx
Mar 16, 09:17 CET
DearXXXX
There is a known problem with the STM32H7 which we have a ticket for at the moment. We hope to have this fixed until the next release. However, we haven't had a response from the correct ST department just yet if there's a problem with the MCU itself or if we've made a faulty configuration in the software somewhere. We're going to try to reach out again for a response.
Best regards
XXXXXX, Atollic Support Team
2018-08-09 04:12 AM
And this is not inspiring either.
https://forum.atollic.com/viewtopic.php?f=3&t=1449&p=3235&hilit=stm32H7#p3235
2018-08-09 05:00 AM
Currently old forum content can be located here
<LINK NO LONGER ACTIVE>
Condensed it down to this
void SWD_Init(void)
{
*(__IO uint32_t*)(0x5C001004) |= 0x00700000; // DBGMCU_CR D3DBGCKEN D1DBGCKEN TRACECLKEN
//UNLOCK FUNNEL
*(__IO uint32_t*)(0x5C004FB0) = 0xC5ACCE55; // SWTF_LAR
*(__IO uint32_t*)(0x5C003FB0) = 0xC5ACCE55; // SWO_LAR
//SWO current output divisor register
//This divisor value (0x000000C7) corresponds to 400Mhz
//To change it, you can use the following rule
// value = (CPU Freq/sw speed )-1
*(__IO uint32_t*)(0x5C003010) = ((SystemCoreClock / 2000000) - 1); // SWO_CODR
//SWO selected pin protocol register
*(__IO uint32_t*)(0x5C0030F0) = 0x00000002; // SWO_SPPR
//Enable ITM input of SWO trace funnel
*(__IO uint32_t*)(0x5C004000) |= 0x00000001; // SWFT_CTRL
//RCC_AHB4ENR enable GPIOB clock
*(__IO uint32_t*)(0x580244E0) |= 0x00000002;
// Configure GPIOB pin 3 as AF
*(__IO uint32_t*)(0x58020400) = (*(__IO uint32_t*)(0x58020400) & 0xffffff3f) | 0x00000080;
// Configure GPIOB pin 3 Speed
*(__IO uint32_t*)(0x58020408) |= 0x00000080;
// Force AF0 for GPIOB pin 3
*(__IO uint32_t*)(0x58020420) &= 0xFFFF0FFF;
}
2018-08-09 05:17 AM
Here working in Keil via the debug script. The code from the previous post is more effective across different speeds (ie 100-500 MHz), and means you don't have to know the frequency for it to work in the ST-LINK Utilities SWV Viewer, etc.
2018-08-09 03:27 PM
Great, thanks for the link and info, Do you know if it is possible to use printf using SWV in Atollic.
2018-08-09 04:12 PM
Well I'd imagine unless they've done something incredibly brain-damaged, that a) the function would get the clocks/funnel set up right, or b) you could port the script to something workable with OpenOCD.
The serial debug window in Keil above is just the content from the SWV debug channel, I think IAR and Atollic have similar arrangements.
2018-08-09 07:13 PM
OK< thanks for the reply. Not sure what that means or what OpenOCD is.
I have downloaded Keil but cannot even get the ST-Link to work on that.
2018-08-12 10:01 PM
OK, it now works well. There were two tricks:
Without the second step, the print out appears as garbage characters (but also means something is working). Thanks for your help. Also have Keil installed now.