cancel
Showing results for 
Search instead for 
Did you mean: 

Read temperature calibration value doesn't work

Ping1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
mƎALLEm
ST Employee

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 on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
mƎALLEm
ST Employee

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 on "Accept as Solution" on the reply which solved your issue or answered your question.