2024-07-15 11:01 PM
Hello Community,
I am using 2 function calls
__LL_ADC_CALC_VREFANALOG_VOLTAGE();
__LL_ADC_CALC_TEMPERATURE_FLOAT();
My implementation:
uhADCxConvertedData_VrefAnalog_mVolt = __LL_ADC_CALC_VREFANALOG_VOLTAGE(aADCxConvertedData[1], LL_ADC_RESOLUTION_12B);
temperature = __LL_ADC_CALC_TEMPERATURE_FLOAT(uhADCxConvertedData_VrefAnalog_mVolt, aADCxConvertedData[2], LL_ADC_RESOLUTION_12B);
I am seeing the above macros not respond and there is a hard-fault whenever I call the above functions. Any help would be appreciated.
Thank you
Solved! Go to Solution.
2024-07-16 09:27 AM
@VThan.2 wrote:there is a hard-fault whenever I call the above functions.
So what have you done to debug the Hard Fault?
https://www.st.com/resource/en/user_manual/um2609-stm32cubeide-user-guide-stmicroelectronics.pdf
2024-07-16 01:36 AM
Have you checked this topic?
https://community.st.com/t5/stm32cubeide-mcus/ll-adc-calc-temperature-hardfaults-ts-cal1-ts-cal2-read-as-zero/td-p/77106
A macro should not result in a hardfault error unless it refers to an illegal memory location or divides by zero or something. What do you see when you debug the code and step through it? What are all the values? If this doesn't help you please upload your ioc file.
2024-07-16 09:22 AM
Hi @VThan.2
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
Regards,
Billy
2024-07-16 09:27 AM
@VThan.2 wrote:there is a hard-fault whenever I call the above functions.
So what have you done to debug the Hard Fault?
https://www.st.com/resource/en/user_manual/um2609-stm32cubeide-user-guide-stmicroelectronics.pdf
2024-07-16 10:52 PM
Thank you this worked.
2024-07-17 12:55 AM
What was the problem? How did you fix it?