~witcher/hci-dongle

Sources to use the nRF52840 Dongle with HCI for my bachelor thesis.
use public-inbox as mailing list
build: Introduce Makefile

clone

read-only
https://git.sr.ht/~witcher/hci-dongle
read/write
git@git.sr.ht:~witcher/hci-dongle

You can also use your local clone with git send-email.

#hci-dongle

This is the source code used for the nRF52840 used in my bachelor thesis.

It is taken verbatim from https://github.com/zephyrproject-rtos/zephyr/tree/f393e2205c2c71d05dcefeffddc4bc429911e12e/samples/bluetooth/hci_usb.
The only changes made here are to the prj.conf to allow:

  • a DLE of 251 bytes
  • 2M PHY mode

#Compiling

Install the Zephyr toolchain.

After compiling, the output files will be in $(OUTDIR)/zephyr/ in various formats.

#Using the Makefile

To compile the image using the Makefile use

make

Flashing is done with

make flash FLASH_PORT=/path/to/device

where /path/to/device is the path the device that should be flashed can be accessed from, e.g. /dev/ttyACM2.

The variable FLASH_PORT can also be set in config.mk. If set it doesn't need to be given as a parameter anymore.

#Using CMake/Ninja

Simply invoke the following commands:

cmake -Bbuild -GNinja -DBOARD=nrf52840dongle_nrf52840 .
ninja -Cbuild

#Using west

west build \
  -p always \
  -b nrf52840dongle_nrf52840 \
  .

#Flashing

To flash the image to the nRF52840 Dongle (the dongle used in my bachelor thesis), make sure you have nrfutil installed.

First, generate the required zip file from the compiled hex one:

nrfutil pkg generate \
  --hw-version 52 \
  --sd-req=0x00 \
  --application build/zephyr/zephyr.hex \
  --application-version 1 \
  hci_usb.zip

Then, flash that to the board (assumed to be connected to /dev/ttyACM0, please check before flashing):

nrfutil dfu usb-serial \
  --package hci_usb.zip \
  -p /dev/ttyACM0

#Resources

Send patches and questions to ~witcher/public-inbox@lists.sr.ht.

Instructions for preparing a patch are available at git-send-email.io.

Do not follow this link