Open Erhannis opened 1 year ago
Hi there, sorry for the delay! Would you mind trying again with the 1.69 release? I believe this may now be fixed.
Hmm. It's been a while since I messed with this, but consulting the instructions, I tried updating everything and running again. I think I ran cargo install espup
and espup install
, and my rustc --version --verbose
reads
rustc 1.69.0-nightly (e7a099116 2023-04-17) (1.69.0.0)
binary: rustc
commit-hash: e7a0991164b497f97a9af93183eb4ea51d0f5c48
commit-date: 2023-04-17
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.0
(I've also run . ~/export-esp.sh
as instructed.)
However, I've cloned a clean copy of https://github.com/ivmarkov/rust-esp32-std-demo , and I'm getting an error at the end of cargo run
that I don't know how to follow. Here's the log (with the middle cut out).
~/clones/rust-esp32-std-demo_clean$ cargo run
Compiling compiler_builtins v0.1.87
...
Compiling url v2.3.1
Compiling mipidsi v0.5.0
Finished dev [optimized + debuginfo] target(s) in 4m 02s
Running `target/xtensa-esp32-espidf/debug/rust-esp32-std-demo`
target/xtensa-esp32-espidf/debug/rust-esp32-std-demo: 1: Syntax error: "(" unexpected
(I can add the middle back in if you want, but it looks like just a bunch more of the same.)
I'm not sure what to do with this; it looks like an error in an unnamed script file rather than an error in the named file, since that one is a binary, not a source, and I can't run it directly because
~/clones/rust-esp32-std-demo_clean$ target/xtensa-esp32-espidf/debug/rust-esp32-std-demo
bash: target/xtensa-esp32-espidf/debug/rust-esp32-std-demo: cannot execute binary file: Exec format error
Any ideas?
Note: I found this similar sounding issue: https://github.com/rust-lang/cargo/issues/8182 but 1. the error has a ")" instead of "(", which COULD be significant, and 2. cleaning doesn't fix the problem
that repo doesn't have a runner set in .cargo/config.toml
that's why cargo run is failing. Either set it up like the template or use cargo-espflash
. Then it should work :)
Ah; sorry, I forgot you needed to run it differently; that ran. Unfortunately, the problem remains - on rustc 1.69.0-nightly (e7a099116 2023-04-17) (1.69.0.0) the code deadlocks with a cap of 0, works with a cap of 1, but when compiled for my laptop (by copying the relevant code into a test project) it works fine with either of the caps.
I'm not sure who to file this report with, haha, but here seemed like the most correct, AFAICT. I cloned https://github.com/ivmarkov/rust-esp32-std-demo and got that working, which was nice. I then made a few modifications, and got those to work. As I started with something more complicated, I wanted CSP-like channels, so I added the crossbeam-channel dependency, and I copied in their fibonacci example. Then I had some problems, which I've so far narrowed down to: on an ESP32, channels block forever if the channel cap is 0. I compiled the example in a new project targeting my laptop and it ran fine with a cap of 0 or 3, but on ESP32 it permablocked with a cap of 0 but worked with a cap of 3. This suggests to me it's some bug in the ESP Rust code, or at least some kind of incompatibility. Any idea what's wrong? If, after inspection, you're confident the problem is somewhere else, let me know where I should send the bug report.
My modified version of the code can be found at https://github.com/Erhannis/rust-esp32-std-demo/tree/hack . See this function.
Here's the log when the code blocks, (slightly annotated) :
If I set
cap
to 3 (presumably anything greater than zero), it works fine:Meta
I'm using an ESP32 dev board - on the back of the board it says "ESP32 DEVKITV1.", and on the chip cover it says "ESP-WROOM-32", and some other numbers?
rustc --version --verbose
: