Skip to main content
Visitor II
August 6, 2025
Question

undefined reference to `__HAL_RCC_PWR_CLK_ENABLE

  • August 6, 2025
  • 3 replies
  • 677 views

Hello everyone,i want to dected PVD but when i enable __HAL_RCC_PWR_CLK_ENABLE Iits showing error in stm32h753vit6 why?

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    August 6, 2025

    Hello @pushkarmondhe ,

    I think you haven't configured the library source and Include paths within the project build.

    You have to review the defines and provide the compiler with a list of include file paths.

    Ensure that the following header file is included in your source file: #include "stm32h7xx_hal.h".

    Visitor II
    August 6, 2025

    Hello. @Imen.D

    I already add 

    #include "stm32h7xx_hal.h"

    #include "stm32h7xx_hal_pwr.h"

    i provide main.c below please see that one

     

     

     

    Super User
    August 6, 2025

    The only file you should ever #include for HAL is "stm32h7xx_hal.h".

    Modify the "*_hal_conf.h" file to include the pwr module by defining HAL_PWR_MODULE_ENABLED.

    Graduate
    September 16, 2025

    I also have the same issue, was this solved?

    Trying to use the backup SRAM

    __HAL_RCC_PWR_CLK_ENABLE();

    HAL_PWR_EnableBkUpAccess();

    __HAL_RCC_BKPRAM_CLK_ENABLE();

    main.h has the #include "stm32h7xx_hal.h"

    stm32h7xx_hal_conf.h has

    #define HAL_RCC_MODULE_ENABLED

    #define HAL_PWR_MODULE_ENABLED

    Super User
    September 16, 2025

    __HAL_RCC_PWR_CLK_ENABLE doesn't exist in the HAL library so it can't be called. I suspect it's not needed on this chip. Check if PWR->x registers change when you write to them.

    __HAL_RCC_BKPRAM_CLK_ENABLE compiles just fine for me with the included IOC.

    Graduate
    September 16, 2025

    Thank you TDK, your right is only on the STM32F4