Tree


.gitignorecommits | blame
CMakeLists.txtcommits | blame
Kconfigcommits | blame
README.mdcommits | blame
README.rstcommits | blame
prj.confcommits | blame
sample.yamlcommits | blame
src/

README.md

# hci-dongle

This is the source code used for the nRF52840 used in my [bachelor
thesis](https://sr.ht/~witcher/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](https://docs.zephyrproject.org/latest/develop/getting_started/index.html).

After compiling, the output files will be in `build/zephyr/` in various formats.

### Using CMake/Ninja

Simply invoke the following commands:

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

### Using [west](https://docs.zephyrproject.org/latest/develop/west/index.html)

```sh
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`](https://github.com/NordicSemiconductor/pc-nrfutil) installed.

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

```sh
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):

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

## Resources

Send patches and questions to
[~witcher/bachelor-thesis@lists.sr.ht](https://lists.sr.ht/~witcher/bachelor-thesis).

Instructions for preparing a patch are available at
[git-send-email.io](https://git-send-email.io/).

Bugs and todo can be found at
[~witcher/bachelor-thesis](https://todo.sr.ht/~witcher/bachelor-thesis).