sometime exceptions #10090
Replies: 3 comments 2 replies
-
Looks like a Thonny bug/feature. To see what is caused by your code and what is caused by Thonny, try working with a dumb terminal emulator like Putty (Windows) or picocom (Linux) or screen (MAC orLinux). That skips Thonny. Like all developed IDE, Thonny is nice & convenient as long as there is no problem, and a problem amplifier as soon as something fails. |
Beta Was this translation helpful? Give feedback.
-
Don't put anything in boot.py that isn't required for the board to boot (i.e. anything that isn't initialisation of file systems or USB configuration). If you are using STM32 and your board is connected over USB, then USB (and hence the serial connection) won't be initialised in boot.py. |
Beta Was this translation helpful? Give feedback.
-
What's the thinking behind that prescription Jim? I tend to run my program from boot.py with a duplicate copy in main.py. Admittedly this is a legacy approach from the bad old days before little FS when flash memory file systems would fall over at the drop of hat, but I'm keen to know why the preference for using main.py only for user code? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I keep having these curious little episodes with thonny & other repls where errors go unnoticed by the interpreter & it's not until I save the file to flash & let it run from there that the error is flagged. In the most recent episode on an rpi pico I had
in the program but hadn't imported machine at the top, where I had only
This worked in the repl, only got the exception after I'd saved the file as boot.py in flash & it tried to run from flash on power up.
Does anybody else get this behaviour & what might be the cause?
Beta Was this translation helpful? Give feedback.
All reactions