Skip to main content
Explorer
January 30, 2024
Solved

Unable to get output SWV for debugging on a STM32H723ZGTX

  • January 30, 2024
  • 4 replies
  • 4068 views

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.

 

 

 

    This topic has been closed for replies.
    Best answer by PadNyammo

    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.

    4 replies

    Technical Moderator
    January 30, 2024

    Hello @PadNyammo and welcome to the ST Community :smiling_face_with_smiling_eyes:.

    I suggest you to take a look at this post. It may solve your issue.

    Best Regards.

    STTwo-32 

    PadNyammoAuthor
    Explorer
    January 30, 2024

    As suggested in the linked thread, I increased the buffer size to 20,000,000 with no luck. I have also ensured that my ST-Link programmer is up to date, version V2J43M28.

    I am able to get an output on the live expressions in the CubeIDE, but no output on any SWV window(ITM data Console, data logger etc.) I have followed this official guide https://www.youtube.com/watch?v=-X8tndfqTu8 .

    SWV is enabled in debug configuration and set to the HSI core clock. Under ITM Stimulus Ports port 0 is also checked, and I have started the trace (red button).

    Any help would be greatly appreciated, I have been stuck on this for quite some time.

     

    PadNyammoAuthor
    Explorer
    January 31, 2024

    Bump?

    Super User
    January 31, 2024

    Bump??

    Just - you have connected : swd, swc, swo , gnd  ( + vcc is 3v3 ) ?

    IF this connected, set in Cube/.ioc the ->

    AScha3_0-1706733193840.png

    THEN can get swv working - but little bit of game : (it will not work on first try ! )

    Rules : start debug, pause it, open swv window, check port0 is set, -> ok , then click red button, run, stop debug.

    Then do same again...if not working : same again ... it should work now.

    IF it works, it will work in your next debug sessions also, you need to do nothing then - it just works (no button/start etc.) . 

    btw

    How you "see" it working ? printf(xx) ? 

    you need to put (at end of main.c ) :

     

     

    int __io_putchar(int ch)
    {
     ITM_SendChar(ch);
     return (ch);
    }
    
    /* USER CODE END 4 */

     

     

    and in while loop some printf ...but not too much ! (serial buffer will overflow! ) (+ without \n it wont work)

     

     

    	 printf("test swv \r\n");
    	 HAL_Delay(1000);
     /* USER CODE END WHILE */

     

     

     

     

    PadNyammoAuthor
    Explorer
    January 31, 2024

    SWDIO,SWCLK,SWO,!RST,GND and VCC at 3.3V is connected. I am able to program the board without issue and can read live expressions within the IDE.

    Under SYS Mode and configuration I do not have "trace asynchronous Sw" avaliable to choose from, however under Trace and Debug -> Debug "trace asynchronous Sw" has already been selected.

     

    PadNyammo_1-1706735158231.png

    int __io_putchar(int ch)

    function also does not work, there is no output.

    I have also attempted using the following, which was suggested in an official ST video https://www.youtube.com/watch?v=-X8tndfqTu8 :

    ITM_Port32(31) = 1;
    ITM_Port32(31) = 2;
    int _write(int file, char *ptr, int len){
    int DataIdx;
    for(DataIdx=0; DataIdx<len; DataIdx++)
    {
    ITM_SendChar(*ptr++);
    }
    return len;
    }

    I am trying to print the following, and do no think this is enough for the serial buffer to overflow.

    printf("Hello World\n\r");
    HAL_Delay(1000);

     

    PadNyammoAuthor
    Explorer
    January 31, 2024

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

    PadNyammoAuthorAnswer
    Explorer
    February 6, 2024

    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.