I am learning embedded Rust. I've setup the environment and am now following the Build It instructions.
When I verify that the produced executable is an ARM binary by running the command
cargo readobj --target thumbv7em-none-eabihf --bin led-roulette -- -file-headers
It generates an error:
error: no such subcommand: readobj
I've also tried the command
cargo readelf -h target/thumbv7em-none-eabihf/debug/led-roulette
It generates the error:
error: no such subcommand: readelf
Before running these commands, you have to install the tools as described in chapter 3.
If you did that already, then make sure you are in the src/05-led-roulette
directory.
The cargo package that we install by default doesn't provide the readobj subcommand, so you need to add this subcommand explicitly:
cargo install cargo-binutils --vers 0.1.4
Most answers here suggest installing version 0.1.4 of cargo-binutils
to fix this problem. Although this works, the recommended way is installing the latest stable version, and just after that install llvm-tools-preview
to supply all the missing commands:
$ cargo install cargo-binutils
$ rustup component add llvm-tools-preview
This is documented in the cargo-binutils crate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With