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.
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.
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.