Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Cannot execute binary file #422

Open
adrien3d opened this issue Aug 12, 2023 · 2 comments
Open

Cannot execute binary file #422

adrien3d opened this issue Aug 12, 2023 · 2 comments
Labels
type: bug Something isn't working

Comments

@adrien3d
Copy link

adrien3d commented Aug 12, 2023

Describe the bug
While trying to cargo run this project on my Mac OS 13.5 M1, with rustc 1.71.1 (eb26296b5 2023-08-03) I have the following error:

   Compiling rs-nrf-fw v0.1.0 (/Users/adrien/Dev/rust/rs-nrf-fw)
    Finished dev [unoptimized + debuginfo] target(s) in 30.20s
     Running `target/thumbv7em-none-eabihf/debug/rs-nrf-fw`
target/thumbv7em-none-eabihf/debug/rs-nrf-fw: target/thumbv7em-none-eabihf/debug/rs-nrf-fw: cannot execute binary file

I suspect it is linked to the fact I am using thumbv7em-none-eabihf with hf at the end, and this nrf52840-sample, which is basically based on a bump version of defmt of a 3 year old example project from this tutorial, produces a similar error:

    Finished dev [unoptimized + debuginfo] target(s) in 18.97s
     Running `target/thumbv7em-none-eabihf/debug/nrf52840dk-sample`
target/thumbv7em-none-eabihf/debug/nrf52840dk-sample: target/thumbv7em-none-eabihf/debug/nrf52840dk-sample: cannot execute binary file```
@adrien3d adrien3d changed the title Cannot build program: linking with rust-lld failed Cannot execute binary file Aug 12, 2023
@adrien3d adrien3d reopened this Aug 12, 2023
@Urhengulas Urhengulas added the type: bug Something isn't working label Aug 14, 2023
@Urhengulas
Copy link
Member

Can you please try what happens if you execute it with probe-rs run instead of probe-run?

You can install the probe-rs cli with:

$ cargo install probe-rs --features cli

And then change your .cargo/config.toml like this:

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

@Urhengulas
Copy link
Member

What also seems off is the fact that your Running ... line does not mention probe-run. It should look like following:

$ cargo rb hello
    Finished dev [optimized + debuginfo] target(s) in 0.02s
     Running `probe-run --chip nRF52840_xxAA target/thumbv7em-none-eabihf/debug/hello`

@Urhengulas Urhengulas transferred this issue from knurling-rs/defmt Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants