2024-11-03 8:56 PM
I get the following error when trying to debug an STM32H757 with SWO enabled.
Failed to enable SWV configuration.
Failed to execute MI command:
-data-write-memory 0x5c003010 x 4 0x77
etc...
It would seem the debugger (ST-link v2) is not able to read the SWO and DBGMCU registers.
With the same debug configuration and code, SWO works on H747 hardware, so I'm wondering if there is an SWO difference between these two micros that is not obvious or documented.
Has anyone come across this issue before and has an idea of how to fix it?
Thanks
2024-11-07 7:00 AM
2025-07-16 7:25 AM - edited 2025-07-16 7:28 AM
Hello @Imen.D,
I've got the same error message than @CWadd, and I havn't found anything in the AN4989 that seems to be related to my problem.
Here is my situation :
I'm debugging a STM32H757XIH6 using STM32CubeIDE v1.18.1
I'm trying to get SWO from CM7, by enabling SWV in the CM7 Debug configuration as on following picture. Note that the SWV is disabled for CM4 Debug configuration
I've got a simple code that works well for SWV and I can see my printf in the SWV ITM view. So my hardware is good, and the IDE is able to display the printf.
But my main project got the error message that @CWadd provided...
This doesn't happen at the first debug session. The first session works, but doesn't output anything in SWV ITM View. Then I'm unable to debug again and got the error message.
In this situation I cannot debug anymore, and always get this message, even with the simple program. So I need to erase all flash with CubeProgrammer, and I can debug again.
I've compared everything between these 2 codes and didn't find anything to solve my problem.
I'm thinking about a write protection on the SWO config registers (which are designated by first addresses in the error message). But I didn't know where to look, and what I can do about that.
Have you got any clues or intuition about something I should check ?
@CWadd did you managed to fix this issue ?