Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

CDC ACM USBD Binary / Raw Data Mode

Hello,

I am using the nRF52833 - DK and running the USB CDC ACM example. I can transmit and receive data with the example. I noticed that when receiving data I am only able to receive ASCII data. If the USB CDC Host sends binary / raw data. it is not being received properly by the Nordic device.

Is there some configuration I need to change for the Nordic to properly read/process binary data?

I did find a post somewhat related but did not see a resolution:

 CDC ACM USBD Binary Mode 

Any help or insight is appreciated.

Brent

 

Parents
  • Hi Brent, 

    Assuming you are using nrf5SDKv17.1.0, The usb driver/library in itself is not doing any conversion from binary/ASCII in itself. But there are some instances in the application where we are logging or sending data in ASCII.

    For example in APP_USBD_CDC_ACM_USER_EVT_RX_DONE event, we have 

    NRF_LOG_INFO("RX: size: %lu char: %c", size, m_rx_buffer[0]);
    

    This just logs to serial output and does not affect the USB data.

    But we also have 

    size_t size = sprintf(m_tx_buffer, "Hello USB CDC FA demo: %u\r\n", frame_counter);
    

    Which is actual data transmitted which is actually formulated to ASCII. 

    If you want to deal with raw data, then you just need to print/log or formulate such things in raw data formats like using NRF_LOG_HEXDUMP_INFO to print. or not using ascii conversions in sprintf

  • Thank you for the response. I will take a look.

Reply Children
No Data
Related