-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add VfsMap filesystem, mpremote deploy-mapfs, and ability to import .mpy files from ROM (WIP) #8381
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
Open
dpgeorge
wants to merge
33
commits into
micropython:master
Choose a base branch
from
dpgeorge:extmod-vfs-map
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
ed7c169
py/objarray: Add MP_DEFINE_MEMORYVIEW_OBJ convenience macro.
dpgeorge 6c25351
extmod/modvfs: Add rom_ioctl function.
dpgeorge e8d746c
unix: Implement rom_ioctl.
dpgeorge 7cc96ed
qemu/main: Implement rom_ioctl.
dpgeorge a24afb4
tools/mpremote: Add "romfs build" and "romfs deploy".
dpgeorge b6f9f09
tools/mpremote: Add "romfs query" subcommand.
dpgeorge 75af92d
stm32: Enable VfsRom.
dpgeorge 1c1e38d
stm32: Disable machine.Pin legacy on NUCLEO_F091RC.
dpgeorge bde499b
stm32: Increase size of NUCLEO_F091RC ROM partition.
dpgeorge 82ed2fc
stm32: Rework ROM partition support.
dpgeorge 5b56336
stm32/boards/ARDUINO_GIGA: Enable ROMFS.
iabdalkader 90f5af4
stm32/boards/ARDUINO_NICLA_VISION: Enable ROMFS.
iabdalkader e6b2259
stm32/boards/ARDUINO_PORTENTA_H7: Enable ROMFS.
iabdalkader dfcb341
rp2: Enable VfsRom.
dpgeorge f582796
rp2/rp2_flash: Allow MICROPY_HW_ROMFS_BYTES to be configurable.
dpgeorge 2745616
esp32: Enable VfsRom.
dpgeorge d0c1e6f
esp8266: Enable VfsRom.
dpgeorge 711615a
mimxrt/mimxrt_flash: Add support for the VfsRom filesystem.
robert-hh b601c9e
samd: Support the VfsRom file system for SAMD21.
robert-hh aa05efb
samd: Support the VfsRom file system for SAMD51.
robert-hh a237029
nrf/modules/flashbdev: Add support for VfsRom.
robert-hh e75c8a6
nrf/main: Use frozen _boot.py to set up and mount the file system.
robert-hh 877953d
renesas-ra/storage: Add support for a VfsRom file system.
robert-hh c5c3d04
mimxrt/Makefile: Set VfsRom size in Makefile and define vfsrom symbols.
robert-hh 77f12f3
mimxrt: Update rom_ioctl protocol.
dpgeorge d9111eb
samd: Update to use new rom_ioctl protocol.
dpgeorge 9d40ed2
nrf: Update to use new rom_ioctl protocol.
dpgeorge 0013dae
renesas-ra: Update to use new rom_ioctl protocol.
dpgeorge ca78107
github/workflows: Use ubuntu-latest for stm32 CI.
dpgeorge 31e56a2
samd/samd_flash: Add the buffer protocol to samd_flash_type.
robert-hh 0f55bfe
samd/samd_flash: Round up number of pages.
dpgeorge dfeec44
Revert "github/workflows: Use ubuntu-latest for stm32 CI."
dpgeorge 2431419
WIP: add manifest support
dpgeorge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
# Minimal _boot.py for the 512kiB variant. Does not set up a block device or | ||
# filesystem. Other variants use esp8266/modules/_boot.py. | ||
|
||
import gc | ||
import gc, vfs | ||
|
||
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4) | ||
|
||
# Try to mount the ROMFS. | ||
try: | ||
vfs.mount(vfs.VfsRom(vfs.rom_ioctl(2)), "/") | ||
except: | ||
pass | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module("_boot.py", opt=3) | ||
module("apa102.py", base_path="$(PORT_DIR)/modules", opt=3) | ||
module("port_diag.py", base_path="$(PORT_DIR)/modules", opt=3) | ||
require("ntptime") | ||
require("dht") | ||
require("onewire") | ||
require("ds18x20") | ||
require("webrepl") | ||
require("neopixel") | ||
# module("apa102.py", base_path="$(PORT_DIR)/modules", opt=3) | ||
# module("port_diag.py", base_path="$(PORT_DIR)/modules", opt=3) | ||
# require("ntptime") | ||
# require("dht") | ||
# require("onewire") | ||
# require("ds18x20") | ||
# require("webrepl") | ||
# require("neopixel") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we delete these instead of commenting them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they should be deleted.
I was using the 512k esp8266 firmware as a good example of a very constrained board which would benefit from ROMFS, and that helped drive the design of some of the parts, to make things work on this board.
IMO it makes sense to remove these frozen modules and make them part of the ROMFS, because then they are fully configurable by the user. At the moment unfortunately we don't have a way to provide default ROMFS filesystems. If we did then we could just bundle a pre-made ROMFS with the 512k esp8266 firmware and retain the same set of included modules, they just moved from frozen to ROMFS.
@projectgus do you think it's worth adding such a feature, a pre-baked ROMFS included in firmware? The issue is that if users have a custom ROMFS and then update the firmware, that firmware update will reset their ROMFS to the pre-baked one. Maybe we need separate firmware, a "first install" firmware and then "update that leaves filesystem alone".
Alternatively, can just document how a user would get back the old set of frozen files here, installed instead on the ROMFS. That's not particularly easy though. It really needs a web tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that could be useful, but the main requirement is having a migration path from "frozen into firmware" to "built into ROMFS". Building it with the firmware by default would achieve this, but I think it'd be OK to not support this provided there was a pathway to doing it in an alternative way.
I'm personally less worried about the particular case of 512kb esp8266 and more worried about the other boards where the linker scripts reduce the available app binary size on update.
At least the users who are freezing custom files into their firmwares are doing custom builds already, so they're probably not afraid to follow a few additional command line steps.