cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get output SWV for debugging on a STM32H723ZGTX

PadNyammo
Associate II

I do not have any output via SWV or via COM port debugging using a STM32H723ZGTX.

I am using a nucleo ST-link breakoff board to program with no issue.

I have tried solutions provided in both following threads:

https://community.st.com/t5/other-tools-mcus/no-traceswo-output-on-stm32h7xx/m-p/395490

https://community.st.com/t5/stm32-mcus/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages/ta-p/49865

Any suggestions would be much appreciated.

 

 

 

15 REPLIES 15

Dont know, what you did wrong....just: at first, its like a game . (tell it to STM...) 

But when it starts working, it works on every debug start.

Just do nothing else, than i wrote.

Try again. Suddenly it will work. (If you only (!) did what i wrote.)

 

+ if try more: have any usb/cdc avail ? 

st-link V2 has no CDC, only V2.1 or V3 has ...- right ?

If you only have V2 , try the game , click around , many times on red button, start debug, stop it, retry...

you can get more than printf :  statistics...

AScha3_0-1706738712563.png

or just - for usb testing- the messages :

AScha3_1-1706738794207.png

It CAN work - just no simple and clear rules. 

If you feel a post has answered your question, please click "Accept as Solution".

I am using the ST-link from a NUCLEUS-F401RE board which is  ST-LINK/V2-1.

I have with a fresh project using only code and async trace setting you instructed tried again following the steps of the
game, still with no luck.

"+ if try more: have any usb/cdc avail ? "

I do not understand what you mean here, I have tried a different USB cable.

How would I go about viewing the information in the first screenshot?

> have any usb/cdc avail ? 

its about :   to have a serial , cpu: uart -> serial-> USB cdc , on st-link V3 or any serial->usb converter (extra : CP2102, FT232, CH2340 etc.   serial->usb adapter) 

= extra adapter board, to get uart to usb as a "serial" connection .

https://de.aliexpress.com/item/1005005850315101.html

like this.

Then you send on both interfaces :


int __io_putchar(int ch)
{
    ITM_SendChar(ch);
    HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 0xFF);
    return (ch);
}

 

-- here on uart3 connected to serial-usb adapter .

 

 

But... should work with st-link and swv. (Try again...suddenly it will work.)

If you feel a post has answered your question, please click "Accept as Solution".
PadNyammo
Associate II

I will continue to try your game method, but does anybody else have any suggestions on what I could try?

How would I go about viewing the information in the first screenshot?

 

in debug , (paused) or waiting at breakpoint :

1. open : menu: window -> Show View -> SWV -> SWV statistical profiling

2. open the "toolbox" (configure) :

AScha3_0-1706772552032.png

+ here set PC sampling : ena.resolution -> not too fast (try: 10240 , as i choose here)

AScha3_1-1706772662650.png

(+ enable prescaler /64 ; )

(+ check: on left shows your real actual core clock speed ? If wrong, nothing will work on SWV !!! )

-> ok.

Then "play" , resume debug, let program run some seconds, then "pause" debug again --- and you get statistics for this some seconds of program runnning :

AScha3_2-1706773159706.png

<- this is just the main i showed (only printf() + hal_delay in while loop)

 + afaik this will fill up the sample buffer in the IDE (the faster/more you sample, the shorter time until overflow! );

so for longer debug session (= normal use) you have to un-check the PC_sampling , to avoid overflow .

If you feel a post has answered your question, please click "Accept as Solution".
PadNyammo
Associate II

This issue has now been resolved, it was a poor solder connection between the SWO pin and the PCB. 

This was a simple mistake that I should have caught early on.

Thanks AScha.3 for helping out.