Skip to main content
Associate II
November 14, 2025
Question

STM32H563RIT freezes during GPDMA1 initialization with CubeProgrammer SWV

  • November 14, 2025
  • 2 replies
  • 713 views

Hello everyone,

I’m working on a project based on the STM32H563RIT, and I’m encountering an issue related to SWV trace when using STM32CubeProgrammer.

The firmware runs correctly in both debug mode and standalone. The problem appears only when I connect to the target with STM32CubeProgrammer and attempt to read the SWV trace. When I do so, the MCU freezes during the initialization phase, specifically inside MX_GPDMA1_Init(), where the DMA used for SPI communication is configured.

As part of the investigation, I also provided the main.c file, where the full list of initialized peripherals and their initialization order can be seen.

For testing, I tried swapping the initialization order between MX_GPDMA1_Init() and MX_SPI2_Init(). With this modification, the firmware starts even while connected to CubeProgrammer, but later freezes when SPI is used in DMA mode, since SPI ends up being initialized before the DMA.

My questions are:

  • Why does connecting with CubeProgrammer and reading SWV cause the STM32H563RIT to stall during GPDMA1 initialization?

  • Are there any known limitations or interactions between SWV trace and GPDMA on the STM32H5 series?

  • What is the correct or recommended initialization order for SPI + DMA in this scenario?

Any help, suggestions, or documentation references would be greatly appreciated.
Thank you!

2 replies

AScha.3
Super User
November 14, 2025

Hi,

Are there any known limitations or interactions between SWV trace and GPDMA 

Did you check errata sheet for this ?

+

can you attach your ioc , just to see, what you set ?

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

Yes i checked and i didn't found anything.

I attached the .ioc file

AScha.3
Super User
November 14, 2025

Seems ok , and your program "runs correctly in both debug mode and standalone. "

But problem with SWV active - so question is: what you do in SWV ?

- you cannot "view live" something in Mbit range : all data is transmitted serial like uart, at 2 Mbit or so.

- "reading" a value from an input might change state of receiver : input "readed" now

+

Dont trace, just use printf to get debug info or message from your running program: then also problem there ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Visitor II
November 17, 2025

The STM32H563RIT freeze during GPDMA1 initialization while SWV tracing is active points to a conflict between the DMA setup and the debug peripheral's state. Since the code runs fine otherwise, the issue is likely SWV bus interference or a timing conflict during the GPDMA clock or register writes. The best solution is to limit SWV to only Port 0 for debug prints to reduce data load, or use breakpoints to pinpoint the exact line of failure.

Associate II
November 19, 2025

i cannot use breakpoint, i'm not in debug mode.
i debug mode the code works, in standalone mode works.

the problem is when i run the code in standalone but, after i connected with STM32CubeProgrammer, i press start in the SVW page. In this case the code stops at the DMA initialization