Unable to parse command-line arguments: unused arguments left: --target
tobymurray opened this issue · comments
I believe I'm on to the next step, trying the example to flash my ESP32:
# Example for the ESP32
$ cargo espflash --chip esp32 --example esp32 --target xtensa-esp32-none-elf --speed 460800 --features="xtensa-lx-rt/lx6,xtensa-lx/lx6" /dev/ttyUSB0
Yields:
$ cargo espflash --chip esp32 --example esp32 --target xtensa-esp32-none-elf --speed 460800 --features="xtensa-lx-rt/lx6,xtensa-lx/lx6" /dev/ttyUSB0
thread 'main' panicked at 'Unable to parse command-line arguments: unused arguments left: --target, --speed, --features=xtensa-lx-rt/lx6,xtensa-lx/lx6', /home/toby/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-espflash-0.1.1/src/main.rs:13:29
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: cargo_espflash::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
It feels like this is a syntax thing, I'm not sure what exactly is going on. E.g.:
$ cargo espflash --chip esp32 --example esp32 /dev/ttyUSB0
error: target `esp32` in package `xtensa-quickstart` requires the features: `xtensa-lx-rt/lx6`, `xtensa-lx/lx6`, `esp32-hal`
Consider enabling them by passing, e.g., `--features="xtensa-lx-rt/lx6 xtensa-lx/lx6 esp32-hal"`
On Matrix I was advised:
try installing cargo-espflash from the repo instead of crates.io?
Doing so appears to get me further.
cargo install --git https://github.com/esp-rs/espflash/ cargo-espflash
Ah yes, looks like we need to release a new version of espflash to crates.io. @icewind1991 mind doing so when you have a minute?
new version of espflash has been released
I tried this again (with espflash on the head of master
):
$ cargo espflash --chip esp32 --example esp32 --target xtensa-esp32-none-elf --speed 460800 --features="xtensa-lx-rt/lx6,xtensa-lx/lx6,esp 32-hal" /dev/ttyUSB0
thread 'main' panicked at 'Unable to parse command-line arguments: unused arguments left: --target', cargo-espflash/src/main.rs:13:29
Any thoughts?
Hmm I thought I tried this and it worked.
You can work around this by not passing the target via the cli, but instead changing the target in .cargo/config
.