🛠 Utiliser la carte comme adaptateur Bluetooth USB sous Linux
Why this is possible
The nRF52840-MDK contains a Microchip two-port downstream USB 2.0 Hi-Speed hub: port 1 goes to the DAPLink, port 2 to the native USB controller of the nRF52840. The SoC therefore enumerates directly on the bus — exactly what is needed for BLE dongle-style usage. The Zephyr sample hci_usb turns the board into an HCI radio for the Linux Bluetooth stack (BlueZ); the same usage is documented on Raspberry Pi in a DevZone thread cited in issue #55 of the MakerDiary repository.
Step 1 — Flash the hci_usb firmware
From an up-to-date Zephyr workspace:
west build -b nrf52840_mdk samples/bluetooth/hci_usb
west flash
west flash uses the CMSIS-DAP probe; the native USB port remains free for the radio role. You can also drop build/zephyr.hex onto the DAPLINK drive and then reset.
Step 2 — Linux side
Plug in the board, then check enumeration and HCI interface creation:
lsusb # le périphérique Nordic apparaît
sudo dmesg | tail # log: Bluetooth: hci0 ...
Then test with the standard tool:
bluetoothctl
[bluetoothctl] power on
[bluetoothctl] scan on # les périphériques BLE à portée défilent
[bluetoothctl] exit
hciconfig -a (or btmgmt info) should show hci0 UP RUNNING with LE capabilities. On a Raspberry Pi, the recipe is identical — this is exactly the scenario of the DevZone walkthrough “performing bluetooth operations with nrf52840 dongle using bluetoothctl in raspberry pi”.
Step 3 — Concrete use cases
- BLE radio for BlueZ/
bluetoothctlscripts on a machine without Bluetooth. - Lightweight home automation gateway: the board as radio, the Pi as the brain.
- To sniff traffic in parallel, the sibling nRF52840 MDK USB Dongle is sold for BLE/802.15.4 sniffer usage with Wireshark.
Known bugs to be aware of
- MAC address 00:00:00:00:00:00 with hci_usb (issue #57): if BlueZ complains, check the address reported by
btmgmt infobefore concluding it is a dead cable. - USB_DEVICE_VID undefined (issue #56) on some builds: impacts host-side recognition.
- Flaky enumeration on some hosts (issues #53/#37): use a direct USB port, no external hub, and a data cable.
Going further
The sample’s Kconfig options (CONFIG_BT_HCI, USB descriptors) can be modified via menuconfig; this is a good entry point into USB device development on nRF52840 (the same controller is used for CDC, HID, and composite profiles).