-
Notifications
You must be signed in to change notification settings - Fork 16
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
ESP32-C3 task watchdog trigger #18
base: main
Are you sure you want to change the base?
Conversation
Hi, thanks, I'm currently trying to remember/understand how FreeRTOS/ESPHome executes tasks, which priorities they have and how my code is supposed to work on a single core chip 🤔 And whether your solution is ok. Do you use arduino/esp-idf? As there could be some differences how WDTs are set up. If there is only a single core, then you probably have to be more careful choosing task priority. You can configure priority of my component task loop in config. By default it is set to 2, which is lower than all other critical system tasks like WiFi/Bluetooth etc, however if I'm not mistaken ESPHome's main loop runs in a task with priority=1, and Idle task has priority=0. So If you will use these priorities, then your solution will actually help by giving some time to Idle task (1ms), however I'm not sure how it will work if you will be using other components that will require more processing time in the main loop. |
The thing is while my component doesn't need 100% CPU to apply all filters/calculations, but it will block in |
I'm using I was trying to run the board with both the sound level meter and a bluetooth proxy (https://esphome.io/components/bluetooth_proxy.html) for home assistant when the error first came up ( |
There is a bit more info in this github issue: esphome/issues#2277 - that's related to the pull request I linked earlier. Might help to put an |
It looks like if ticks_to_wait is 0, you should have a non-blocking call that you can call in a loop on ESP_ERR_TIMEOUT, and then yield() accordingly? |
Well spotted, @deece, I totally forgot about last argument |
I've got a c3 sitting on my desk at the moment, if you want to push a branch up somewhere, I can test it for you. |
I can create some branch, however it will be just a few But before that can you just confirm/reproduce the same issue as OP described with current/unmodified version from the main branch with minimal config? And if you can, then what's the detailed error message (what is the name of task for which WDT is triggered) |
Adding |
@RaymiiOrg, I do have S3 version as well and I tested using it a year ago and AFAIR, it worked pretty well. At least there were no WDT issues. I also tried today setting I checked i2s_read source code, can't say I fully understand what's going on there, but it uses FreeRTOS queues internally ( |
For the Olimex ESP32-C3. This was my reference:
https://github.com/esphome/esphome/pull/2096/files