How to troubleshoot crashing PYBD

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
User avatar
tve
Posts: 216
Joined: Wed Jan 01, 2020 10:12 pm
Location: Santa Barbara, CA
Contact:

How to troubleshoot crashing PYBD

Post by tve » Tue Jun 02, 2020 10:52 pm

The PYBD is crashing on me and all I get is an error from the terminal program that USB (/dev/ttyACM0) is dead. E.g.

Code: Select all

SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
How do I find out where the PYBD crashed? Something like a backtrace... Haven't seen anything in the docs, I tried `pyb.fault_debug(True)` but see no difference.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: How to troubleshoot crashing PYBD

Post by pythoncoder » Wed Jun 03, 2020 4:34 am

That is unusual. Does the Pyboard LED convey any information? One thought might be to try debugging via a serial port using dupterm and an FTDI adpator, but I'm not hopeful.

At risk of "teaching granny to suck eggs" if code is locking up solid the only recourse I've found is the old-fashioned way: lots of print statements so you can trace execution leading up to the crash, and/or disabling chunks of code in turn until you find the culprit.
Peter Hinch
Index to my micropython libraries.

User avatar
tve
Posts: 216
Joined: Wed Jan 01, 2020 10:12 pm
Location: Santa Barbara, CA
Contact:

Re: How to troubleshoot crashing PYBD

Post by tve » Wed Jun 03, 2020 6:10 am

pythoncoder wrote:
Wed Jun 03, 2020 4:34 am
At risk of "teaching granny to suck eggs" if code is locking up solid the only recourse I've found is the old-fashioned way: lots of print statements so you can trace execution leading up to the crash, and/or disabling chunks of code in turn until you find the culprit.
I was lucky, my MQTT micro-framework buffers boot messages until it gets a connection and that allowed me to see that the reset cause was WDT. So it didn't crash but I messed-up the params to the WDT. Oh my... and on we go...

Post Reply