Comments (13)
(ping @ivmarkov, would you be able to reopen this one please? 🙏)
I'm not reopening until it is confirmed that the issue is in esp-idf-sys
. Your steps to reproduce are imprecise, in that:
- you don't mention what versions of
async-io
andasync-executor
you are trying to use. - i'm unsure of your ESP IDF version
- Unclear what MCU/chip
Rather than doing back-and-forth here, please publish a mini project that reproduces the error somewhere.
from esp-idf-hal.
No, that's good enough. I'll try to build tmr.
from esp-idf-hal.
Remove "-C", "default-linker-libraries"
from here.
It used to be necessary in the past (helped the linker find some intrinsics), with earlier ESP IDF SDKs, but with newer ESP IDF toolchains seems to be creating problems rather than solving ones.
Not really sure why that happens, but my guess would be that the newer cross toolchains of newer ESP IDFs contain a fake/alternative implementation of libpthread
(perhaps coming from newlib
itself?) which should not be there, and which collides with ESP-IDF's custom libpthread
impl when the linker is told to link against the default libraries of the cross toolchain sysroot.
from esp-idf-hal.
@LinusU I've opened (and pinned) an issue here.
from esp-idf-hal.
Hmm. I changed esp-idf-hal
to the latest, set ESP_IDF_VERSION
to master
and it worked. Closing this as a false positive, but still a weird issue nonetheless.
from esp-idf-hal.
I'm running into the same issue as well, but I'm trying to use smol
(or specifically, async-io
& async-executor
) and not Tokio.
Steps to reproduce:
- Generate a new project
cargo generate esp-rs/esp-idf-template cargo
- Add async-io
cargo add async-executor async-io
- Modify
main.rs
to add simple usage of asyncuse std::time::Duration; use async_io::Timer; use async_executor::LocalExecutor; fn main() { // It is necessary to call this function once. Otherwise some patches to the runtime // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 esp_idf_svc::sys::link_patches(); // Bind the log crate to the ESP Logging facilities esp_idf_svc::log::EspLogger::initialize_default(); log::info!("Hello, World!"); let executor = LocalExecutor::new(); async_io::block_on(executor.run(async { loop { Timer::after(Duration::from_secs(5)).await; log::info!("Hello, loop!"); } })) }
- Try to build
cargo build --release
- Observer "multiple definition of" pthread stuff
(using `master` gives different error)
Changing to ESP_IDF_VERSION
to master
instead gives the following error:
error[E0425]: cannot find value `g_wifi_feature_caps` in this scope
--> /Users/linus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.47.3/src/wifi.rs:498:36
|
498 | feature_caps: unsafe { g_wifi_feature_caps },
| ^^^^^^^^^^^^^^^^^^^ not found in this scope
For more information about this error, try `rustc --explain E0425`.
error: could not compile `esp-idf-svc` (lib) due to previous error
from esp-idf-hal.
please don't use esp-idf master branch as it is absolutely only for active development, its api is unstable and we don't make any efforts here in esp-idf-sys to have it reliable build against it.
from esp-idf-hal.
(ping @ivmarkov, would you be able to reopen this one please? 🙏)
from esp-idf-hal.
@Vollbrecht to clarify, the error and steps to reproduce happens on 5.1.1, I only included the part about master
because it was suggested as a workaround
edit: I've updated my comment to hide the master
stuff
from esp-idf-hal.
the latest current stable release is v5.1.2 can you test against it?
from esp-idf-hal.
BTW the CI of this does pass (MCU=esp32c3), and it does use what you are trying to use. ESP IDF 4.4 5.1.1
from esp-idf-hal.
Good points, I've uploaded a repo now: https://github.com/LinusU/esp32-pthread-issue
- you don't mention what versions of
async-io
andasync-executor
you are trying to use.
cargo add
adds the latest version, which currently is async-executor = "1.8.0"
and async-io = "2.2.2"
- i'm unsure of your ESP IDF version
I used the one from the esp-rs/esp-idf-template
template, which is currently ESP_IDF_VERSION = "v5.1.1"
.
- Unclear what MCU/chip
I'm building for the esp32c3
.
I'm also building on macOS 14.2.1, using rustc 1.76.0-nightly (90e321d82 2023-12-02)
. Is there any more information/investigation I could provide?
edit: getting the same issue with ESP_IDF_VERSION = "v5.1.2"
from esp-idf-hal.
Thank you 🙏 🙏 removing -C default-linker-libraries
worked around the issue!
from esp-idf-hal.
Related Issues (20)
- esp_idf_hal::delay::Delay missing some methods for embedded_hal::blocking::delay HOT 2
- `AsyncCanDriver` is not `Send` HOT 5
- Hardware acceleration for crypto?
- Conflict between esp-idf-hal and display-interface-spi on embedded-hal version HOT 1
- Documentation/API regarding default input pin pull up/down state HOT 6
- Ubuntu 22.04.3 LTS Cross-Compilation for the target = "riscv32imac-esp-espidf" (IDFGH-11878) HOT 4
- Remove 4096 limit for SPI dma transfer size HOT 2
- Can't enable the `edge-executor` feature HOT 2
- i2c broken on esp32-c6 HOT 1
- Never return type for `reset::restart`
- Simple blink example for RGB Led on Esp32 C6
- Shared I2C bus example HOT 1
- Support async in i2c Driver by using new ESP-IDF V5.2 driver impl
- rmt_neopixel no longer works (on esp32c6) HOT 3
- Mutating struct in ISR HOT 1
- Error: dangerous relocation: call8: call target out of range:(xtensa-esp32s3-espidf) HOT 3
- Transport(Failed to load system certs: No valid certificate found) (xtensa-esp32s3-espidf/STD) HOT 4
- need uart dtr, for rs485 control HOT 1
- SpiBusDriver is not Send HOT 1
- I2C default baudrate too high, is 1M, using this parameter is likely to be wrong HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-idf-hal.