Autostart python program #9326
Replies: 3 comments
-
Either |
Beta Was this translation helpful? Give feedback.
-
Thanks. Related question, I'm using a prebuilt Micropython install. Is there a runtime way to check which filesystem is installed? The 2040 Datasheet mentions littlefs but the code clearly has the option to load either Vfslfs2 or VfsFat. I have no idea what defines were used in the building of the release though from what I've read littlefs seems to make the most sense for embedded flash. If an external SDCard then FAT. I"m assuming the Micropython os and fileio related commands layer on top of the underlying file system - i.e. no special libraries are needed. |
Beta Was this translation helpful? Give feedback.
-
There is a little Python script below made by @dpgeorge which shows the type of file system and it's properties. The information is from the boot sector. The standard build of the
|
Beta Was this translation helpful? Give feedback.
-
Hi. I'm trying to fully understand the boot process for MicroPython. I'm on the RP2 port.
By default there is no 'boot.py' nor 'main.py' on my board. I moved my program to /main.py and it runs at powerup (great!)
In the source:
port/rp2/main.c
It loads Micropython and then does a few things...
if file _boot_fat.py or boot.py exists these are executed (file system). Both exist in the git repo so the defines that gate them determine which one. While I haven't investigated far enough to determine the differences, I get the the gist that a file system is loaded (makes sense to be able to look for boot.py and main.py).
next it looks for boot.py and executes
next it looks for main.py and executes
It appears these files must be in the root of the filesystem
I have found some brief mentions of boot.py and main.py in various searches but no real documentation of the suggested flow. I renamed my program main.py and it does run at boot. I'd really like to understand the process here. i.e. what should I put in boot.py versus main.py. Hopefully I missed the documentation but this is critical to know the bringup sequence for running the board w/o a host computer.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions