Skip to content

REPL paste mode (CTRL-E) crashing board to safe mode  #853

@ash0x1b

Description

@ash0x1b

I'm experiencing strange behaviour with REPL in paste mode. After an arbitrary period of time, pasting anything while in REPL paste mode will crash the board and bring it back up in safe mode.

While in safe mode, paste mode works without an issue. Resetting it back to normal mode, paste mode will crash it to safe mode every single time. Typing in 4 characters will cause a crash. The crash will occur while typing in the 4. character. CTRL-C or CTRL-D will cause a crash immediately.

Cycling power and removing libs and scripts from internal storage doesn't solve the issue. I have to, either reflash the board with CP firmware, use flash_erase_express.ino.metro_m0.uf2 or run storage.erase_filesystem() from REPL.

I first suspected that the filesystem got corrupted during many resets. I've reflashed the board and made sure USB was ejected cleanly. Same issue occurred after two hours of running the script.

circuitpython: 2.3.1
Board: Metro M0 Express
Libs: adafruit_dotstar

Script I was running as code.py

import time
import random
import board
import adafruit_dotstar as dotstar

dots = dotstar.DotStar(board.SCK, board.MOSI, 50, brightness=0.01, auto_write=False)

######################### HELPERS ##############################

# a random color 0 -> 224
def random_color():
    return random.randrange(0, 7) * 32

######################### MAIN LOOP ##############################
n_dots = len(dots)
try:
        
    while True:
        #fill each dot with a random color
        for dot in range(n_dots):
            dots[dot] = (random_color(), random_color(), random_color())
        # show all dots in strip
        dots.show()

        time.sleep(.25)
except KeyboardInterrupt:
    dots.fill((0, 0, 0))
    dots.show()

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions