Hello,
I will need to flash a large number of boards with micropython, so I am trying to streamline the process as much as I can. Is it possible to have an initial main.py baked into the firmware that can then be changed later through the typical fashion (edit the source through the REPL or mounted filesystem)?
Possible to flash board with a preloaded main.py?
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: Possible to flash board with a preloaded main.py?
Suppose stm32 port you can edit https://github.com/micropython/micropyt ... ain.c#L144 and change it with your custom main.py
Re: Possible to flash board with a preloaded main.py?
The other option is to extend the file https://github.com/micropython/micropyt ... nisetup.py, which already creates a boot.py in an empty file system.
Re: Possible to flash board with a preloaded main.py?
You might be able to suck out a flash image from a master using JTAG or SWD and program the rest from it.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Possible to flash board with a preloaded main.py?
I had a PR, which added the capability to overwrite the files, which are generated at file-system creation time, but it got nowhere and is now outdated: https://github.com/micropython/micropython/pull/1891
See also https://github.com/micropython/micropython/issues/1838
See also https://github.com/micropython/micropython/issues/1838
Re: Possible to flash board with a preloaded main.py?
Thank you all very much for the quick replies!
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Possible to flash board with a preloaded main.py?
On the ESP8266 I use a modified _boot.py https://github.com/peterhinch/micropyth ... r/_boot.py.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.