xref: /btstack/chipset/zephyr/nrf5340_dongle/README.md (revision 421ee5a81fc93c586b09dd2826138e3d0de0c9f8)
1*421ee5a8SDirk Helbig# nRF5340 (Audio) DK Board as USB HCI Dongle Guide
2*421ee5a8SDirk Helbig
3*421ee5a8SDirk HelbigThis will turn the Nordic nRF5340 DK and Audio DK boards into an USB CDC HCI dongle.
4*421ee5a8SDirk Helbig
5*421ee5a8SDirk HelbigIf using the NRF Connect SDK ( sdk-nrf ) it is important to follow the order in this document, as 'west flash'
6*421ee5a8SDirk Helbigwill also program the NetCore with zephyr-ll which needs to be replaced afterwards with the Packetcraft Link Layer.
7*421ee5a8SDirk Helbig
8*421ee5a8SDirk Helbig## Preconditions
9*421ee5a8SDirk HelbigCopy the included files to '${ZEPHYR_ROOT}/zephyr/examples/bluetooth/hci_uart/'
10*421ee5a8SDirk Helbig
11*421ee5a8SDirk Helbig## Build/Flash HCI Bridge on AppCore
12*421ee5a8SDirk Helbig
13*421ee5a8SDirk HelbigYou need to specify the board with the '-b' param in the west call.
14*421ee5a8SDirk Helbig
15*421ee5a8SDirk HelbigFor nRF5340 DK:
16*421ee5a8SDirk Helbig
17*421ee5a8SDirk Helbig```sh
18*421ee5a8SDirk Helbigcd  ${ZEPHYR_ROOT}/zephyr/samples/bluetooth/hci_uart/
19*421ee5a8SDirk Helbigwest build --pristine -b nrf5340dk_nrf5340_cpuapp -- -DDTC_OVERLAY_FILE=usb.overlay -DOVERLAY_CONFIG=overlay-usb.conf
20*421ee5a8SDirk Helbigwest flash
21*421ee5a8SDirk Helbig```
22*421ee5a8SDirk Helbig
23*421ee5a8SDirk HelbigFor nRF5340 Audio DK (ADK)
24*421ee5a8SDirk Helbig
25*421ee5a8SDirk Helbig```sh
26*421ee5a8SDirk Helbigcd  ${ZEPHYR_ROOT}/zephyr/samples/bluetooth/hci_uart/
27*421ee5a8SDirk Helbigwest build --pristine -b nrf5340_audio_dk_nrf5340_cpuapp -- -DDTC_OVERLAY_FILE=usb.overlay -DOVERLAY_CONFIG=overlay-usb.conf
28*421ee5a8SDirk Helbigwest flash
29*421ee5a8SDirk Helbig```
30*421ee5a8SDirk Helbig
31*421ee5a8SDirk Helbig## Flash Packetcraft Link Layer on NetCore
32*421ee5a8SDirk Helbig
33*421ee5a8SDirk Helbig```sh
34*421ee5a8SDirk Helbignrfjprog --program ble5-ctr-rpmsg_3424.hex --chiperase --coprocessor CP_NETWORK -r --verify
35*421ee5a8SDirk Helbig```
36*421ee5a8SDirk Helbig
37*421ee5a8SDirk Helbigthe corresponding hex file is in the [nrfConnectSDK](https://github.com/nrfconnect/sdk-nrf/blob/main/lib/bin/bt_ll_acs_nrf53/bin)
38*421ee5a8SDirk Helbig
39*421ee5a8SDirk Helbig## Usage / Find Serial Port
40*421ee5a8SDirk Helbig
41*421ee5a8SDirk HelbigOn macOS, the nRF5340 with the HCI bridge show up as 5 /dev/tty. To find the HCI one, list all /dev/tty.* devices,
42*421ee5a8SDirk Helbigthen press and hold the RESET button and list all devices again. The missing one is the one provided by the HCI bridge.
43*421ee5a8SDirk Helbig
44*421ee5a8SDirk Helbig## HCI log
45*421ee5a8SDirk Helbig
46*421ee5a8SDirk Helbig```sh
47*421ee5a8SDirk Helbigbtmon -J nrf5340_xxaa_app -w <logfile>
48*421ee5a8SDirk Helbig```
49