-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Fix esp32 event callback serialisation #2913
Fix esp32 event callback serialisation #2913
Conversation
Network builds just use default size for event task stack
Not enough room on event task stack for this.
Get debug output from wifi task
PR Summary
|
Not used, not required.
Avoids double-queuing
So message handling is, I think, much improved. I've discarded the customised (hacked) event loop and reverted to the standard event loop since it's now just used for IDF stuff. Sming now uses a separate queue for I'm now using the RTC watchdog which is normally disabled after boot, but it's more convenient than a task watchdog as it can be reset from any task. However, in idle situations the watchdog expires as there's nothing being posted to the message queue. If anyone has thoughts on this please comment! Here's the IDF page for reference https://docs.espressif.com/projects/esp-idf/en/v5.2.3/esp32/api-reference/system/wdts.html. |
Also the RTC watchdog is only available for esp32 and esp32s2. I'm inclined to ditch the wdt stuff entirely... |
0b94f02
to
ef31d29
Compare
Use separate queue for sming messaging, serviced via tcpip thread or Sming thread if networking disabled.
SmartConfig hangs on `esp_event_handler_register` call if invoked via task queue.
Can deadlock if used inside `init()` as it's called in low-priority thread.
ef31d29
to
e6e9d26
Compare
Just for my understanding? Are you adding the wdt reset to make it more convenient for the developers or because there is some requirement? If there is no requirement maybe we should ditch the wdt and explain in a document that it is users responsibility to use the watchdog for time-consuming tasks. |
This reverts commit e1ea578.
The WDT is there to make behaviour consistent with esp8266 (and rp2040). I've gone back to the default IDF behaviour which enables the IDLE task watchdog by default. All I've done is change the timeout from 5s to 8s. When applications call NB. this approach is probably the only one that makes sense since it guards all tasks and not just the Sming ones. |
The CI failures are my fault: I made a minor update to the esp-idf fork and omitted to tag it. Most of the tcpip code is, by default, emitted to flash but many functions can be moved to IRAM with The esp32 is more tolerant of calling code from flash within interrupt routines, but for efficiency NB. Prior to v5.3 I want to get v5.2.3 sorted. This will require work to the |
This PR addresses the issue raised in #2912 by pushing events into the tcpip thread for handling. Network applications therefore 'live' in the tcpip task and the Sming task is created only for non-networked applications. Sming uses a separate event callback queue instead of the IDF one.
smg_uart_write
so debug output doesn't get garbled between tasks (e.g. wifi).TODO:
esp_task_wdt_reset
(and indirectly viasystem_soft_wdt_feed
) from code which is now running in the tcpip task.