@nervencid You can use any name for your scripts. Only boot.py and main.py are executed as part of the boot process. If you want to run your script then, you have to add a statement like:
e.g. to main.py. You should be able to stop your script with Ctr-C from the console, unless you disable that in your code.
To isolate the problems, try running your code with a simple terminal like Putty.
Note: You can change the name of the file which is run instead of main.py with machine.main(). The only useful place for that command is in boot.py.
@robert-hh Thanks for the reply! So basically an unstable power supply can lead to flash errors. Good to know.
(And you had it, I was using a Li-Ion 3.6V battery. I'll make sure to mention that next time)
@alexpul What I do
a) I do not change boot.py a lot. I have only command related to the general operating mode in there, like USB REPL enabled or WiFi access, although the latter may vary
b) I do not code for specific things in main.py. Instead if put that into files with appropriate names and import them in main.py. If one application consists of several files, I put them in a subdirectory and either uos.chdir() into that, or alin sys.path to include that subdirectory, such that import can find the files.
@panos29 Both boot.py and main.py are executed at power on and reset, and give you the starting point. So you can put your code into main.py, or in a different file, which you import from main.py (which is what I prefer), or, or, or....
@reidfo I use the boot.py to mount the SD card just once. When I mounted the SD card in the main.py I encountered OSError when re-running my code in the REPL (OSError: the requested operation is not possible) due to the fact that I cannot check the status of the SD card.
@PeterB I'm not using the pymakr plug-in, but form the discussion i recall, that there is an option to run safe boot before upload. Safe boot bypasses boot.py and main.py. In that case the objects defined in boot.py to not exist.
As you need to connect using wireless to modify 'boot.py' in the first place this makes disabling the wireless interface by default an 'interesting' challenge to a new user!
Hopefully the wireless, bluetooth, etc are only started (if not already active) after 'boot.py' is executed.
Thanks for the clear explanation.
I asked again because i read somewhere that it was possible, but i can't find that page anymore. But maybe that was the original pyboard too.
Well, then I will continue without :)