-
Notifications
You must be signed in to change notification settings - Fork 178
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
Like CURRENT.UF2, could there be EVERYTHING.UF2 w/ entire flash filesystem? (code.py,libs,etc) #117
Comments
it depends on the port, can you tell which board you are using ? |
I was hoping it could be platform-independent. I use almost all the CircuitPython platforms pretty regularly: ESP32-S2, SAMD, and RP2040. (I understand RP2040 is ROM-based UF2) |
Platform-independent still need port specific implementation to pull this off.
|
We are also interested in exact the same feature. Mainly on ESP32S2. |
For chips that use a partition, perhaps it would be possible to update to expose each of the partitions as UF2 binaries? This would require:
Embedded-safe C++
Sometimes called "C++ as a better C", it restricts what features of C++ are used. For example, absolutely prohibited features include:
Usable features that provide value include:
This would definitely take a while to implement, because the current ghostfat code has many compile-time constants and behaviors that ensured via |
@henrygab thank you for your informative input, though, I think bootloader should just focus on |
Ok, you're the boss! 👍 |
I believe that SAMD's CURRENT.UF2 already includes the filesystem. nRF may as well. It is definitely a handy feature. |
@tannewt SAMD & nRF52 CURRENT.UF2 includes all internal flash contents therefore also include internal file system e.g nvm if available but not the file system on external flash. The S2/S3 has different partitions for firmware, nvm, file system and they may not be continuous, You probably understand this better than me. For S2/S3, currently tinyuf2 limit itself within the firmware(ota) partition to prevent overwriting to other partitions. Therefore the address in uf2 is starting from zero 0x00 as start of partition. However we could enhance this behavior and dump everything into CURRENT.UF2 (after partition table and 2nd stage bootloader), and when writing back we simply write over everything. To prevent bricking incompatible partition table and/or different flash size e.g 4 MB vs 8 MB we could use
Nah, I wouldn't want bootloader to know too much of app knowledge and just want to write as less code as possible. Putting them all into CURRENT.UF2 is better way to go. NOTE: currently max size is around 32MB with 1 cluster = 1 sector config, which limit the flash chip to less than 16MB. To support 16MB and more, we need to enhance ghostfat to run with 1 cluster = n sectors (n to be decided later). |
Very good points @hathach. It'd probably be best to chat with the Microsoft UF2 folks about how we designate UF2s for different uses (aka partitions.) We wouldn't want to copy off the nvm partition data and then copy it over an ota section. |
FYI: ESP32 appears to be hard-coded to only allow writes to the Moreover, the offset stored in existing Ghostfat has no concept of which file is being written to, and IO can be re-ordered by the time the device sees it (e.g., no guarantee that sector 0 will be seen as written by device before sector 10). Therefore, you cannot simply insert a "switch to partition X" (or any stateful) command into the head of the In combination, these factors make it challenging to support writing more than a single target partition in ghostfat. However, if you simply want to expose additional expand for links to relevant portions of code
The target address is embedded in each sector of the Lines 86 to 95 in 9104f7c
Ghostfat provides the buffer provided by the Line 498 in 9104f7c
As an example, the Espressif port caches stuff: tinyuf2/ports/espressif/boards/board_flash.c Lines 109 to 122 in 06a65c8
But... the tinyuf2/ports/espressif/boards/board_flash.c Lines 72 to 75 in 06a65c8
|
Yup, currently tinyuf2 for esp32s2/s3 is writing as offset to ota0 to prevent overflow to other partition.
I think the most wanted featured is not exposing additional partition as uf2. User want to take the snapshot of the current working state of application(firmware + data) and then clone/deploy/duplicate it to another board. Therefore I think packing all the flash together within a single all-in-one UF2 make more sense. However, since the current code use address as offset to 1st partition (start address = 0), I would suggest to use vendor+board id as family for the all-in-one uf2 in addition to current offset scheme. |
Coming back to this after 3 years: having a single UF2 to install would make loading up all the code on the MEMENTO board a lot easier. |
ah, I wouldn't want bootloader to know too much of app knowledge and just want to write as less code as possible. Putting them all into CURRENT.UF2 is better way to go. NOTE: currently max size is ar |
igual mente gracias . gracias por todo pe osti jajaja, o ye com2 estas |
A Discord discussion led me to want the ability to have something like
CURRENT.UF2
, but contained both the current version of CircuitPython and the contents of the CP filesystem (code.py
,lib
, etc)Would it even be possible for this hypothetical
EVERYTHING.UF2
virtual file to be created? I know this is outside of the purview of the bootloader, but if the bootloader takes an entire snapshot of all known flashes and restores them, would it work?The text was updated successfully, but these errors were encountered: