Replies: 2 comments
-
By default CircuitPython on most devices allows writing files via a drive mounted at the development machine and does not allow writing via CircuitPython code. It's possible to change this so that the drive is not mounted and CircuitPython can write files. Thonny first tries to write via CircuitPython code and if this fails, tries to locate and use the mount. I'll consider changing this. For now you can choose "This computer" as save target, locate the mount yourself and save there directly. Thonny sees this as saving a local file and won't object even if a program is running. Regarding auto-reload -- do you really need this? You could use "Run current script" instead, which first saves the file (only if it's a local or "local" file), then interrupts currently running program (if required) an runs the code. I know this approach may feel strange with CircuitPython. Thonny was first designed for CPython, then for MicroPython and finally for CircuitPython. As I didn't like some choices made in CircuitPython, I decided to implement CircuitPython support with existing UX. For now I'm happy with Thonny's approach, because later CircuitPython started supporting devices, which can't use the mount-based approach (ESP-32 and micro:bit). |
Beta Was this translation helpful? Give feedback.
-
Hmm, I think I understand what you're saying. Right now I'm targeting a SAMD51, but I also work with ESP32 (Feather S2/S3), so if I can't use the mount (that's the local file write, yes?), then it would be frustrating. I'm assuming Mu Editor uses the local file-based approach. It works fine in that regard for the ESP32 I've been working on, it just has other issues. I'll try the "Run current script." Python ended up being too slow for the current project so I switched to C++, but next time I'm mucking about in CP I'll try it. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I recently switch to Thonny from Mu Editor for CircuitPython work. It seems much better all around except for one thing: With Mu Editor, I could just save my code and it would auto-reload it. Instead, if I try to save while the code is running, I get two alerts: One about the device being busy, and after I dismiss that, one about "Back-end is not ready," which I also have to dismiss, before getting on with my work.
TIA!
Thonny 4.1.3
Beta Was this translation helpful? Give feedback.
All reactions