Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toolkit-nrf52840

Three tools to work with a nRF52840 dongle (PCA10059): flash it, push CircuitPython code on it, and build a Zephyr firmware for it.

They chain together: flash the dongle, prototype fast in CircuitPython, then move to Zephyr when you need to tune the BLE stack (MTU, intervals, SMP).

Install

pip install pyusb pyserial ecdsa

Usage

Check what the dongle is currently running:

bash nrf52840-flasher/check_dongle.sh

Then flash it. You need a .zip DFU package, not a .hex, and it has to be a v2 package : this dongle runs the Nordic Open DFU bootloader, which cannot read the legacy packages adafruit-nrfutil writes. Build one with Nordic's nrfutil :

nrfutil keys generate priv.pem
nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application app.hex --application-version 1 --key-file priv.pem firmware.zip

sudo python3 nrf52840-flasher/flash_nrf52840.py firmware.zip

If nrfutil misbehaves — installing adafruit-nrfutil next to it overwrites its command line — nrf52840-flasher/mkpkg_v2.py builds the same package without going through the CLI.

If you would rather not build a package at all, nRF Connect Programmer takes the .hex directly and does it for you. Turn Auto read memory off first, it freezes the bootloader before you get to press Write.

Flashing itself needs no nrfutil, only pyusb. It is the packaging step that does.

Each folder has its own README. When something goes wrong, read TROUBLESHOOTING.md before anything else.

No firmware binary is shipped here. See FIRMWARES.md for which one to use and where to get it.

Support

Tested on a nRF52840 dongle (PCA10059), on Kali and Debian.

Credits

Written by T.I.V while learning Bluetooth Low Energy.

License

MIT, see LICENSE. One exception: zephyr-ble-peripheral/ is Apache-2.0, the Zephyr license, like any Zephyr application.

About

Three tools for the nRF52840 dongle: DFU flashing over USB without nrfutil, CircuitPython push/run over the serial REPL, and a Zephyr BLE peripheral.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages