2021-03-15 12:56 PM
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
Solved! Go to Solution.
2021-03-16 06:10 AM
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.
2021-03-16 06:10 AM
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.
2021-03-17 12:41 PM
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