Skip to content

feature: allow flashing of uf2s with non-contiguous blocks#23

Open
cathiele wants to merge 1 commit intopelrun:mainfrom
cathiele:non-contiguous-uf2
Open

feature: allow flashing of uf2s with non-contiguous blocks#23
cathiele wants to merge 1 commit intopelrun:mainfrom
cathiele:non-contiguous-uf2

Conversation

@cathiele
Copy link

If you want to flash ZeptoForth via UF2 Loader, it fails because ZeptoForth uses a UF2 format with gaps in it. The address blocks are not contiguous. The current UF2 Loader cannot handle this and fails to flash the UF2.

This also happens with UF2s downloaded via the ZeptoForth download_uf2_image.sh script.

With this PR it is possible to flash non-contiguous UF2s via UF2 Loader.

Therefore the flash is not erased upfront, but is instead erased sector by sector in the flash loop. To track whether a sector has already been erased, a bitmap has been added to track the sector state. This way a sector is only erased once, preventing already written blocks in the sector from being overwritten.

I tested it only on RP2350 with various UF2s (WebMite, Logo, Lua, rpngo, and of course ZeptoForth) and it looks promising.

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.

1 participant