Open peterharperuk opened 16 hours ago
It seems to happen eventually even if stdio is disabled. Just seems that stdout usb makes it happen much quicker. But enabling stdio uart stops it happening?!
My theory is that as we're clearing the abort interrupt 100s of times while checking for an abort, occasionally this leads us to lose the interrupt on the next run. If we only clear the abort interrupt when required, it seems to fix the lockup.
If you run the i2c bus_scan example on Pico 2 with or without anything connected and ONLY stdout USB enabled then the device invariably locks up. It seems to get stuck in the loop waiting for an abort which never seems to happen! It works fine if sdio uart is enabled?! And Pico 1 seems ok.
Usually the abort seems to happen after around 130 iterations. If I repeat the command in the loop after 200 iterations or so, it seems to fix the problem.