rust-embedded / book

Documentation on how to use the Rust Programming Language to develop firmware for bare metal (microcontroller) devices
https://docs.rust-embedded.org/book/
Apache License 2.0
1.12k stars 179 forks source link

Tooling page is significantly outdated #355

Open burrbull opened 1 year ago

burrbull commented 1 year ago

https://github.com/rust-embedded/book/blob/master/src/intro/tooling.md

Nothing about probe-rs project; old Rust version, etc.

eldruin commented 1 year ago

Indeed. Thanks for noticing. To anybody reading this, please feel free to send a PR updating it. Here is an example of a more up-to-date setup

jonathanpallant commented 1 year ago

Yeah I came across this today and went to write up basically the same ticket.

jonathanpallant commented 1 year ago

I think the steps are now:

No OpenOCD required, nor arm-none-eabi-gcc.

You could still list GDB (or arm-none-eabi-gdb) as an optional thing, but you should probably call it through the rust-gdb wrapper script (first setting RUST_GDB=arm-none-eabi-gdb to it knows what to call).

Barbacamanitu commented 1 year ago

I think the steps are now:

  • Install rustup
  • Add appropriate targets (i.e. pre-compiled rust libraries) for your MCU
  • cargo install probe-run --features=cli

No OpenOCD required, nor arm-none-eabi-gcc.

You could still list GDB (or arm-none-eabi-gdb) as an optional thing, but you should probably call it through the rust-gdb wrapper script (first setting RUST_GDB=arm-none-eabi-gdb to it knows what to call).

Is there a guide somewhere on how to set this up? I just got my first STM chip to follow the embedded Rust book, and I'm not sure where to start or how to follow along since the tooling is outdated now. For now I guess I'm going to follow the current version of the book exactly just so I can get some code flashed to my board, but it would be nice to use the newer tools.

probe-rs sounds neat, but it also seems like its a library? I'm not sure how I'd use it to flash and debug. Any help would be appreciated.