-
Notifications
You must be signed in to change notification settings - Fork 22
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
swift_retain
error when running smart-light
on ESP32-C3
#15
Comments
Note: I can run the
|
I had a similar crash when compiling with -Onone option. Looking at the GitHub swift-embedded-examples CMakeLits.txt, I noticed that the matter examples CMakeLists.txt are missing options below for ESP32-C3 Adding those fixed the crash for me |
This fixes apple#15, making the `smart-light` example run on ESP32-C3. I'm don't have enough knowledge to know if this is the proper fix/correct location to add these flags, but it makes the example work for me at least.
@haoliver Thank you so much for finding this out, this did solve my problem, and I opened a PR so that hopefully more people will benefit. 🙏 |
Hi, |
@jgranie I'm not sure that this is the same problem we're seeing, I had no issues at all with the led-blink example, just with the smart-light one. And that one compiled fine (AKA no compile errors), I just had runtime crashes. |
Thanks for your reply. Yes it seems not correlated. I will investigate a bit further and post a new issue. |
Hi!
I wanna start by saying thanks for the huge amount of work that has gone into making this whole swift-embedded/matter thing happen, I'm so excited to start writing my own firmware using this.
However, when I tried to get the
smart-light
example working on a board I've got at home (Wemos C3 mini v2.1.0, which is based on ESP32-C3FH4) I stumbled into some problems. Building and flashing works as expected, but when I run the code I get this crash:Crash
My thinking is that the
IllegalInstruction
followed byswift_retain
means thatswift_retain
for some reason isn't linked correctly, but I can't say I understand this good enough to know if that's a possibility.Following the above, I've managed to understand that this has something to do with
_ = Unmanaged.passRetained(self)
that happens in a bunch of places, e.g.Matter.Node.init
, commenting this out let's the program continue a bit longer, but still crashes later on.A more minimal example that also crashes
I've tried verifying that
swift_retain
is actually linked, by runningnm -gm build/light.elf | grep swift
(Am I doing it right?), which listsswift_retain
at least:I'd be happy to continue investigating/fixing this, but it feels like I've gotten as far as I can without external support by now 😅
The text was updated successfully, but these errors were encountered: