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

NRF_LOG...() function on VirtualCom (like printf).

I'm using the "ble_app_uart" example from "nRF5_SDK_15.2.0_9412b96".
I would like to enable the sending of logs to the serial port (Virtual com), like "printf ()".

The code is this (for example):

static void idle_state_handle (void)
{
     if (NRF_LOG_PROCESS () == false)
     {
         nrf_pwr_mgmt_run ();
     }
}

main ()
{
     // Start execution.
     printf (UART started);
     NRF_LOG_INFO ("Debug logging for UART over RTT started.");
 
     // Enter main loop.
     for (;;)
     {
         idle_state_handle ();
         mdb_handler ();
    }
}

Note:

1) The message "UART started" from printf () is displayed on the virtual com port, but not the message "Debug logging for UART over RTT started."
2) #ifndef NRF_LOG_ENABLED
     #define NRF_LOG_ENABLED 1
     #endif
3) All library files are like "ble_app_uart" example from "nRF5_SDK_15.2.0_9412b96".

Question:

Is it possible to send logs from NRF_LOG ... to the VCP (like printf) ?
What should I change to do this ?
Where can I find an example ?

Thank you.

BR
Demetrio Magrin

Parents Reply Children
No Data
Related