Open juergenpabel opened 3 weeks ago
OK, so the issue seems to be that (for RP2040 only):
So a working workaround is (for RP2040) to switch over to (non-recursive) mutex - due to code changes recursiveness isn't relevant anymore anyhow, so I might just remove recursiveness alltogether.
support for recursive mutexes removed
Reopened as crashes/freezes still occur...randomly
The arduino firmware crashes/freezes randomly (only) when run on RP2040 with the MCP23X17 running as a task on the 2nd core (works without issues on ESP32). I have already analyzed for potential causes but didn't come up with a reasonable explanation, so for now I am assuming some issue in the arduino-pico runtime; until I can identify the cause this issue is meant to document the process (and if it does indeed turn out to be an issue in arduino-pico, I will open an issue there and link here).
As a workaround I disabled task creation for RP2040 firmwares (see
Microcontroller::task_create()
in enclosure/firmware/arduino/src/device/microcontroller/rp2040.cpp) and regular checking of MCP23X17 states is invoked fromloop()
).