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

nrf9160 samples cannot use sscanf or printk with float

Hi

I want to modify the nrf9160 software samples from Nordic so I can use float with printk() and sscanf() functions.

I am also using gcc. 

I try figure out how/where to set the cmake to have float support.

Some older threads suggest to add these options to the make file:

LDFLAGS += -u_printf_float 

LDFLAGS += -u_scanf_float

But where should I put these lines?

My CMakeLists.txt file is like this:

cmake_minimum_required(VERSION 3.8.2)

include(../../../cmake/boilerplate.cmake NO_POLICY_SCOPE)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(mqtt-simple)

target_sources(app PRIVATE src/main.c)

And this boilerplate.cmake file is on another level that I am.

Anyone know how to do this?

Related