2020-06-18 12:42 PM
Hi,
I am using a STM32F4/STM32L4 MCU and STMCube IDE (1.3.0) for the development. It gives ma a hard fault when I print float values.
float value = 3.14f;
printf("Value: %f\r\n", value);
I have enable -u _printf_float as mentioned in attached image. Will you please help me to resolve the issue?
2020-06-18 01:35 PM
So you can use floats, but the hard fault occurs when using printf with floats?
printf uses malloc, might be malloc failing.
Where is your printf sending data?
2020-06-18 01:38 PM
Que: So you can use floats, but the hard fault occurs when using printf with floats?
Ans: Correct.
Que: Where is your printf sending data?
Ans: UART
2020-06-20 12:15 AM