Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression/change in master: formatting floats and doubles #30298

Closed
coderkalyan opened this issue Nov 27, 2020 · 3 comments
Closed

regression/change in master: formatting floats and doubles #30298

coderkalyan opened this issue Nov 27, 2020 · 3 comments
Assignees
Labels
area: Minimal libc Minimal C Standard Library

Comments

@coderkalyan
Copy link
Contributor

After updating to latest zephyr master, I noticed that I can't format float values with libc printf() or the logging API, while I used to be able to. I took a quick in the commit history, and there are some commits recently (in the last 2-3 weeks) regarding formatting in the libc implementation, but I could figure out what was the culprit.

Is there something I should be changing at build time, or a replacement format function, to achieve float formatting?

@coderkalyan coderkalyan added the bug The issue is a bug, or the PR is fixing a bug label Nov 27, 2020
@carlescufi carlescufi added the area: Minimal libc Minimal C Standard Library label Nov 30, 2020
@pabigot
Copy link
Collaborator

pabigot commented Nov 30, 2020

Add CONFIG_CBPRINTF_FP_SUPPORT=y to your prj.conf. This should be the default if you have CONFIG_FPU=y, but if you're doing software floating point it wouldn't be.

@pabigot pabigot added question and removed bug The issue is a bug, or the PR is fixing a bug labels Nov 30, 2020
@pabigot
Copy link
Collaborator

pabigot commented Nov 30, 2020

For more details on the new formatter: https://docs.zephyrproject.org/latest/reference/misc/formatted_output.html

@coderkalyan
Copy link
Contributor Author

This worked for me, thank you very much @pabigot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Minimal libc Minimal C Standard Library
Projects
None yet
Development

No branches or pull requests

3 participants