Description
Embedded development involves cross compilation and remote debugging; the Rust toolchain doesn't
provide all the tools so you have to install external ones like: a cross linker (e.g.
arm-none-eabi-ld
), a cross debugger (e.g. arm-none-eabi-gdb
), some tool to communicate with the
remote target (e.g. OpenOCD
), etc.
It would be great if the user didn't have to figure out where to get all those tools and install
them manually.
There are a few upcoming changes that might affect this situation.
- A
lld
binary will be shipped with the Rust toolchain. cf. PR rust: Import LLD for linking wasm objects rust-lang/rust#48125
lld
is a multi-arch linker and it can be used to link ARM Cortex-M binaries so once this is in
place user won't need to install arm-none-eabi-ld
.
I don't think lld
supports any of the other embedded targets (MSP430, AVR or RISCV) though
- A
lldb
binary will shipped with the Rust toolchain. cf. issue Ship a custom LLDB with Rust support rust-lang/rust#48168
lldb
is a multi-arch debugger. I personally could never get it to work with OpenOCD; I never found
an equivalent to the monitor
and load
commands which are used to flash the binary into the
remote target. lldb
can debug ARM Cortex-M programs just fine; I have used it debug a emulated ARM
Cortex-M microcontroller (QEMU).
Maybe someone had more luck with it and can share their experience?
One way to address this setup problem could be to provide a installer (script) like
https://rustup.rs/ does but for each target architecture.
cc @jcsoo