summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2022-10-20 10:35:07 +0200
committercos <cos>2022-10-20 11:39:04 +0200
commitcdbe26e2cc39cf9dbe88d60746b669eab89c3107 (patch)
treedc3cb7075f0eac78d1142c6ea0728cbedd03d565
parent18e448f2ef6632fbd63f3b9e7fac7f19f36d4e21 (diff)
downloadembassy-cdbe26e2cc39cf9dbe88d60746b669eab89c3107.zip
Switch to loading fw using a DFU package
Launching run.sh successfully results in the RGB LED to blink green. Following instructions found in [nrfutil_v6.1.0][]. [nrfutil_v6.1.0]: https://infocenter.nordicsemi.com/pdf/nrfutil_v6.1.0.pdf
-rwxr-xr-xexamples/nrf/run.sh14
-rw-r--r--examples/nrf/src/bin/blinky.rs2
2 files changed, 14 insertions, 2 deletions
diff --git a/examples/nrf/run.sh b/examples/nrf/run.sh
index 7503a6d5..20b4bc17 100755
--- a/examples/nrf/run.sh
+++ b/examples/nrf/run.sh
@@ -1,7 +1,19 @@
#!/bin/sh -eu
SUFFIX=$( ( sed -n 's/.*\(0x[0-9A-F]*\).*/\1/p' < memory.x;
sed -n 's/.*.*\(P[0-9_]*\).*/\1/p' src/bin/blinky.rs) | tr '\n' - )
+SD_REQ=0x00
cargo build --bin blinky
cp ./target/thumbv7em-none-eabi/debug/blinky \
./blinky-${SUFFIX%-}
-nrfdfu ./blinky-${SUFFIX%-}
+llvm-objcopy --output-target ihex \
+ ./target/thumbv7em-none-eabi/debug/blinky \
+ blinky-${SUFFIX%-}.hex
+nrfutil pkg generate --hw-version 52 \
+ --debug-mode --sd-req ${SD_REQ} \
+ --application blinky-${SUFFIX%-}.hex \
+ only_app-${SUFFIX%-}.zip
+nrfutil pkg display \
+ only_app-${SUFFIX%-}.zip
+nrfutil dfu usb-serial \
+ -p /dev/ttyACM0 -b 115200 \
+ -pkg only_app-${SUFFIX%-}.zip
diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs
index 1890cab5..eb548f16 100644
--- a/examples/nrf/src/bin/blinky.rs
+++ b/examples/nrf/src/bin/blinky.rs
@@ -10,7 +10,7 @@ use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = embassy_nrf::init(Default::default());
- let mut led = Output::new(p.P0_06, Level::Low, OutputDrive::Standard);
+ let mut led = Output::new(p.P1_09, Level::Low, OutputDrive::Standard);
loop {
led.set_high();