2025-11-14 12:46 AM
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!
2025-11-14 2:26 AM
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 ?