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

NRF_LOG_INFO and printf does not work

Hello,

I am trying to print things from my board. I would like to go with NRF_LOG_INFO. I have the modules enabled, included the essential libraries, including the c files, but it does not work.

uint32_t err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
	NRF_LOG_INFO("Hi!");
	NRF_LOG_FLUSH();
	NRF_LOG_PROCESS();
	
    //gpio_init();
	pin_init();
	NRF_LOG_INFO("Pin Init OK?");
	NRF_LOG_FLUSH();
	NRF_LOG_PROCESS();
	
	comp_init();
	NRF_LOG_INFO("COMP Init OK?");
	NRF_LOG_FLUSH();
	NRF_LOG_PROCESS();
	
	NRF_LOG_INFO("Ready...");
	NRF_LOG_FLUSH();
	NRF_LOG_PROCESS();

I am using NRF52DK with SDK v14.20. I use PuTTY and have connected to the correct virtual COM port with the correct configuration.

Is there anything I may be missing?

Thank you in advance.

Parents
  • Okay, i fixed it.

    Reading this thread, it shows that there's a bug in SDK 11, which still present on SDK 14.

    TL;DR:

    1. Don't use app_uart. Use app_fifo and app_uart_fifo instead.

    2. add "#include "app_fifo.h" "

    3. add this in sdk_config.h:

    // <q> APP_FIFO_ENABLED  - app_fifo - Software FIFO implementation
     
    
    #ifndef APP_FIFO_ENABLED
    #define APP_FIFO_ENABLED 1
    #endif

    I hope this thread will be #1 on Google so other developers won't face this problem like I did.

    I'm removing my project file and converting this thread to public

Reply
  • Okay, i fixed it.

    Reading this thread, it shows that there's a bug in SDK 11, which still present on SDK 14.

    TL;DR:

    1. Don't use app_uart. Use app_fifo and app_uart_fifo instead.

    2. add "#include "app_fifo.h" "

    3. add this in sdk_config.h:

    // <q> APP_FIFO_ENABLED  - app_fifo - Software FIFO implementation
     
    
    #ifndef APP_FIFO_ENABLED
    #define APP_FIFO_ENABLED 1
    #endif

    I hope this thread will be #1 on Google so other developers won't face this problem like I did.

    I'm removing my project file and converting this thread to public

Children
Related