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

NRF_LOG_BACKEND_UART work with NUS

Hello,I want to make NRF_LOG_BACKEND_UART work with NUS . The nus work with app_uart_fifo,and the NRF_LOG_BACKEND_UART work with app_uart. I try to make them work together,but It doesn't work.What can i do for it.I don't understand NRF_LOG_INFO(),how it works with app_uart.

Parents
  • Hi,

    Since the UART peripheral is in the ble_app_uart example used by the application directly, it’s not recommended to use it as a backend for the nrf_log also, since there is no mechanism for managing access to uart. The option to select the UART as nrf_log backend in the ble_app_uart example is therefore removed in SDK 14.

    You should therefore instead use the Segger RTT viewer to view the nrf_log messages. (NRF_LOG_BACKEND_RTT_ENABLED set to 1)

    Make sure that you have the NRF_LOG_PROCESS() in the main loop.

    // Enter main loop.
    for (;;)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            power_manage();
        }
    }
    

    and open the program J-Link RTT Viewer to view the log messages.

Reply
  • Hi,

    Since the UART peripheral is in the ble_app_uart example used by the application directly, it’s not recommended to use it as a backend for the nrf_log also, since there is no mechanism for managing access to uart. The option to select the UART as nrf_log backend in the ble_app_uart example is therefore removed in SDK 14.

    You should therefore instead use the Segger RTT viewer to view the nrf_log messages. (NRF_LOG_BACKEND_RTT_ENABLED set to 1)

    Make sure that you have the NRF_LOG_PROCESS() in the main loop.

    // Enter main loop.
    for (;;)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            power_manage();
        }
    }
    

    and open the program J-Link RTT Viewer to view the log messages.

Children
Related