Accessing calibration values with ICACHE enabled causes hard fault
Hello,
Any access to the calibration memory addresses of the analogue temperature sensor or the internal reference causes a hard fault if ICACHE is enabled.
Here is an example:
ui16Temp = __HAL_ADC_CALC_VREFANALOG_VOLTAGE(0x0BF0, ADC_RESOLUTION_12B);
MX_ICACHE_Init ();
ui16Temp = __HAL_ADC_CALC_VREFANALOG_VOLTAGE(0x0BF0, ADC_RESOLUTION_12B);Stepping in the debugger, we can see that the first operation gives the expected result. After enabling the ICACHE, we end up in a hard fault.
I pass the fixed value 0x0BF0 just for testing purposes to skip all the ADC related stuff.
My workaround is to store the calibration values in a global variable before enabling the ICACHE and use the variable instead of the memory addresses. Is there any other solution to this?
Took me a few days to figure this out. Hope it helps someone.
