TinyCircuits / TinyCircuits-Tiny-Game-Engine

MicroPython game engine for TinyCircuits Thumby Color
GNU General Public License v3.0
10 stars 2 forks source link

Add a bluescreen of death #73

Closed TinyCircuits closed 4 months ago

TinyCircuits commented 4 months ago

If a segfault occurs, or maybe any kind of fault that stops the processor executing MicroPython, show the user a screen about what happened and a code that can be given to support for diagnosing what caused the issue.

For ARM: https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html For Linux: https://stackoverflow.com/questions/2350489/how-to-catch-segmentation-fault-in-linux

Need to make sure that the handlers do not do anything that could cause another fault. For example, if outputting something to the screen, need to make sure the screen DMA and SPI are complete before sending out frame.

Hopefully information on what instruction caused the fault can be retrieved and used to find the line of code.

TinyCircuits commented 4 months ago

d2158ae