-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Freezing resources that are not Python scripts #5394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is possibly a longer-term feature for the manifest system, but not currently implemented. At the moment it only generates frozen modules (with optional compiling to bytecode first). The code that loads modules at runtime (i.e. the import statement) then preferentially finds these frozen modules before looking on the filesystem. However the filesystem itself is totally separate and not part of the firmware image. It is possible however to construct a filesystem and append it to the firmware image. See for example https://forum.micropython.org/viewtopic.php?f=16&t=6677 for some general ideas but also at the end of the thread there's an ESP8266-specific example of doing this all automatically. |
This utility enables an arbitrary file to be converted to Python source which can be frozen. |
I think this is right way. Thank you! |
I have done something based on Peter's solution which has worked quite well for me. Plus easily do dynamically build and move into my frozen file directory when building the firmware. |
That sounds as the best way. Would be great if this is doable in the normal micropython build pipeline. It would also be good not only not to transfer non-py files on the device, but also to avoid having to create the filesystem on the first startup e.g. with inisetup.py. I see the advantages over Peter's solution in the fact that you can open the files normally. So it is also possible to change the files, like all normal files. |
That is true, and there are applications for a filesystem populated at build time. The approaches have different benefits and drawbacks. My approach has the following benefits, especially if you need random access e.g. for fonts:
The immutability of frozen bytecode is therefore both a benefit and a limitation. |
Add initial esp32c3 support
Uh oh!
There was an error while loading. Please reload this page.
I want to flash modules with html files together, but I can't read them.
e.g list
_boot.py
public/index.html
I modified makemanifest.py to pass other files types as path, I cheked existing it in the firmware.elf, and it exist, but I cant read it for send by http
May be exist way for read those files or what sorces can I modify for get this possibility?
The text was updated successfully, but these errors were encountered: