2025-10-15 5:33 AM
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
Solved! Go to Solution.
2025-10-15 6:02 AM - edited 2025-10-15 6:04 AM
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
2025-10-15 6:02 AM - edited 2025-10-15 6:04 AM
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