Embedded: Adafruit Feather nrf52 and probe-rs

I've recently started playing with Embassy, I am new it this, but it is so nice to do embedded work in Rust. Very unlike embedded work I have done in C. It is as if I have a protected OS keeping me safe. Actually, better than that. A couple times now I have been in entirely new territory, but once the compiler was happy…my code worked first time.

Anyway, it looks like I should be using probe-rs for lots of stuff,

And probe-rs works for some stuff, but not print debugging:

kentborg@theseion:~/programming/rust-code/nrf52-embassy-clock$ cargo embed --release 
    Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
      Config default
      Target /home/kentborg/programming/rust-code/nrf52-embassy-clock/target/thumbv7em-none-eabi/release/nrf52-embassy-clock
      Erasing ✔ [00:00:00] [##############################################################] 16.00 KiB/16.00 KiB @ 116.69 KiB/s (eta 0s )
  Programming ✔ [00:00:00] [###############################################################] 16.00 KiB/16.00 KiB @ 31.08 KiB/s (eta 0s )    Finished in 0.675s
        Done processing config default
 WARN probe_rs::architecture::arm::core::armv7m: Expected core to be halted, but core is running
kentborg@theseion:~/programming/rust-code/nrf52-embassy-clock$ 

That error looks wrong, I think it is supposed to not exit. (Though, I am new at this. Not clear what the working case looks like.)

My code programs into flash and it is running, I can press SW2 and see that my code is responding through the blue LED.

I can:

probe-rs gdb --chip nRF52832_xxAA 

…and connect to it with gdb, see where I am in source, set break points, etc.

I am talking to the board via the hobbyist version of the Segger SWD debugger.

In my Embed.toml I have:

[default.general]
chip = "nRF52832_xxAA"

[with_rtt.rtt]

In .cargo/config I have:

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip nRF52832_xxAA"

[build]
target = "thumbv7em-none-eabihf"

[env]
DEFMT_LOG = "trace"

Suggestions?

Thanks,

-kb

Suggestions…?

I got an answer over on https://matrix.to/#/#rust-embedded:matrix.org

Instead of trying to use probe-rs directly, use it via cargo run. That works for me.

The way I have been running a gdb server doesn't work at the same time, but Rust is so good about optimizing data away to where gdb can't find it that gdb hasn't been terribly useful to me so far, so I'll live with it.

Thanks,

-kb

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.