Interrupt/Call-Back delayed every 1.3s due to Garbage Collection #19676
Replies: 4 comments 2 replies
|
Maybe if I mess with these.... https://github.com/micropython/micropython/blob/master/py/mpconfig.h#L250 |
|
I do not know if you can you run the callback with |
|
If you call One idea would be to disable GC. This should ensure that Failing that you might look at optimisation: reducing allocations, speeding all code that is triggered by the interrupt... |

Uh oh!
There was an error while loading. Please reload this page.
I have a fairly complex application, which is using the PIOs which generate interrupts at around 120Hz. The interrupt code is as small as possible and uses
schedule()to defer to another (reasonably sized) piece of code.Every 1.3s I am seeing that there is a significant delay in the callback, occasionally this is delayed enough that it is not called until the time where the following callback would be. My code can detect and protect itself from this delay, but I am interested in finding the cause.
I am using the USB core to communicate with PC over USB-Midi, but I don't know whether that is a factor... I am also using threading to run a 2nd task (on other core) to keep the FIFOs to the PIOs filled - not a huge task.
Any places I should look.
Scope capture shows the top trace, which is a debug-PIO, actioned at the start of each callback. Call back completes in good time (and upping the CPU clock does not improve situation), only the interrupt route messes with the scheduler or disables the interrupts.

All reactions