Task Manager/Serial Scheduler
Posted: Fri Mar 29, 2024 3:39 pm
I'm new to the ESP32 playground, so I'm hoping to get some help with an issue I'm finding with one of our devices. I was NOT the designer/architect so I'm not exactly sure about the code, but I believe it is a lift from the Arduino libraries, obviously with a few modifications.
So, right now, after the device has been running for a while, the serial port goes into a weird state. It will run for 3-5 seconds but then stops sending/receiving. I've traced it down to the lack of an expected ACK.
Quick background, this is a keypad with a capacitive sense LCD screen. The design is such that pressing and holding a "button" will activate a motor until it is released. Two buttons, one for each direction of the motor (CW and CCW).
I found out, quite by accident actually, that doing a "Factory Reset" fixes the problem (for a week or so, anyway). So, I'm currently thinking that the Task Manager is getting overloaded, and an ACK set into the Queue, is getting delayed too long for the expected timing.
More history. We are using the mesh networking with these keypads. It turns out that running them at 240 MHz is bad for an initialization algorithm they use to get the mesh network up and running. So, I recently started compiling them to run at 160 MHz. It has occurred to me that this may have affected the Task Scheduling (prior to this change things were running ok).
At any rate, any thought??
So, right now, after the device has been running for a while, the serial port goes into a weird state. It will run for 3-5 seconds but then stops sending/receiving. I've traced it down to the lack of an expected ACK.
Quick background, this is a keypad with a capacitive sense LCD screen. The design is such that pressing and holding a "button" will activate a motor until it is released. Two buttons, one for each direction of the motor (CW and CCW).
I found out, quite by accident actually, that doing a "Factory Reset" fixes the problem (for a week or so, anyway). So, I'm currently thinking that the Task Manager is getting overloaded, and an ACK set into the Queue, is getting delayed too long for the expected timing.
More history. We are using the mesh networking with these keypads. It turns out that running them at 240 MHz is bad for an initialization algorithm they use to get the mesh network up and running. So, I recently started compiling them to run at 160 MHz. It has occurred to me that this may have affected the Task Scheduling (prior to this change things were running ok).
At any rate, any thought??