DBGMCU ID code not available by software on STM32H7A3
We have been trying to access DBGMCU on an STM32H7A3 via software. The background is that the project shares code that in an other project runs on an H743 and for example needs to adjust how it interacts with the flash.
We’re now experiencing the strange behaviour that when a debugger is connected the DBGMCU ID code reads correctly as 0x10076480. When no debugger is connected it reads as zero (0x00000000). This is the case when debugging using GBD or when connecting via STM32CubeProgrammer. Connecting via STM32CubeProgrammer to an already running processor makes it readable. After disconnecting it reads zero again.
We’ve tried accessing the ID both via
AL_GetDEVID()
HAL_GetREVID()as well as directly via
DBGMCU->IDCODEwith the same results.
Testing access to the writable parts of DBGMCU show a similar behavior where it works when connected to the debugger but not otherwise.
Now we are wondering if there are any clock or power configurations that could lead to such a behavior. We’ve seen similar topics for other MCUs where enabling Debug Module RCC peripheral clock was the solution but we can’t find mention of such a clock in the Reference manual for the H7A3.
