cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage and Temperature calculation macro not responding on STM32H563ZIT6

VThan.2
Associate III

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III

@VThan.2 wrote:

there is a hard-fault whenever I call the above functions. 


So what have you done to debug the Hard Fault?

AndrewNeil_0-1721147240945.png

https://www.st.com/resource/en/user_manual/um2609-stm32cubeide-user-guide-stmicroelectronics.pdf

 

View solution in original post

5 REPLIES 5
unsigned_char_array
Senior III

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.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
Billy OWEN
ST Employee

Hi @VThan.2 

 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

 

Regards,

Billy

Andrew Neil
Evangelist III

@VThan.2 wrote:

there is a hard-fault whenever I call the above functions. 


So what have you done to debug the Hard Fault?

AndrewNeil_0-1721147240945.png

https://www.st.com/resource/en/user_manual/um2609-stm32cubeide-user-guide-stmicroelectronics.pdf

 

Thank you this worked. 

What was the problem? How did you fix it?

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.