Closed ad3154 closed 12 months ago
Built "esp32_platformio_object_pool" example, as in the tutorial. Deployed on some ESP32 module. I can see some CAN frames been sent at boot. If I check serial port of ESP32 module it says every 5 seconds:
"E (391530) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:"
Tried also connected to some tractor's virtual terminal. It do not detect it.
Built "esp32_platformio_object_pool" example, as in the tutorial. Deployed on some ESP32 module. I can see some CAN frames been sent at boot. If I check serial port of ESP32 module it says every 5 seconds:
"E (391530) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:"
Tried also connected to some tractor's virtual terminal. It do not detect it.
Thanks for this feedback - I will see what I can do. I can sometimes repeat this same symptom, and have seen some successes with replacing some calls to std::this_thread::sleep_for
with calls directly to FreeRTOS on ESP32 with vTaskDelay
for example. We might have some success #define
ing around these when ESP_PLATFORM
is defined... or maybe we can use CMake and some clever abstraction to optionally compile in different kind of thread delays (this might be the cleanest solution...).
Hi @AndreaInverardi @ad3154, sorry for the delay, the fix for your issues should already be in the stack: https://github.com/Open-Agriculture/AgIsoStack-plus-plus/pull/91/commits/29fe04ff5d1c9e66880c9d2fc496c0972c0b5744
Basically the default FreeRTOS tick is 10ms (100Hz), but the stack tries to update internally with 4ms by default. Hence the watchdog gets triggered as the thread is never allowed to switch.
There are 2 solutions:
isobus::CANHardwareInterface::set_can_driver_update_period(10)
pio run -t menuconfig
. component config -> FreeRTOS -> Tick rate (hz), IIRC.I prefer the latter to minimize platform specific issues, but both should work fine I think.
EDIT: Actually it might be really useful to document this, and/or put it in the FAQ
Added updates to the ESP32 instructions to run menuconfig
and adjust both the tick rate and some default stack sizes.
When testing on my end this seemed to resolve all instances of runtime crashes I was seeing.
Check out the new section Set up your ESP32’s OS and PThread options
in the draft.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
What's new
I would like some feedback on this new tutorial before merging it, ideally, so you can find a draft of it here
Any and all comments would be welcome.
Closes #263