reset after deadlock

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
bitrat
Posts: 41
Joined: Fri Jul 26, 2019 4:13 am

reset after deadlock

Post by bitrat » Thu Aug 08, 2019 10:47 pm

Hi,

I've been experimenting with handling deadlocks in MicroPython on ESP32 Thingy.

Can I use an interrupt handler to reset the system? I've tried handling an edge on pin 0 but either it isn't called or it's code is blocked.

I'd like to modify/remove main.py and call machine.reset() from the interrupt. Is this possible?


Cheers,
Bitrat

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: reset after deadlock

Post by jimmo » Fri Aug 09, 2019 12:20 am

I think esp32 pin interrupts are "soft" which means they need to be scheduled by MicroPython, which won't work if you're deadlocked.

Would the watchdog timer (WDT) be useful for this?

bitrat
Posts: 41
Joined: Fri Jul 26, 2019 4:13 am

Re: reset after deadlock

Post by bitrat » Fri Aug 09, 2019 12:31 am

Thanks jimmo,

yeah I'll need to do something more robust with the WDT eventually. i was just looking for an easier way to unbrick my device while debugging (I'm writing some monitor classes).

I'll be using C eventually so not too worried. I guess it's the FreeRTOS layer that catches the real irq.

Cheers!

Post Reply