Hi,
I need to upload Micropython with program files to a 30 piece of ESP32. To speed things up I would compile my own MP version already with the program files and images and libraries. In which folder should I put the files to be included in the compiled bin file?
Custom files in the self-compiled Micropython
Re: Custom files in the self-compiled Micropython
You van embed python scripts into the firmware by placing them into the modules directory. But that does not add them to the file system. A workaround may be to encapsulate other content into a python script and extract that on boot. But that works for short files only.
Re: Custom files in the self-compiled Micropython
Here is a link showing how I modified the VFAT file system image to add files for a ESP32 based MicroPython device using Centos 7 Linux. I have not tried modifying the littlefs file system but I suspect the process would be similar.
https://gist.github.com/russhughes/1300 ... vfat-image
https://gist.github.com/russhughes/1300 ... vfat-image
Re: Custom files in the self-compiled Micropython
OK, so you thinking it's not very simple. So maybe does esptool allow to upload files to littlefs? Then I would write a script to burn bootrom and copy the files.
Re: Custom files in the self-compiled Micropython
Hi guys and thanks for reply,
So if you thinking it's not simple, does esptool allow to upload files to littlefs? Then I would create a script to burn bootrom and copy the files in second step.
So if you thinking it's not simple, does esptool allow to upload files to littlefs? Then I would create a script to burn bootrom and copy the files in second step.
Re: Custom files in the self-compiled Micropython
Esptool just copies data to the flash memory and does not care about the type of the data.
-
- Posts: 169
- Joined: Fri Aug 19, 2016 11:55 am
Re: Custom files in the self-compiled Micropython
But you can use pyboard.py to copy files after you used esptool.py to install MicroPython. Works fine in a script if you put a sleep 5 or something between them to let MicroPython boot.
Re: Custom files in the self-compiled Micropython
Another option is to use mpfshell with a script to upload your files. I use this for uploading example programs to test new display driver code. See the upload.mpf file in https://github.com/russhughes/st7789_mp ... /T-DISPLAY for an example. It’s not very fast but it works.
To install mpfshell: pyrhon3 -m pip install mpfshell
To run script: mpfshell -s upload.mpf
To install mpfshell: pyrhon3 -m pip install mpfshell
To run script: mpfshell -s upload.mpf