[SOLVED] STM32H732ZG SWO printf problems

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] STM32H732ZG SWO printf problems

    Hello,

    I made a minimal project with the NUCLEO-H723ZG board, in which I also used SWO printf.
    The project is all about generating and writing out a random number every 500 ms in the main cycle.
    Debugging in STM32CubeIDE with ST-LINK/V3 and J-Link Edu also provides completely invaluable data.
    Although I only use ITM channel 0, DWT-Comparator data is displayed in LOG ... ???
    The MCU clock is 400MHz and the SWO divider has also been carefully set.

    I did the same project on a NUCLEO-H743ZI2 board (the newer ST-LINK/V3 release) and it works perfectly with ST-LINK/V3 and J-Link EDU as well.
    I extended both projects with SEGGER RTT printf and tried to debug with Ozone:Only RTT is visible with NUCLEO-H723ZG, SWO also works with NUCLEO-H743ZI2.

    At this point, I rule out an error in the STM32CubeIDE or ST-LINK/V3, the problem must be somewhere in the difference between the two MCUs.
    Software versions used: J-Link V6.98a, Ozone V3.22b

    I attach the two .elf files, both loaded into RAM.

    Thank you very much in advance!
    Images
    • stm32h723zg-swo.png

      189.31 kB, 1,920×1,200, viewed 1,101 times
    • stm32h743zi-swo.png

      195.27 kB, 1,920×1,200, viewed 1,013 times
    Files
  • Anyone have any idea about the problem?

    The debug infrastructure block diagram shows that TSG and SWTF is missing from STM32H723ZG.
    Images
    • stm32h723zg.png

      49.35 kB, 544×359, viewed 500 times
    • stm32h743zi.png

      52.03 kB, 542×359, viewed 512 times

    The post was edited 1 time, last by tipeter ().

  • A member of ST's Community discovered that the SWO interface in STM32H723ZG seems to runs with half core frequency.
    If I call the following function after SystemClock_Config(), the SWO printf seems to work correctly.

    In this setup I use STLink/V3, although my next task is to try this with J-Link.

    C Source Code

    1. void SWD_Init(void)
    2. {
    3. //SWO current output divisor register
    4. //This divisor value (0x000000C7) corresponds to 400Mhz
    5. //To change it, you can use the following rule
    6. // value = (CPU Freq/sw speed )-1
    7. *(__IO uint32_t*)(0x5C003010) = ((SystemCoreClock / 2 / 2000000) - 1); // SWO_CODR
    8. }
    Images
    • SWV.png

      204.49 kB, 1,920×1,200, viewed 537 times
  • Hi,
    Thank you for your inquiry.
    I looked into this.

    For the STM32H72xx and H73xx devices, we do not set some critical registers when SWO is active,
    but we do so on STM32H74, etc.
    This is why it is working on your H74 but not on the STM32H723ZG.

    A fix will be part of the next patched release planned for Friday, this week.

    Thank you for making this issue known to us.
    We are sorry for any inconvenience caused.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,
    I am having similar issues with a brand new STM32H753XI-EV2 evaluation board (the big one with display).
    I have the board since a few days and am trying to get the printf function to work. First I tried that with the built-in USB-ST-Link interface. I did (almost)everything exactly as in an earlier project for an STM32F7 processor, where it worked perfectly (we work with the latest Keil MDK). Result: The printf only works in principle, but it is extremely unstable. If I do a slow counter output in the main loop (with 100ms delay), then many outputs are lost or there are garbage characters in between. So I switched to Jlink (I have a Jlink-Plus V9.1) because the later target device will not work with ST-Link anyway. The flashing and debugging works fine with Jlink, but the printf doesn't work at all. I've tried almost everything, nothing works. I installed Jlink 6.98 (In 6.97 my processor was unknown).
    Has anyone ever managed to get the printf with Jlink on such an evaluation board? Is there any hope that the version on Friday will work for me, too?
    I would be very happy about help ...

    Friendly regards
    recently
  • Hi,
    Unfortunately, we had to delay this.

    We are planning to add this within the next two weeks for both:
    - STM32H72xx_73xx
    - STM32H75xx

    I will keep you posted.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.