Skip to main content
Visitor II
October 15, 2025
Solved

Read temperature calibration value doesn't work

  • October 15, 2025
  • 1 reply
  • 188 views

Dear Support

I am using STM32H563, try to get internal Vref, and temperature working, and ADC conversion is OK, but when using macro  __HAL_ADC_CALC_VREFANALOG_VOLTAGE, and __HAL_ADC_CALC_TEMPERATURE to convert to Vref and temperature, it ends up a in HardFault_Handler(), I tried to read the address directly for the value like below:

Cal2 = (float)((int32_t)*TEMPSENSOR_CAL2_ADDR);

Cal1 = (float)((int32_t)*TEMPSENSOR_CAL1_ADDR);

 

And ends up same, no matter in Nucleo-H563 or my target board, please help!

Regards!

Ping

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    It's mostly due to this:  ICACHE enabled + reading from the OTP.. Refer to this article:

    How to avoid a HardFault when ICACHE is enabled on the STM32H5 series

     

    1 reply

    mƎALLEmAnswer
    Technical Moderator
    October 15, 2025

    Hello,

    It's mostly due to this:  ICACHE enabled + reading from the OTP.. Refer to this article:

    How to avoid a HardFault when ICACHE is enabled on the STM32H5 series