🛠 Utiliser la carte comme adaptateur Bluetooth USB sous Linux

nRF52840-MDK (boards.json id: nrf52840-mdk) · intermediaire · Le nRF52840 a son propre contrôleur USB, exposé sur le hub de la carte : un sample Zephyr et Linux voit un vrai radio BLE hci0.

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

Known bugs to be aware of

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).

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials