Printing Floating Point Numbers Using trace_printf
To enable the trace_printf to print floating point numbers do the following in your project.
- Under the projects menu item select properties option.
- Expand out the C/C++ Build Section and select the settings option.
- Now select the tab "Tool Settings". Under the section "Cross ARM C++ Linker" select Miscellaneous.
- Click the checkbox that says "Use float with nano printf (-u_printf_float).
- Now click apply and then OK.
- Rebuild your project and floating point numbers should now print.
Please see picture below for configuration settings and sample code with results.