2024-08-07 10:11 AM
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).
Solved! Go to Solution.
2024-08-07 12:05 PM
/* 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);
2024-08-07 12:05 PM
/* 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);
2024-08-08 05:38 AM
Thank you it works now!
Have a great day!