Skip to content

esp32: Add VFS FAT partition to partitions.csv and mount it as the FS. #5027

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

Closed

Conversation

dpgeorge
Copy link
Member

This PR uses the newly-added esp32.Partition class to replace the existing FlashBdev class. Partition objects implement the block protocol so can be directly mounted via uos.mount(). This has the following benefits:

  • allows the filesystem partition location and size to be specified in partitions.csv, and overridden by a particular board
  • very easily allows to have multiple filesystems by simply adding extra entries to partitions.csv
  • improves efficiency/speed of filesystem operations because the block device is implemented fully in C
  • opens the possibility to have encrypted flash storage (since Partitions can be encrypted)

Note that this patch is fully backwards compatible: existing filesystems remain untouched and work with this new code.

@nevercast
Copy link
Contributor

Now that #4991 has merged, would there be merit to adding this as a VFS board config to demonstrate how that is done, with custom partitions?

Then I'd suggest @zrecore would rebase and fix #4987 to align with this PR, just with a smaller partition size.

@jimmo
Copy link
Member

jimmo commented Aug 24, 2019

What should happen to modesp's flash_user_start as it's no longer needed by flash_bdev.py. I'd guess changed return the start of the vfs partition? (Or deprecated?)

zrecore added a commit to femtoduino/micropython that referenced this pull request Aug 24, 2019
Updating custom partitions CSV comments

Removing 404 link in comments

Adjusting partitions CSV for 2MiB ESP32 devices. Storage partition is now 0xA0000 (640KiB)

Adding support for ESP32-D2WD (2MiB) for issue micropython#4986

Removing 404 link in comments

Adjusting partitions CSV for 2MiB ESP32 devices. Storage partition is now 0xA0000 (640KiB)

Implementing boards mpconfigboard files for generic ESP32-D2WD board type

Rebase off upstream master branch. Adding support for ESP32-D2WD (2MiB) for issue micropython#4986

Git rebase off upstream master. Removing 404 link in comments

What is this, recursion? Attempting to rebase off upstream master. Again. Adding support for ESP32-D2WD (2MiB) for issue micropython#4986

Removing 404 link in comments

Removing merge conflict junk leftovers

We no longer need some of the changes once we rebase off PR micropython#5027. FLASH_USER_START and FLASH_SIZE removed.

No need for gitignore modifications

Removing left over edit to README

Rolling back changes to modesp, updating partitions-2MiB.csv to name storage partition as vfs

Undoing changes to gitignore

Renaming board config for generic ESP32-D2WD
@dpgeorge
Copy link
Member Author

Ok, merged in 31de447

What should happen to modesp's flash_user_start as it's no longer needed by flash_bdev.py. I'd guess changed return the start of the vfs partition?

Probably best to just deprecate them. The start of the vfs partition can be obtained from the Partition object.

@dpgeorge dpgeorge closed this Sep 10, 2019
@dpgeorge dpgeorge deleted the esp32-mount-partition-vfs branch September 10, 2019 05:16
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants