cancel
Showing results for 
Search instead for 
Did you mean: 

float correctly displayed in debug but not in release.

papageno
Associate III

Dear experts,

i try to use the float library with printf or vsnprintf. The option nano has been checked, the -u _printf_float too. The latest version of STM32cubeIDE, the proc is STM32F446RE. The value of floats are correctly displayed in debug but in release, it displays a wrong value. The value are mean and median computed values. I suppose there is a problem with a library in release. I really thank you for your help.

Regards,

pap

1 ACCEPTED SOLUTION

Accepted Solutions
papageno
Associate III

Erratum: My apologies, the float lib in nano is ok. After searching a little, i found that the problem I had was incorrect data from upstream capture using IT and ISR: the data processed was corrupted in release configuration but all was ok in debug. The reason: I was calling the HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1 ) function from ISR. Replacing this call by htim->Instance->CCR1 inside the ISR solved my problem and data in the array is now correct and the mean and median functions can process correct data and give correct float results. I let the solution of my problem which was not a real problem on the forum, maybe it can help somebody else.

Sorry for the inconvenience.

View solution in original post

2 REPLIES 2
papageno
Associate III

Erratum: My apologies, the float lib in nano is ok. After searching a little, i found that the problem I had was incorrect data from upstream capture using IT and ISR: the data processed was corrupted in release configuration but all was ok in debug. The reason: I was calling the HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1 ) function from ISR. Replacing this call by htim->Instance->CCR1 inside the ISR solved my problem and data in the array is now correct and the mean and median functions can process correct data and give correct float results. I let the solution of my problem which was not a real problem on the forum, maybe it can help somebody else.

Sorry for the inconvenience.

Imen.D
ST Employee

Hi @papageno​ ,

Glad to know that your issue is solved :smiling_face_with_smiling_eyes: and thanks for sharing the solution, it should be helpful for the Community.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen