How to reduce time to generate .UF2 with frozen script #13405
-
Good evening. As part of my project I need to freeze a relative large (+3000 lines) .py script for a Raspberry Pi Pico. As the script grew too big, and I still need to add more features, I find myself in trouble since I can't use the interpreter anymore; it keeps throwing many errors. I found that freezing my routine into the firmware allows me to keep going. So, I setup a Docker container that builds all the neccesary tools, and I can generate the .UF2 firmware with the required modifications, including the single module "mymodule.py" on /ports/rp2/modules that gets compiled and can be imported and run, so far so good. Thing is, as expected, every single modification to "mymodule.py" involves generating ALL the modules that make up MicroPython, even though none of them have changed, except for my single file. This takes a very long amount of time to process; I was able to reduce it somehow by using a multi-stage container; in which the first stage generates up to Is there any way of configuring CMake to stop right when it finished generating all the .obj files pertinent to MicroPython, ideally on the first stage; then compile my single file, and finally linking all together to generate the .UF2? Any help will be much appreciated. Sincerely, Ricardo. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
That could be related to the docker build style. I use a standard file system build environment, and If I modify a frozen script after build and rebuild the firmware, then just that modified file is re-compiled and the binary is created. |
Beta Was this translation helpful? Give feedback.
-
Building with the proper filesystem takes care of the unmodified components |
Beta Was this translation helpful? Give feedback.
That could be related to the docker build style. I use a standard file system build environment, and If I modify a frozen script after build and rebuild the firmware, then just that modified file is re-compiled and the binary is created.