Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues on ESP32-C3 #42

Closed
nevi-me opened this issue Mar 5, 2023 · 12 comments
Closed

Build issues on ESP32-C3 #42

nevi-me opened this issue Mar 5, 2023 · 12 comments

Comments

@nevi-me
Copy link
Contributor

nevi-me commented Mar 5, 2023

I'm unable to use the project as a dependency on an ESP32 based project.

Please see a minimal reproduction at https://github.com/nevi-me/esp32-c3-matter-minimal. The summary is that some of the dependencies don't yet support the esp-idf framework. The esp-rs folks are aware of some of them, as there are forks at https://github.com/esp-rs-compat.

@nevi-me

This comment was marked as outdated.

@nevi-me
Copy link
Contributor Author

nevi-me commented Mar 5, 2023

The simplest solution to rustix is to compile env_logger with default features disabled, I'll make a PR for that.

@kedars
Copy link
Collaborator

kedars commented Mar 5, 2023

I had created an example that built on ESP32 (https://github.com/kedars/matter-rs/blob/master/examples/esp-onoff-light/Cargo.toml). The crypto part was all nullified, but the build was functional. It was quite an old version of the matter-rs so, but in case it helps your investigations.

@nevi-me
Copy link
Contributor Author

nevi-me commented Mar 5, 2023

Thank you, I hadn't seen that. I've taken a brief look at it, it'll help me build an example once I've sorted out the deps.

@nevi-me
Copy link
Contributor Author

nevi-me commented Mar 6, 2023

@kedars after resolving dependency issues, building fails because of the sys module not having a target_os = "espidf"

#[cfg(target_os = "macos")]
mod sys_macos;
#[cfg(target_os = "macos")]
pub use self::sys_macos::*;

#[cfg(target_os = "linux")]
mod sys_linux;
#[cfg(target_os = "linux")]
pub use self::sys_linux::*;

#[cfg(any(target_os = "macos", target_os = "linux"))]
mod posix;
#[cfg(any(target_os = "macos", target_os = "linux"))]
pub use self::posix::*;

So I was unsure of how to proceed from there. When building with hte esp Rust target, Cargo sets target_os to espidf.

@kedars
Copy link
Collaborator

kedars commented Mar 6, 2023

Yes, those things got introduced later on. You'll have to create the sys_espidf target, and implement the Psm and mDNS APIs. For now, you can just keep them empty?

@nevi-me
Copy link
Contributor Author

nevi-me commented Mar 6, 2023

That's a reasonable approach, I'll do that, thanks.

@nevi-me
Copy link
Contributor Author

nevi-me commented Mar 9, 2023

With #48 and #43, I can now compile this as a dependency on an ESP32-C3. Now I'm going to try the LED example to see if I can get it working 😃

@ivmarkov
Copy link
Contributor

@kedars We should probably close this, because the two new branches compile for ESP IDF just fine.

@nevi-me
Copy link
Contributor Author

nevi-me commented Jun 27, 2023

Yes

@nevi-me nevi-me closed this as completed Jun 27, 2023
@ivmarkov
Copy link
Contributor

@nevi-me Were you successful in running either of the branches on an ESP32 MCU?

@nevi-me
Copy link
Contributor Author

nevi-me commented Jun 27, 2023

@nevi-me Were you successful in running either of the branches on an ESP32 MCU?

I haven't checked yet, I'll have time properly in the weekend. I'll confirm on Matrix when I've done so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants