Building & Programming
Note: This is if you want to use Circuit Dojo's Zephyr Tools extension.
Building
In VSCode you can build a project with the
Zephyr Tools: Build
or
Zephyr Tools: Build Pristine
commands.
You can also build manually by running this in your application root:
west build -b circuitdojo_feather_nrf9161/nrf9161/ns -p -d build/circuitdojo_feather_nrf9161 --sysbuild
Note: the board target name has changed in NCS 2.7 for usage with west
it's now: circuitdojo_feather_nrf9161/nrf9161/ns
Programming
You can easily program the nRF9161 Feather with the onboard CMSIS-DAP using:
pyocd
probe-rs
You can select a runner using
Zephyr Tools: Change Runner
or use the default (pyocd
) to flash
Zephyr Tools: Flash
Make sure that pyocd
is installed first. See how to install in the next section.
pyocd
pyocd
is recommended as it's well tested with the nRF9161 Feather.
On Mac: before installing you'll need to install libusb
using brew
:
brew install libusb
To install run:
python3 -m pip install -U pyocd
pyocd pack install nRF9160_xxAA
You may need to add the binaries to your path. For instance, if you're using the Zephyr Tools venv, binaries live in:
/home/jaredwolff/.zephyrtools/env/bin/pyocd
More information on installing pyocd
can be found on their website.
Usage examples:
The easiest way to use it is by using the --runner
flag with west
west flash --runner pyocd
You can run it manually as well:
pyocd reset --target nrf9160_xxaa
pyocd load --target nRF9160_xxAA --format hex /home/jaredwolff/Git/blucloud/app/build/zephyr/merged.hex
pyocd erase --target nrf9160_xxaa --chip
You can also change/upgrade the modem firmware if you need to:
python3 nfed/scripts/modem_firmware_update.py scripts/mfw_nrf91x1_2.0.1.zip
Script is here.
probe-rs
To install use:
cargo install probe-rs-tools --git https://github.com/probe-rs/probe-rs --rev g21a3d98d
Note: Make sure you use the revision indicateda above. There are multiple improvements which makes programming several seconds speedier than pyocd
Then you can program using:
probe-rs download --chip nRF9160_xxAA --binary-format hex path/to/merged.hex --allow-erase-all
And once the probe-rs
runner has made its way to NCS:
west flash --runner probe-rs
More info on probe-rs
can be found on their website.