nRF5 SDK v17.1.0
USBD BLE UART Example
This information applies to the following SoCs: nRF52820, nRF52833, and nRF52840.

This example uses the USB CDC ACM module. See the documentation of this module for links to relevant specification documents. For explanation of the BLE part, see UART/Serial Port Emulation over BLE example.

This example shows how to use the CDC ACM USB class, commonly known as Virtual COM port, with the Nordic UART Service.

After connecting the USB cable, the development kit enumerates as a COMx port on Windows hosts or as a /dev/ttyACMx device on Linux/Unix hosts. The port can be opened and closed just like a traditional serial port.

Windows 8 (and later) hosts pick the correct driver (usbser.sys) automatically.

Setup

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\usbd_ble_uart

LED assignments:

Testing

Test the USBD BLE UART Application with the nRF UART app, which is available for iOS (App Store) and Android (Google Play).

Test the USBD BLE UART Example application by performing the following steps:

  1. Compile and program the application.
  2. Connect the development kit to the host computer through the J-Link port. LED 3 blinks.
  3. Connect the nRF USB to the host computer.
  4. If you are running Windows 7, on first run CDC ACM driver installation is needed. To install the driver on Windows 7, follow these steps:
    • Open Device Manager
    • Right-click the development kit (look for the name "nRF52 ..." depending on the example)
    • Click "Update Driver Software..."
    • Click "Browse my computer for driver software"
    • Click "Browse..." and choose the folder sdk/nrf5/examples/usb_drivers
    • Click "Ok"
    • Click "Next"
    • Click "Install"
    • Click "Close"
  5. Open the serial port. In your computer's Device Manager, the development kit is visible as "nRF52 USB CDC Demo (COMx)". LED 3 turns on.
  6. Using a terminal emulator, for example PuTTY with the following Terminal settings, send test data from the host computer to the development kit. LED 4 toggles.
  7. Connect to the device using the nRF UART app. LED 1 turns on.
  8. Use the nRF UART app to send data to the device. Observe the data received at terminal emulator. LED 2 toggles.
  9. Using a terminal emulator, send data to the development kit. Observe the data received in the nRF UART app. LED 4 toggles.

Documentation feedback | Developer Zone | Subscribe | Updated