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

How to view LOG from nRF52840 USB CDC example

Hi,
I am working on the project through the USB CDC example.

I know how to view log using RTT Viewer through J-Link and UART-LOG using UART.

But how can I see LOG with only CDC-USB connected?


I am using Putty to connect to the COM port that came with the CDC-USB, and the CDC does not work. If I am running CDC, I can not see the LOG.

I wonder if there is a way to view LOG with only USB-CDC connected except the above two methods.

Parents Reply Children

  • in my test case , i'm using usb interactive example,i need using CDC ACM port to read log,
    so  i change nrf_cli_init parameter from NRF_LOG_SEVERITY_ERROR to NRF_LOG_SEVERITY_INFO and it works for me.

    static void cli_init(void) 
    { 
        ret_code_t ret; 
    #if CLI_OVER_USB_CDC_ACM 
        //ret = nrf_cli_init(&m_cli_cdc_acm, NULL, true, true, NRF_LOG_SEVERITY_ERROR); 
        ret = nrf_cli_init(&m_cli_cdc_acm, NULL, true, true, NRF_LOG_SEVERITY_INFO); 
        APP_ERROR_CHECK(ret); 
    #endif 
    #if CLI_OVER_UART 
        nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG; 
        uart_config.pseltxd = TX_PIN_NUMBER; 
        uart_config.pselrxd = RX_PIN_NUMBER; 
        #ifdef HWFC uart_config.pselcts = CTS_PIN_NUMBER; 
        uart_config.pselrts = RTS_PIN_NUMBER; 
        uart_config.hwfc = NRF_UART_HWFC_ENABLED; 
        #endif 
        ret = nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_ERROR); 
        APP_ERROR_CHECK(ret); 
    #endif 
    }

Related