-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Platform] Cannot stop the event loop task correctly #37072
Comments
The way this is meant to work in terms of the higher-level API is that the following sequence of calls should be repeatable indefinitely on the PlatformManager:
If this does not work on some platform, that platform needs fixing. At some point this did work on esp32, at least the way the tests use it. For your specific use case, @sbh82 are you using StartEventLoopTask() or RunEventLoop()? How are you using StopEventLoopTask(), exactly? What actually causes the crash? @shubhamdp @dhrishi |
I tried to stop it using:
but it crashes because in freeRTOS implementation the |
That's after calling |
@bzbarsky-apple ESP uses |
To start Matter I simply use the Espressif API
@jadhavrohit924 This is a great news! This is exactly what I needed. With these changes will I be able to completely close Matter and free up all memory resources? Can you estimate when this PR will be ready and merged to be released? |
@sbh82 We are planning to complete the PR by next week. |
Reproduction steps
For my application I need to stop and restart Matter multiple times, but I can't figure out the right way to do it.
I can't find in the documentation the correct way to make a clean stop of Matter and then a next restart.
Now I'm trying to stop the PlatformManager using:
chip::DeviceLayer::PlatformMgr().Shutdown();
and after that call the event loop task is still running. Then if I try to restart it using:
chip::DeviceLayer::PlatformMgr().InitChipStack();
I see inside the method it sets a boolean flag to false (
mShouldRunEventLoop.store(false);
) causing the while inside the event loop task to exit and the ESP32 crashes because there is not a call tovTaskDelete
at the end of task:I see that comment and I think the
vTaskDelete
is missing there.The same problem occurs if I try to simply stop the event loop task using
StopEventLoopTask
method.The issue #20185 seems to be related to a similar problem.
The last commit of this piece of code was a long time ago (27f9fb4) from @bzbarsky-apple
Platform
esp32
Platform Version(s)
ESP IDF 5.3.1, connectedhomeip commit 43aa98c
Type
Manually tested with SDK
(Optional) If manually tested please explain why this is only manually tested
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: