Adafruit nRF52840 Feather Express

Adafruit nRF52840 Feather Express

back to microcontrollers page.

Links

Adafruit nRF52840 Feather Express, VolksEEG: Rust Development On Adafruit nRF52840 Feather Express, crates.io: adafruit-nrf52840-express,

crates.io: bluetooth_mesh github: Bluetooth Mesh Rust, burble Blackrock User-Mode Bluetooth LE Library, bluest Cross-platform Bluetooth LE crate for Rust, BlueR — Official BlueZ Bindings for Rust, btleplug is an async Rust BLE library, Blendr is a terminal UI app for browsing BLE (Bluetooth Low Energy) devices, bleasy High-level BLE communication library for Rust, ble-ledly Customizable and extensible cross-platform high-level Bluetooth Low Energy light controller,

local links

GoodFET42, StarLabs StarBook,

History

2025-02-08: bluetooth_mesh crate is a bit old, but have nice diagrams showing how a mesh works.

2025-02-06: pi5 - probe-rs debug

tingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ probe-rs debug
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0001000: CIDR0 has invalid preamble (expected 0xd, got 0x0)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0001000: CIDR2 has invalid preamble (expected 0x5, got 0x0)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0001000: CIDR3 has invalid preamble (expected 0xb1, got 0x0)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0000000: CIDR0 has invalid preamble (expected 0xd, got 0xb1)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0000000: CIDR1 has invalid preamble (expected 0x0, got 0x1)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0000000: CIDR2 has invalid preamble (expected 0x5, got 0xb1)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0040000: CIDR0 has invalid preamble (expected 0xd, got 0x0)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0040000: CIDR2 has invalid preamble (expected 0x5, got 0x0)
 WARN probe_rs::architecture::arm::memory::romtable: Component at 0xe0040000: CIDR3 has invalid preamble (expected 0xb1, got 0x0)
Core is running.
>> help
The following commands are available:
 - step
 - halt
 - status
 - run
 - quit
 - read8
 - read16
 - read32
 - read64
 - write8
 - write16
 - write32
 - write64
 - break
 - clear_break
 - list_break
 - bt
 - regs
 - fp_regs
 - locals
 - up
 - down
 - reset
 - dump
Core is running.
>> status
Status: Running
Core is running.
>> halt
Core stopped at address 0x000457c8
0x457c8: b #0x457c8
0x457ca: bmi #0x45776
>> reset
>> status
Status: Halted(Exception)
Core halted at address 0x00000a80
XPSR: 0x01000000
>> run
Core is running.
>> 

2025-02-06: pi5 - mesh-cfgclient

[mesh-cfgclient]# list-nodes
Mesh node:
    UUID = F81C7F394D0D4E4E93783050DF4723C3
    primary = 0001
    net_keys = 0 (0x000) , 
    elements (1):

2025-02-06: p5 - probe-rs

tingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ probe-rs info
Probing target via JTAG

Error identifying target using protocol JTAG: The probe does not support the JTAG protocol.

Probing target via SWD

ARM Chip with debug port Default:
Debug Port: DPv1, DP Designer: ARM Ltd
├── 0 MemoryAP (AmbaAhb3)   └── ROM Table (Class 1), Designer: Nordic VLSI ASA
│       ├── Cortex-M4 SCS   (Generic IP component)          └── CPUID
│              ├── IMPLEMENTER: ARM Ltd
│              ├── VARIANT: 0              ├── PARTNO: Cortex-M4
│              └── REVISION: 1       ├── Cortex-M3 DWT   (Generic IP component)       ├── Cortex-M3 FBP   (Generic IP component)       ├── Cortex-M3 ITM   (Generic IP component)       ├── Cortex-M4 TPIU  (Coresight Component)       └── Cortex-M4 ETM   (Coresight Component)
└── 1 Unknown AP (Designer: Nordic VLSI ASA, Class: Undefined, Type: 0x0, Variant: 0x0, Revision: 0x0)


Debugging RISC-V targets over SWD is not supported. For these targets, JTAG is the only supported protocol. RISC-V specific information cannot be printed.
Debugging Xtensa targets over SWD is not supported. For these targets, JTAG is the only supported protocol. Xtensa specific information cannot be printed.

2025-02-06: pi5 - start mesh-cfgclient

tingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ mesh-cfgclient

Warning: config file "/home/tingo/.config/meshcfg/config_db.json" not found
[mesh-cfgclient]# create
Created new node with token 4bf2e146596c747a
Proxy added: org.bluez.mesh.Node1 (/org/bluez/mesh/nodef81c7f394d0d4e4e93783050df4723c3)
Proxy added: org.bluez.mesh.Management1 (/org/bluez/mesh/nodef81c7f394d0d4e4e93783050df4723c3)
Attached with path /org/bluez/mesh/nodef81c7f394d0d4e4e93783050df4723c3
[mesh-cfgclient]# appkey-create 0 0
[mesh-cfgclient]# help
Menu main:
Available commands:
-------------------
config                                            Configuration Model Submenu
create [unicast_range_low]                        Create new mesh network with one initial node
discover-unprovisioned <on/off> [seconds]         Look for devices to provision
appkey-create <net_idx> <app_idx>                 Create a new local AppKey
appkey-import <net_idx> <app_idx> <key>           Import a new local AppKey
appkey-update <app_idx>                           Update local AppKey
appkey-delete <app_idx>                           Delete local AppKey
subnet-create <net_idx>                           Create a new local subnet (NetKey)
subnet-import <net_idx> <key>                     Import a new local subnet (NetKey)
subnet-update <net_idx>                           Update local subnet (NetKey)
subnet-delete <net_idx>                           Delete local subnet (NetKey)
subnet-set-phase <net_idx> <phase>                Set subnet (NetKey) phase
list-unprovisioned                                List unprovisioned devices
provision <uuid>                                  Initiate provisioning
node-import <uuid> <net_idx> <primary> <ele_count> <dev_key> Import an externally provisioned remote node
list-nodes                                        List remote mesh nodes
keys                                              List available keys
export-db                                         Export mesh configuration database
menu <name>                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print environment variables
[mesh-cfgclient]# discover-unprovisioned on
Unprovisioned scan started
[mesh-cfgclient]# list-unprovisioned
Unprovisioned devices:
sh
tingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ mesh-cfgclient

Warning: config file "/home/tingo/.config/meshcfg/config_db.json" not found
[mesh-cfgclient]# create
Created new node with token 4bf2e146596c747a
Proxy added: org.bluez.mesh.Node1 (/org/bluez/mesh/nodef81c7f394d0d4e4e93783050df4723c3)
Proxy added: org.bluez.mesh.Management1 (/org/bluez/mesh/nodef81c7f394d0d4e4e93783050df4723c3)
Attached with path /org/bluez/mesh/nodef81c7f394d0d4e4e93783050df4723c3
[mesh-cfgclient]# appkey-create 0 0
[mesh-cfgclient]# help
Menu main:
Available commands:
-------------------
config                                            Configuration Model Submenu
create [unicast_range_low]                        Create new mesh network with one initial node
discover-unprovisioned <on/off> [seconds]         Look for devices to provision
appkey-create <net_idx> <app_idx>                 Create a new local AppKey
appkey-import <net_idx> <app_idx> <key>           Import a new local AppKey
appkey-update <app_idx>                           Update local AppKey
appkey-delete <app_idx>                           Delete local AppKey
subnet-create <net_idx>                           Create a new local subnet (NetKey)
subnet-import <net_idx> <key>                     Import a new local subnet (NetKey)
subnet-update <net_idx>                           Update local subnet (NetKey)
subnet-delete <net_idx>                           Delete local subnet (NetKey)
subnet-set-phase <net_idx> <phase>                Set subnet (NetKey) phase
list-unprovisioned                                List unprovisioned devices
provision <uuid>                                  Initiate provisioning
node-import <uuid> <net_idx> <primary> <ele_count> <dev_key> Import an externally provisioned remote node
list-nodes                                        List remote mesh nodes
keys                                              List available keys
export-db                                         Export mesh configuration database
menu <name>                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print environment variables
[mesh-cfgclient]# discover-unprovisioned on
Unprovisioned scan started
[mesh-cfgclient]# list-unprovisioned
Unprovisioned devices:
[..]
Scan result:
    rssi = -63
    UUID = A4D1AE1E6DAD423482B5B7395ECC94C8
    OOB = A040
[mesh-cfgclient]# discover-unprovisioned off
[mesh-cfgclient]# provision A4D1AE1E6DAD423482B5B7395ECC94C8
Provisioning started
Provisioning failed:
    UUID = A4D1AE1E6DAD423482B5B7395ECC94C8
    bad-pdu
[mesh-cfgclient]# provision A4D1AE1E6DAD423482B5B7395ECC94C8
Provisioning started
Provisioning failed:
    UUID = A4D1AE1E6DAD423482B5B7395ECC94C8
    bad-pdu

2025-02-06: pi5 - start bluetooth-meshd i debug mode

tingo@tipi5-linux:~ $ sudo /usr/libexec/bluetooth/bluetooth-meshd -nd --debug
D-Bus ready
Loading node configuration from /var/lib/bluetooth/mesh
mesh/mesh-mgmt.c:mesh_mgmt_list() send read index_list
mesh/mesh.c:mesh_init() io 0x5555d96ce760
mesh/mesh-mgmt.c:read_index_list_cb() Number of controllers: 1
mesh/mesh-mgmt.c:read_info_cb() hci 0 status 0x00
mesh/mesh-mgmt.c:read_info_cb() settings: supp 0001feff curr 00000ad1
mesh/mesh-mgmt.c:features_cb() Status: 0, Length: 4
up:1 pwr: 1 mesh: 1
mesh/mesh-io-mgmt.c:read_info_cb() hci 0 status 0x00
Controller hci 0 already in use (ad1)
mesh/mesh-io-mgmt.c:ctl_up() HCI0 is up status: 0
mesh/mesh-io-mgmt.c:ctl_up() done 0 mesh startup
mesh_ready_callback
Added Network Interface on /org/bluez/mesh
mesh/mesh-io-mgmt.c:mesh_up() HCI0 Mesh up status: 0
[..]

2025-02-06: pi5 - flash the drogue-device example for nrf52, adafruit feather, bootloader

ingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ cargo flash --manifest-path ../boot/Cargo.toml --release --chip nRF52840_xxAA
   Compiling compiler_builtins v0.1.85
   Compiling core v0.0.0 (/home/tingo/.rustup/toolchains/nightly-2023-02-07-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling proc-macro2 v1.0.56
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.26
   Compiling futures-core v0.3.28
   Compiling syn v1.0.109
   Compiling semver v1.0.17
   Compiling futures-task v0.3.28
   Compiling futures-util v0.3.28
   Compiling rustc_version v0.4.0
   Compiling semver-parser v0.7.0
   Compiling heapless v0.7.16
   Compiling semver v0.9.0
   Compiling cortex-m v0.7.7
   Compiling rustc_version v0.2.3
   Compiling ident_case v1.0.1
   Compiling fnv v1.0.7
   Compiling embassy-sync v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling atomic-polyfill v1.0.2
   Compiling strsim v0.10.0
   Compiling bare-metal v0.2.5
   Compiling autocfg v1.1.0
   Compiling cortex-m-rt v0.7.3
   Compiling num-traits v0.2.15
   Compiling futures-channel v0.3.28
   Compiling az v1.2.1
   Compiling embassy-executor v0.1.1 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling typenum v1.16.0
   Compiling fixed v1.23.1
   Compiling nrf52840-pac v0.12.2
   Compiling embassy-cortex-m v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling adafruit-feather-nrf52840-bootloader v0.1.0 (/home/tingo/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/boot)
   Compiling darling_core v0.13.4
   Compiling cortex-m-rt-macros v0.7.0
   Compiling darling_macro v0.13.4
   Compiling darling v0.13.4
   Compiling embassy-macros v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling rustc-std-workspace-core v1.99.0 (/home/tingo/.rustup/toolchains/nightly-2023-02-07-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling critical-section v1.1.1
   Compiling futures-sink v0.3.28
   Compiling pin-project-lite v0.2.9
   Compiling pin-utils v0.1.0
   Compiling byteorder v1.4.3
   Compiling nb v1.1.0
   Compiling nb v0.1.3
   Compiling hash32 v0.2.1
   Compiling void v1.0.2
   Compiling cfg-if v1.0.0
   Compiling stable_deref_trait v1.2.0
   Compiling embedded-hal v0.2.7
   Compiling embedded-io v0.4.0
   Compiling vcell v0.1.3
   Compiling volatile-register v0.2.1
   Compiling bitfield v0.13.2
   Compiling embedded-storage v0.3.0
   Compiling static_cell v1.0.0
   Compiling embedded-hal v1.0.0-alpha.9
   Compiling embedded-storage-async v0.3.0
   Compiling embedded-hal-async v0.2.0-alpha.0
   Compiling half v2.2.1
   Compiling bytemuck v1.13.1
   Compiling embassy-hal-common v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling futures-io v0.3.28
   Compiling futures v0.3.28
   Compiling embassy-embedded-hal v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling embassy-time v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling rand_core v0.6.4
   Compiling embassy-usb-driver v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling signature v1.6.4
   Compiling nrf-softdevice-mbr v0.1.1 (https://github.com/embassy-rs/nrf-softdevice.git?branch=master#a661d371)
   Compiling embassy-boot v0.1.1 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling nrf-softdevice-mbr v0.1.1 (https://github.com/embassy-rs/nrf-softdevice.git?rev=e8ee783fdd9674a061c2479d0a29e87e4e2a6d2f#e8ee783f)
   Compiling embassy-nrf v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling embassy-boot-nrf v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling adafruit-feather-nrf52 v0.1.0 (/home/tingo/personal/projects/2025/rust/drogue-device/boards/adafruit-feather-nrf52)
    Finished release [optimized + debuginfo] target(s) in 1m 26s
    Flashing /home/tingo/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/boot/target/thumbv7em-none-eabihf/release/adafruit-feather-nrf52840-bootloader
      Erasing  100% [####################]  12.00 KiB @  39.47 KiB/s (took 0s)
  Programming  100% [####################]   8.00 KiB @  28.97 KiB/s (took 0s)                                                                                           Finished in 0.90s
 WARN probe_rs::architecture::arm::core::armv7m: Core is running, but we expected it to be halted

flash softdevice

tingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ probe-rs download ~/personal/projects/2025/rust/nrf52/s140_nrf52_7.3.0_softdevice.hex --chip nRF52840_xxAA --binary-format Hex
      Erasing  100% [####################] 156.00 KiB @  38.86 KiB/s (took 4s)
  Programming  100% [####################] 156.00 KiB @  40.65 KiB/s (took 4s)                                                                                                                                  
Finished in 7.85s

flash example

ingo@tipi5-linux:~/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ cargo flash --release --chip nRF52840_xxAA
warning: skipping duplicate package `basic` found at `/home/tingo/.cargo/git/checkouts/btmesh-e14acedbce757b27/2ae1440/btmesh-nrf-softdevice/examples/nrf52840-dk/basic`
   Compiling compiler_builtins v0.1.85
   Compiling core v0.0.0 (/home/tingo/.rustup/toolchains/nightly-2023-02-07-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling version_check v0.9.4
   Compiling proc-macro2 v1.0.56
   Compiling quote v1.0.26
   Compiling unicode-ident v1.0.8
   Compiling typenum v1.16.0
   Compiling generic-array v0.14.7
   Compiling syn v1.0.109
   Compiling thiserror v1.0.40
   Compiling syn v2.0.13
   Compiling serde_derive v1.0.160
   Compiling semver v1.0.17
   Compiling rustc_version v0.4.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling defmt v0.3.4
   Compiling serde v1.0.160
   Compiling defmt-macros v0.3.4
   Compiling heapless v0.7.16
   Compiling futures-core v0.3.28
   Compiling futures-task v0.3.28
   Compiling futures-util v0.3.28
   Compiling strsim v0.10.0
   Compiling ident_case v1.0.1
   Compiling fnv v1.0.7
   Compiling embassy-sync v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling libc v0.2.141
   Compiling autocfg v1.1.0
   Compiling thiserror-impl v1.0.40
   Compiling futures-macro v0.3.28
   Compiling defmt-parser v0.3.2
   Compiling semver-parser v0.7.0
   Compiling memchr v2.5.0
   Compiling futures-channel v0.3.28
   Compiling atomic-polyfill v1.0.2
   Compiling semver v0.9.0
   Compiling cortex-m v0.7.7
   Compiling cfg-if v1.0.0
   Compiling rustc_version v0.2.3
   Compiling bare-metal v0.2.5
   Compiling darling_core v0.13.4
   Compiling once_cell v1.17.1
   Compiling num-traits v0.2.15
   Compiling cortex-m-rt v0.7.3
   Compiling cipher v0.3.0
   Compiling hash32-derive v0.1.1
   Compiling ahash v0.7.6
   Compiling ucd-trie v0.1.5
   Compiling az v1.2.1
   Compiling pest v2.5.7
   Compiling rustc-std-workspace-core v1.99.0 (/home/tingo/.rustup/toolchains/nightly-2023-02-07-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling darling_macro v0.13.4
   Compiling subtle v2.4.1
   Compiling bitflags v1.3.2
   Compiling byteorder v1.4.3
   Compiling stable_deref_trait v1.2.0
   Compiling hash32 v0.2.1
   Compiling rand_core v0.6.4
   Compiling nb v1.1.0
   Compiling futures-sink v0.3.28
   Compiling embedded-io v0.4.0
   Compiling pin-utils v0.1.0
   Compiling opaque-debug v0.3.0
   Compiling pin-project-lite v0.2.9
   Compiling nb v0.1.3
   Compiling crypto-common v0.1.6
   Compiling critical-section v1.1.1
   Compiling void v1.0.2
   Compiling embedded-hal v0.2.7
   Compiling zeroize v1.6.0
   Compiling embedded-hal v1.0.0-alpha.9
   Compiling embedded-hal-async v0.2.0-alpha.0
   Compiling dbl v0.3.2
   Compiling base16ct v0.1.1
   Compiling futures-io v0.3.28
   Compiling vcell v0.1.3
   Compiling embedded-storage v0.3.0
   Compiling volatile-register v0.2.1
   Compiling block-buffer v0.10.4
   Compiling embedded-storage-async v0.3.0
   Compiling darling v0.13.4
   Compiling bitfield v0.13.2
   Compiling digest v0.10.6
   Compiling crypto-mac v0.11.1
   Compiling ctr v0.8.0
   Compiling aead v0.4.3
   Compiling cipher v0.2.5
   Compiling const-oid v0.7.1
   Compiling futures v0.3.28
   Compiling der v0.5.1
   Compiling ccm v0.4.4
   Compiling cmac v0.6.0
   Compiling aes v0.7.5
   Compiling embassy-time v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling static_cell v1.0.0
   Compiling ff v0.11.1
   Compiling inout v0.1.3
   Compiling uuid v1.3.1
   Compiling const-oid v0.9.2
   Compiling embassy-hal-common v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling aho-corasick v0.7.20
   Compiling getrandom v0.2.9
   Compiling cortex-m-rt-macros v0.7.0
   Compiling lazy_static v1.4.0
   Compiling embassy-executor v0.1.1 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling nrf52840-pac v0.12.2
   Compiling fixed v1.23.1
   Compiling regex-syntax v0.6.29
   Compiling btmesh-common v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling der v0.6.1
   Compiling sec1 v0.2.1
   Compiling cipher v0.4.4
   Compiling group v0.11.0
   Compiling hmac v0.12.1
   Compiling embassy-macros v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling crypto-bigint v0.3.2
   Compiling regex v1.7.3
   Compiling universal-hash v0.5.0
   Compiling ff v0.12.1
   Compiling half v2.2.1
   Compiling bytemuck v1.13.1
   Compiling pest_meta v2.5.7
   Compiling darling_core v0.14.4
   Compiling embassy-cortex-m v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling pest_generator v2.5.7
   Compiling group v0.12.1
   Compiling polyval v0.6.0
   Compiling elliptic-curve v0.11.12
   Compiling hkdf v0.12.3
   Compiling sec1 v0.3.0
   Compiling hashbrown v0.12.3
   Compiling darling_macro v0.14.4
   Compiling embassy-embedded-hal v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling aes-soft v0.6.4
   Compiling crypto-mac v0.10.1
   Compiling crypto-bigint v0.4.9
   Compiling cobs v0.2.3
   Compiling cpufeatures v0.2.6
   Compiling serde_json v1.0.95
   Compiling async-trait v0.1.68
   Compiling dlv-list v0.3.0
   Compiling prettyplease v0.1.25
   Compiling ordered-multimap v0.4.3
   Compiling elliptic-curve v0.12.3
   Compiling postcard v1.0.4
   Compiling cmac v0.5.1
   Compiling aes v0.6.0
   Compiling darling v0.14.4
   Compiling pest_derive v2.5.7
   Compiling p256 v0.10.1
   Compiling ghash v0.5.0
   Compiling ctr v0.9.2
   Compiling aes v0.8.2
   Compiling aead v0.5.2
   Compiling embassy-futures v0.1.0
   Compiling micromath v2.0.0
   Compiling no-std-net v0.5.0
   Compiling embassy-usb-driver v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling lock_api v0.4.9
   Compiling itoa v1.0.6
   Compiling ryu v1.0.13
   Compiling minimal-lexical v0.2.1
   Compiling base64 v0.13.1
   Compiling linked-hash-map v0.5.6
   Compiling httparse v1.8.0
   Compiling yaml-rust v0.4.5
   Compiling ron v0.7.1
   Compiling nom v7.1.3
   Compiling embedded-nal v0.6.0
   Compiling btmesh-models v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling aes-gcm v0.10.1
   Compiling btmesh-pdu v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling json5 v0.4.1
   Compiling lorawan v0.7.1
   Compiling p256 v0.11.1
   Compiling rust-ini v0.18.0
   Compiling Inflector v0.11.4
   Compiling sha2 v0.10.6
   Compiling toml v0.5.11
   Compiling as-slice v0.2.1
   Compiling signature v1.6.4
   Compiling scopeguard v1.1.0
   Compiling no-std-net v0.6.0
   Compiling ppv-lite86 v0.2.17
   Compiling arrayvec v0.7.2
   Compiling num_enum_derive v0.5.11
   Compiling pathdiff v0.2.1
   Compiling minicbor v0.18.0
   Compiling config v0.13.3
   Compiling uluru v3.0.0
   Compiling rand_chacha v0.3.1
   Compiling num_enum v0.5.11
   Compiling embedded-nal-async v0.4.0
   Compiling embassy-boot v0.1.1 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling lorawan-device v0.8.0
   Compiling btmesh-macro v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling embedded-tls v0.12.0
   Compiling nrf-softdevice-macro v0.1.0 (https://github.com/embassy-rs/nrf-softdevice.git?rev=e8ee783fdd9674a061c2479d0a29e87e4e2a6d2f#e8ee783f)
   Compiling btmesh-device v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling btmesh-bearer v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling base64 v0.21.0
   Compiling nourl v0.1.1
   Compiling bit_field v0.10.2
   Compiling nrf-softdevice-s140 v0.1.1 (https://github.com/embassy-rs/nrf-softdevice.git?rev=e8ee783fdd9674a061c2479d0a29e87e4e2a6d2f#e8ee783f)
   Compiling hex v0.4.3
   Compiling half v1.8.2
   Compiling drogue-device v0.1.0 (/home/tingo/personal/projects/2025/rust/drogue-device/device)
   Compiling embassy-nrf v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling nrf-softdevice v0.1.0 (https://github.com/embassy-rs/nrf-softdevice.git?rev=e8ee783fdd9674a061c2479d0a29e87e4e2a6d2f#e8ee783f)
   Compiling reqwless v0.5.0
   Compiling serde_cbor v0.11.2
   Compiling embassy-lora v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling btmesh-driver v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
   Compiling futures-intrusive v0.4.2
   Compiling drogue-device-macros v0.1.0 (/home/tingo/personal/projects/2025/rust/drogue-device/macros)
   Compiling embedded-update v0.10.0
   Compiling nrf-softdevice-mbr v0.1.1 (https://github.com/embassy-rs/nrf-softdevice.git?branch=master#a661d371)
   Compiling adafruit-nrf-feather52840-bt-mesh v0.1.0 (/home/tingo/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh)
   Compiling embassy-boot-nrf v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=e3f8020c3bdf726dfa451b5b190f27191507a18f#e3f8020c)
   Compiling adafruit-feather-nrf52 v0.1.0 (/home/tingo/personal/projects/2025/rust/drogue-device/boards/adafruit-feather-nrf52)
   Compiling panic-reset v0.1.1
   Compiling btmesh-nrf-softdevice v0.1.0 (https://github.com/drogue-iot/btmesh.git?branch=main#2ae14405)
    Finished release [optimized + debuginfo] target(s) in 3m 06s
    Flashing /home/tingo/personal/projects/2025/rust/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh/target/thumbv7em-none-eabihf/release/adafruit-nrf-feather52840-bt-mesh
ERROR probe_rs::architecture::arm::core::armv7m: The core is in locked up status as a result of an unrecoverable exception
      Erasing  100% [####################] 124.00 KiB @  38.61 KiB/s (took 3s)
  Programming  100% [####################] 124.00 KiB @  40.45 KiB/s (took 3s)                                                                                                                                  Finished in 6.28s
 WARN probe_rs::architecture::arm::core::armv7m: Expected core to be halted, but core is running

2025-01-30: try to convert an example to UF2 format:

tingo@kg-starone:~/personal/projects/2025/rust/embedded/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ cargo objcopy --bin adafruit-nrf-feather52840-bt-mesh -- -O binary adafruit-nrf-feather52840-bt-mesh.bin
warning: skipping duplicate package `basic` found at `/home/tingo/.cargo/git/checkouts/btmesh-e14acedbce757b27/2ae1440/btmesh-nrf-softdevice/examples/nrf52840-dk/basic`
    Finished dev [optimized + debuginfo] target(s) in 0.13s

check the file

tingo@kg-starone:~/personal/projects/2025/rust/embedded/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ file *bin
adafruit-nrf-feather52840-bt-mesh.bin: ARM Cortex-M firmware, initial SP at 0x20040000, reset at 0x00027100, NMI at 0x000521b0, HardFault at 0x00052e86, SVCall at 0x000521b0, PendSV at 0x000521b0

check memory.x

tingo@kg-starone:~/personal/projects/2025/rust/embedded/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ more memory.x 
MEMORY
{
  /* NOTE 1 K = 1 KiBi = 1024 bytes */
  MBR                               : ORIGIN = 0x00000000, LENGTH = 4K
  SOFTDEVICE                        : ORIGIN = 0x00001000, LENGTH = 155648
  FLASH                             : ORIGIN = 0x00027000, LENGTH = 256K
  BOOTLOADER                        : ORIGIN = 0x000f8000, LENGTH = 24K
  BOOTLOADER_STATE                  : ORIGIN = 0x000fe000, LENGTH = 4K
  STORAGE                           : ORIGIN = 0x000ff000, LENGTH = 4K
  RAM                               : ORIGIN = 0x2000c698, LENGTH = 211304

  /* DFU is stored in external flash */
  DFU                               : ORIGIN = 0x00000000, LENGTH = 266240
}

__bootloader_state_start = ORIGIN(BOOTLOADER_STATE);
__bootloader_state_end = ORIGIN(BOOTLOADER_STATE) + LENGTH(BOOTLOADER_STATE);

__bootloader_dfu_start = ORIGIN(DFU);
__bootloader_dfu_end = ORIGIN(DFU) + LENGTH(DFU);

__storage = ORIGIN(STORAGE);

uf2conv

tingo@kg-starone:~/personal/projects/2025/rust/embedded/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ uf2conv adafruit-nrf-feather52840-bt-mesh.bin --base 0x00027000 --output adafruit-nrf-feather52840-bt-mesh.uf2

check file

tingo@kg-starone:~/personal/projects/2025/rust/embedded/drogue-device/examples/nrf52/adafruit-feather-nrf52840/bt-mesh $ file *uf2
adafruit-nrf-feather52840-bt-mesh.uf2: UF2 firmware image, file size 00000000, address 0x027000, 721 total blocks

2025-01-30: double press reset button, and it shows up as a usb drive (UF2):

root@kg-starone:~ # ls /media/FTHR840BOOT
CURRENT.UF2 INDEX.HTM   INFO_UF2.TXT

check bootloader version

root@kg-starone:~ # cat /media/FTHR840BOOT/INFO_UF2.TXT
UF2 Bootloader 0.8.3-6-gf60ed7c lib/nrfx (v2.0.0) lib/tinyusb (0.12.0-145-g9775e7691) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Adafruit Feather nRF52840 Express
Board-ID: nRF52840-Feather-revE
Date: May  9 2024
SoftDevice: S140 6.1.1

2025-01-30: sb - connected to my FreeBSD laptop, usbconfig says

root@kg-starone:~ # usbconfig -d ugen0.6
ugen0.6: <Adafruit Industries Feather nRF52840 Express> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

device description

root@kg-starone:~ # usbconfig -d ugen0.6 dump_device_desc
ugen0.6: <Adafruit Industries Feather nRF52840 Express> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x00ef  <Miscellaneous device>
  bDeviceSubClass = 0x0002 
  bDeviceProtocol = 0x0001 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x239a 
  idProduct = 0x0029 
  bcdDevice = 0x0100 
  iManufacturer = 0x0001  <Adafruit Industries>
  iProduct = 0x0002  <Feather nRF52840 Express>
  iSerialNumber = 0x0003  <B1CBAAF19D5D25DE>
  bNumConfigurations = 0x0001 

2025-01-30: I created this page.