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

Cannot print more than two values in a single command line using NRF_LOG_FLOAT_MARKER

Hi, 

I have been trying to print out the float values using the NRF_LOG_FLOAT_MARKER, and i am only able to print 2 values in a single NRF_LOG_INFO line. Is there a way to print 3 values in a single line?


Currently this is what i have been using to print 2 values:
NRF_LOG_INFO("Data 1: "NRF_LOG_FLOAT_MARKER" Data 2: "NRF_LOG_FLOAT_MARKER" \r\n", NRF_LOG_FLOAT(Value_1), NRF_LOG_FLOAT(Value_2));
NRF_LOG_FLUSH();

But if i want to print 3 values:

NRF_LOG_INFO("Data 1: "NRF_LOG_FLOAT_MARKER" Data 2: "NRF_LOG_FLOAT_MARKER" Data 3: "NRF_LOG_FLOAT_MARKER"\r\n", NRF_LOG_FLOAT(Value_1), NRF_LOG_FLOAT(Value_2), NRF_LOG_FLOAT(Value_3));
NRF_LOG_FLUSH();

I get an error, saying: undefined reference to `LOG_INTERNAL_9'

Parents Reply Children
  • I would suggest  to take a fresh example from the SDK. You may have changed something in your code and you can to remember it. Next do the following

    1) Modify the printf/scanf options as mentioned before

    2) Create a character array (i.e. char my_array[50] = {'\0'} ) and a float variable(i.e. x=3.14).

    2) use sprintf since it is the most straight forward choice (in my opinion)

      sprintf(str, "Value of Pi = %f", x);

    3)Open the CMSIS Configuration wizard. Under nrf_log enable NRF_LOG_ENABLED and BACKEND_RTT

    4) Write something on the segger serial port. Also enable RTT J-link view

Related