Skip to main content
Visitor II
August 7, 2024
Solved

DBGMCU ID code not available by software on STM32U073

  • August 7, 2024
  • 1 reply
  • 1252 views

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).

 

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    /* 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);

     

    1 reply

    Graduate II
    August 7, 2024

    /* 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);

     

    Visitor II
    August 8, 2024

    Thank you it works now! 

    Have a great day!