Problems with the files names "boot" and "main" and rebooting device
-
Hello:
I'm following this tutorial:
They suggest that i must name the files "boot.py" and "main.py" respectively, however if i copy and paste the code and run everything, it cannot be stoped in pymakr (or using the reset button), so i can't upload a new sketch again, and i must erase the entire board.
So:
- There a stop button? Because Ctrl+C seems that don't work and the board run the script automatically over and over
- Can i use different names apart of "boot.py" and "main.py"? is recommendable use these names on scripts?
Thank you
-
@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:
import myscript
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.
-
### boot.py -- run on boot-up import os import machine from machine import UART uart = UART(0, 115200) os.dupterm(uart) print('-----------------------------------------------------------------------------') print('LOG: Boot Debug') machine.main('boot_debug.py')