Closed weiying-chen closed 9 months ago
what version of esp-idf-svc/hal are you using? It may be the ETS delay impl that is not doing its job right. We updated it on current master branch of esp-idf-hal. If you want to have a quick test you can add
[patch.crates-io]
esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal" }
inside your Cargo.toml then run cargo update
and cargo b
I added that at the bottom of my Cargo.toml:
[patch.crates-io]
esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal" }
And I seem to be using the latest version of esp-idf-svc
:
esp-idf-svc = { version = "0.48", default-features = false }
But I'm still getting the same error. Maybe the issue isn't the ETS delay. I also tried the FreeRtos delay. Same result.
@Vollbrecht Did you guys change something in https://github.com/esp-rs/esp-idf-hal
? Because now this line:
[patch.crates-io]
esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal" }
Removes the InvalidData error, and the sensor reads the weather successfully. I don't think I did anything special apart from downgrading Rust nightly to 1.77.0 (2a3e63551 2023-12-30).
no we didn't - 99% chance you forgot cargo update
because git dependency's need manual updating and tracking otherwise they are not pulled in
With this code (to read the weather with esp32-c3 and bm280):
And I get this error:
It panics here:
It's strange because this almost identical code works:
I suspect I have to use something similar to this in the first code:
Does esp-idf-svc provide something similar to esp_hal_common::clock? Or maybe similar to esp_hal_common::delay? I'm not very sure which one is the issue.