Skip to main content
Associate III
Oct 15, 2025 12:33 PM UTC
Solved

Read temperature calibration value doesn't work

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.
mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
Oct 15, 2025 1:02 PM UTC

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

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.

1 reply

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
Oct 15, 2025 1:02 PM UTC

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

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.