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

NRF_LOG output on BLE Nano (Readbear)

Hello,

I wanted to check the log on nRF52 example codes. Though the code compiles and runs (GCC compiler) I do not see the log anywhere. I tried connecting the device (MK20) as serial. The terminal opens up but nothing is seen in there.

Can someone please suggest me a best way to see the logs using a BLE nano?

Regards, Shankar

Parents
  • Hi,

    You need to make sure NRF_LOG module is enabled and set to use UART as the backend. This is done is sdk_config.h, by setting:

    #define NRF_LOG_ENABLED 1
    

    and:

    #define NRF_LOG_BACKEND_SERIAL_USES_UART 1
    

    Also make sure that you set #define NRF_LOG_DEFERRED 0, or that you call NRF_LOG_FLUSH() or NRF_LOG_PROCESS() in you main loop to process the log queue.

    The UART pinouts for your board might not be the same as the one used for the nRF5x DK in the SDK. You should check the pinout on the schematics for your board and compare this towards the pins defined in sdk_config.h:

    #define NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 6
    #define NRF_LOG_BACKEND_SERIAL_UART_RX_PIN 8
    #define NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN 5
    #define NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN 7
    

    Best regards,

    Jørgen

Reply
  • Hi,

    You need to make sure NRF_LOG module is enabled and set to use UART as the backend. This is done is sdk_config.h, by setting:

    #define NRF_LOG_ENABLED 1
    

    and:

    #define NRF_LOG_BACKEND_SERIAL_USES_UART 1
    

    Also make sure that you set #define NRF_LOG_DEFERRED 0, or that you call NRF_LOG_FLUSH() or NRF_LOG_PROCESS() in you main loop to process the log queue.

    The UART pinouts for your board might not be the same as the one used for the nRF5x DK in the SDK. You should check the pinout on the schematics for your board and compare this towards the pins defined in sdk_config.h:

    #define NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 6
    #define NRF_LOG_BACKEND_SERIAL_UART_RX_PIN 8
    #define NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN 5
    #define NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN 7
    

    Best regards,

    Jørgen

Children
Related