commit fa5e836688946db5f817428c0967996aba59b993 from: Thomas Böhler date: Tue Dec 6 14:01:07 2022 UTC Add README.md commit - fae2d8a4e5b5560b87cc38d5422f183cc02e178a commit + fa5e836688946db5f817428c0967996aba59b993 blob - /dev/null blob + e37535900c8c4e1ea4d11f5fbd8f8e76c5d7d3bb (mode 644) --- /dev/null +++ README.md @@ -0,0 +1,73 @@ +# 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).