cancel
Showing results for 
Search instead for 
Did you mean: 

DBGMCU ID code not available by software on STM32U073

NBDevSinope
Associate

MCU use : STM32U073RBT6

STM32CubeIDE use : 1.16.0

 

We are currently working on a project that require to read the ID Code of the MCU. The software work well when ran in debug mode, but return 0 when running without the debug mode running.

The code that we use today to access to the ID Code is:

 

uint32_t idcode = DBGMCU->IDCODE

 

 

We looked to the address base of DBGMCU and everything looks fine (0x40015800).

 

When looking online we saw that there is a similar errata on the STM32F101x8/B, STM32F102x8/B and STM32F103x8/B (https://www.st.com/resource/en/errata_sheet/cd00190234-stm32f101x8-b-stm32f102x8-b-and-stm32f103x8-b-medium-density-device-limitations-stmicroelectronics.pdf -> Refer to section 2.2.2).

 

1 ACCEPTED SOLUTION

Accepted Solutions

/* Enable the Debug Module RCC peripheral clock */

__HAL_RCC_DBGMCU_CLK_ENABLE();

STM32Cube_FW_U0_V1.0.0\Projects\NUCLEO-U083RC\Examples_LL\UTILS\UTILS_ReadDeviceInfo

LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_SYSCFG);

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

/* Enable the Debug Module RCC peripheral clock */

__HAL_RCC_DBGMCU_CLK_ENABLE();

STM32Cube_FW_U0_V1.0.0\Projects\NUCLEO-U083RC\Examples_LL\UTILS\UTILS_ReadDeviceInfo

LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_SYSCFG);

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you it works now! 

Have a great day!