Skip to content

QT Py SAMD21: Specific error in REPL in Thonny causes hard crash and damages unprotected bootloader #8038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dhalbert opened this issue May 27, 2023 · 2 comments

Comments

@dhalbert
Copy link
Collaborator

dhalbert commented May 27, 2023

8.1.0
QT Py SAMD21
Thonny

https://forums.adafruit.com/viewtopic.php?p=973733

import board
import busio
uart = busio.UART(board.TX, board.RX, baudrate=4800, bits=7, parity=EVEN, stop=2, timeout=0.5)

Note that EVEN is undefined, so it shouldn't get to the constructor call.

Doing the above in the REPL causes the error to be reported followed by a safe mode crash, repeated attempts to reconnect from Thonny. For the user, with an unprotected bootloader, it bricked the board.

When used with pico or other terminal program, nothing unusual happens. The above example just generates

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'EVEN' is not defined

With a protected bootloader, the board was not bricked, but still need to figure out what is causing this serious error.

@dhalbert
Copy link
Collaborator Author

thonny issue: thonny/thonny#2914

@dhalbert
Copy link
Collaborator Author

Still reproducible with 9.2.7 and 10.0.0-alpha.2. Note that simplifying this to say, the imports plus uart = busio.UART(board.TX, board.RX, parity=EVEN) does not provoke the error. So this particular sample of code is tickling a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant