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

Migration from SDK 12 to SDK 15 problem with NRF_LOG

Hi,

I am currently trying to setup my sdk 15 on my pca10040. I already have a working I2C source for a BME280 and it works fine using the SDK 12 (pca10040), I get the current temperature and it is displayed via Serial Port terminal.

When I debug my adapted source on SDK 15 I can see, that I receive data from my Sensor and everything works as expected, but I don't get any NRF_LOG's on my serial port sniffer...

So I guess that there must be some NRF_LOG differences between the sdk12 and 15 which I wasn't able to locate, that causes that behavior.

Does anyone have an idea?

Regards

Parents Reply Children
  • I did not change a thing in my sdk_config.h file,so it is the original one from sdk 15.0.0 it is initialized just like in the TWI_Sensor example:

    Those are the only few lines used in my application

    bme280_twi_measurement_get(&data);
        NRF_LOG_INFO("Temperature: " NRF_LOG_FLOAT_MARKER " degrees Celsius.\r\n",
                NRF_LOG_FLOAT(((float)data.temp)/100));
        NRF_LOG_FLUSH();
    }

    int main(void)
    {
        APP_ERROR_CHECK(NRF_LOG_INIT(NULL));

        NRF_LOG_INFO("BME280 TWI sensor example\r\n");
        NRF_LOG_FLUSH();

    Regards

  • Found out what needed to be added in my sdk15, it was the header file:


    #include "nrf_log_default_backends.h"

    and in the main function just before calling NRF_LOG for the first time


            NRF_LOG_DEFAULT_BACKENDS_INIT();

    has to be added

  • Hi  @Jørgen Holmefjord

    I am migrating an old SDK app to SDK 15 and I am facing the same issue you solved adding NRF_LOG_DEFAULT_BACKENDS_INIT(); before the calling NRF_LOG

    for every source file where I use NRF_LOG I added:

    #include "nrf_log.h"
    #include "nrf_log_ctrl.h"
    #include "nrf_log_default_backends.h" //(I added this new one to each file)

    also I am getting the following error:

    ..\..\..\..\..\..\components\libraries\experimental_log\src\nrf_log_internal.h(315): error:  #65: expected a ";"  extern nrf_log_module_dynamic_data_t NRF_LOG_MODULE_DATA_DYNAMIC;

Related