Skip to content
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

Add Storage Extension Support #7000

Merged
merged 5 commits into from Oct 13, 2022
Merged

Add Storage Extension Support #7000

merged 5 commits into from Oct 13, 2022

Conversation

microdev1
Copy link
Collaborator

@microdev1 microdev1 commented Oct 5, 2022

Adds ability to extend CIRCUITPY storage by utilizing the next update partition on boards with dualbank support.

The ota_x and user_fs partitions are presented as a continuous flash storage block with user_fs always forming the first part and the second part is one of the ota_x next update partition. These partition may not be contiguous in the partition-table.

Couple limitations as re-sizing filesystem without erasing isn't supported currently:

  1. Filesystem needs to be erased when re-sizing.
  2. If both ota_x app partitions need to contain bootable image, storage extension has to be turned off.

Note: TinyUF2 will need to be updated so it flashes the next update partition instead of defaulting to ota_0 in order to avoid data corruption when storage is extended.

@microdev1 microdev1 added enhancement circuitpython api espressif applies to multiple Espressif chips labels Oct 5, 2022
@microdev1 microdev1 linked an issue Oct 5, 2022 that may be closed by this pull request
@bill88t
Copy link

bill88t commented Oct 5, 2022

Is this ready for testing?
Or do we first have to wait for tinyuf2?

@microdev1
Copy link
Collaborator Author

@bill88t You can start with testing.

@bill88t
Copy link

bill88t commented Oct 6, 2022

Manually built f44288d and flashed on waveshare_esp32s2_pico as a uf2.

Had to look in the source to find it. storage.erase_filesystem(extended=True)
This needs to be documented.

Attempting a wget test.

image

Works just fine.
Let's try some more stuff.

image

It works if we go back to the first partition and to the 2nd again.

@bill88t
Copy link

bill88t commented Oct 6, 2022

If extended is not specified it assumes True, extending the storage. I did test that.
extended=False also works as expected.

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate you re-working how the storage.erase_filesystem call will work.
I have one minor nit, though.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this API -- thanks!

shared-bindings/storage/__init__.c Outdated Show resolved Hide resolved
shared-bindings/storage/__init__.c Outdated Show resolved Hide resolved
shared-bindings/storage/__init__.c Show resolved Hide resolved
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing!

shared-bindings/storage/__init__.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to get this in -- it will be in beta.2, which is imminent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
circuitpython api enhancement espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reclaim OTA1 for CIRCUITPY
4 participants