Closed heliosoph closed 2 years ago
This looks like a stack size issue. Running 8.0-beta-1 I get:
code.py output:
Traceback (most recent call last):
File "code.py", line 1, in
Building with CIRCUITPY_DEFAULT_STACK_SIZE set to 4608 (from 3584) allows code.py to finish successfully.
Thanks @DavePutz for diagnosis. The stack size on SAMD21 boards is very limited due to the limited ram (32kB). And if we increase the stack size, then some programs don't run because they run out of heap memory.
I incorporated the program into a single code.py and avoided the error. You can also put
import supervisor
supervisor.set_next_stack_limit(<4608 or larger)
in boot.py
. This will cause code.py
to run with the specified stack size.
CircuitPython version
Code/REPL
Behavior
This is the complete REPL output:
", Zeile
Automatisches Neuladen ist deaktiviert. Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt
Du bist im abgesicherten Modus weil: Der CircuitPython-Kerncode ist hart abgestürzt. Hoppla! Absturz in den HardFault_Handler. Bitte melden Sie ein Problem mit dem Inhalt Ihres CIRCUITPY-Laufwerks unter https://github.com/adafruit/circuitpython/issues
Drücke eine beliebige Taste um REPL zu betreten. Drücke STRG-D zum neuladen.
Description
I have a ItsyBitsy M0 Express with Bootloader 3.14.0 I do the following steps: First I erase the filesystem with
import storage
storage.erase_filesystem
from the REPL console. Then I copy the libraries adafruit_bus_device and adafruit_mcp230xx from the 7.x or 8.x bundle release 20220708 into the lib folder, depending on the CP version I use for the test. Then I copy the two files code.py and lib/test.py (see above) into the CIRCUITPY drive. Now the system runs. Then, in the lib/test.py file I uncomment the last line. Now the system crashes and gives the output shown above. You can start again and repeat by erasing the file system again. This works both with CP 7.3.1 and CP 8.0.0 alpha 1Additional information
The board is standalone. Same behaviour with a MCP23017 connected. I have opened a thread in the adafruit forums: https://forums.adafruit.com/viewtopic.php?f=62&t=192583&p=931844#p931844