USB deive CDC ACM

My device and Software details are as below

nRF52840 DK

nRF connect SDK 2.0.2

Want to verify USB device role for nRF52840 DK.

Found the below example and its documentation 

samples/subsys/usb/cdc_acm

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/zephyr/samples/subsys/usb/cdc_acm/README.html

The main doubt here is the documentation says "this project requires an USB device driver, which is available for multiple boards supported in Zephyr."

So to test this how i can include driver also in the project before building and flashing the final binary to the nRF52840 board.

Can anyone help with complete steps

Parents Reply Children
  • Thanks for the information. When I connected the board it is connected as COM6 and when I type the data i can see the data. For e.x: if I type letter 'a' i can see letter a. I think this is the expected behavior.

    one more thing is one USB port is used as power and other USB is enumerated as com port which is com6 here. When I am using JLINK(RTT) for debugging i am using with USB, in future project this USB power lines will be used for power but from external source instead of laptop. That time how can I debug.

  • Srikara said:
    one more thing is one USB port is used as power and other USB is enumerated as com port which is com6 here. When I am using JLINK(RTT) for debugging i am using with USB, in future project this USB power lines will be used for power but from external source instead of laptop. That time how can I debug.

    One of the USB ports (J2) is connected to the interface MCU (debug chip) on the DK, while the other USB port (J3 - NRF_USB) is connected directly to the nRF52840 chip. Both can be used to power the nRF52840 chip on the DK, depending on the setting of SW9 (nRF power source). If you want to debug the application over SWD/RTT without connecting the DK to a PC, you need to connect an external debugger chip to the debug in port (P18) or the SWDIO/SWDCLK pins of the debug pin header (P20).

    If you do not have an external debugger, it is also possible to send debug strings over UART from the chip.

  • Thank you for the information.

    As I siad we want to use USB CDC as part of our application. So my question is if we use sample application driver is included automatically, but when we merge our USB CDC, BLE into one application how we need to include driver(steps to include driver) as part of our application. 

  • Yes, if you include the required Kconfigs in your projects prj.conf file, the driver/stack will be included automatically. 

  • We are using nRF52840 DK board to program Target board. Interface is SWDIO lines.
    Connecting nRF52840 DK to PC and tapping SWDIO line to Target board (nRF52840).
    Also as mentioned you before is there any sample application to understand routing the logs through UART.


    Our end use case is to enable USB interface in device mode that connects to Host PC/ Printer.
    Is there any sample code to enable USB Log mode and root logs to USB port.
    in addition to USB, we need to enable UART port also for Host PC interface.

Related