This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to print floating numbers with nRF Connect SDK?

Hello, guys.

I am using nRF Connect SDK, version 1.4.2 and nRF52840DK. I wonder what would be the way to print floating numbers during debug phase?

According to this thread, all we need is to include the following line into prj.conf file:

CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

as well as to use printf() instead of printk().

When I do the same and try to print a simple floating number with:

printf("Floating number: %3.2f\n", tmp);

Nothing is printed in my Segger Debug Terminal.

Is there anything I am missing here?

Thanks in advance for your time and efforts.

Sincerely,

Bojan.

Related