freeze-python-code #52

Merged
matthias merged 3 commits from freeze-python-code into main 2025-12-01 19:25:07 +00:00
Owner

Add all python code run on the device to the manifest.py to freeze it. This has two benefits:

  • It precompiles the bytecode, so it is smaller and faster
  • All code (C and python) is now in the firmware image, leaving the littlefs filesystem on the flash free for user settings.

This requires changing the way the hardware variants are handled. There is now only one filesystem image, but instead there are different firmware images for each variant.

Add all python code run on the device to the manifest.py to freeze it. This has two benefits: - It precompiles the bytecode, so it is smaller and faster - All code (C and python) is now in the firmware image, leaving the littlefs filesystem on the flash free for user settings. This requires changing the way the hardware variants are handled. There is now only one _filesystem_ image, but instead there are different _firmware_ images for each variant.
matthias self-assigned this 2025-11-11 21:34:03 +00:00
matthias added 3 commits 2025-11-11 21:34:04 +00:00
Remove python files that are not referenced directly or indirectly by
main.py.

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
Add all python code run on the device to the manifest.py to freeze
it. This has two benefits:
- It precompiles the bytecode, so it is smaller and faster
- All code (C and python) is now in the firmware image, leaving the
  littlefs filesystem on the flash free for user settings.

This requires changing the way the hardware variants are handled. There
is now only one _filesystem_ image, but instead there are different
_firmware_ images for each variant.

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
ci: Fix build.yaml for changed output dir
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 4m29s
Check code formatting / Check-C-Format (push) Successful in 7s
Check code formatting / Check-Python-Flake8 (push) Successful in 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 11s
f403bf289f
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
matthias requested review from Members 2025-11-11 21:34:04 +00:00
matthias force-pushed freeze-python-code from f403bf289f to f9b7adad22 2025-11-23 12:21:53 +00:00 Compare
matthias force-pushed freeze-python-code from f9b7adad22 to 44434683e5 2025-11-28 16:59:22 +00:00 Compare
matthias force-pushed freeze-python-code from 44434683e5 to 19afb2f936 2025-11-28 17:20:14 +00:00 Compare
stefank approved these changes 2025-12-01 19:23:23 +00:00
matthias merged commit 79a970e70a into main 2025-12-01 19:25:07 +00:00
matthias deleted branch freeze-python-code 2025-12-01 19:25:07 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TonBERRY/tonberry-pico#52