@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.
I'm having a similar issue now. main.py will run after CTRL-D or machine.reset(). But, power cycling the Lopy (on expansion board) will connect REPL to pymakr, but main does not seem to run.
I've done an os flash, and rewritten all the files. Problem continues though.