Trouble printing floats in the new sdk

In porting from Zephyr SDK to device_sdk I’m having trouble print floats.
The code below works properly in the Zephyr SDK but gives the output below in in the firmware-sdk.


I have all the right newlib entries in prj.conf


Any ideas?

Hey John,

Add CONFIG_CBPRINTF_FP_SUPPORT=y to the project configuration. More information about formatted output can be found here.

That works for me. I saw references to that but it only looked like it applied to cbprintf, not printk. How many of the CONFIG_NEWLIB lines above do I need and why did this break with the new SDK?

You can leave all CONFIG_NEWLIB lines in the project configuration. If CONFIG_CBPRINTF_FP_SUPPORT wasn’t explicitly listed in the application configuration when you were using Golioth Zephyr SDK, that would mean other configuration files introduced it to your application. CONFIG_CBPRINTF_FP_SUPPORT is used only in the RCP example in both Zephyr SDK and Firmware SDK.

Yes, I confirmed that it is set using 0.7.1 but is not in 0.10.0 with a very similar config. I debugged it to several shells I turned off and then isolated it to CONFIG_SENSOR_SHELL=n.
That shell must enable CONFIG_CBPRINTF_FP_SUPPORT.

We can close this. Thanks for your support.