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

uf2 flash partially if not start at 4K boundary #9

Open
juju2013 opened this issue May 31, 2021 · 2 comments
Open

uf2 flash partially if not start at 4K boundary #9

juju2013 opened this issue May 31, 2021 · 2 comments

Comments

@juju2013
Copy link

juju2013 commented May 31, 2021

Trying to do this:

dd if=/dev/urandom of=random.bin bs=1024 count=100
uf2conv.py -b 0x10020100 -o random.uf2 -c -f RP2040 random.bin
cp random.uf2 /mnt/uf2 && sync

Note that address starts at 0x10020100: after reboot, content between 0x****000 and 0x***100 stays unchanged (0xFFFFFFFF), shown as following:
( see https://gist.github.com/juju2013/6e5d129effd3e7d3b43a6bc8973306ff )
$10020100 ........ $10021000 FFFFFFFF $10021100 ........ $10022000 FFFFFFFF $10022100 ........ $10023000 FFFFFFFF $10023100 ........ $10024000 FFFFFFFF $10024100 ........ $10025000 FFFFFFFF $10025100 ........ $10026000 FFFFFFFF $10026100 ........ $10027000 FFFFFFFF $10027100 ........ $10028000 FFFFFFFF $10028100 ........ $10029000 FFFFFFFF $10029100 ........ $1002A000 FFFFFFFF
If that address starts at a 4K boundary, content flashed as expected.

Documentation says ( 2.8.3.2. UF2 Format Details ):
Note that flash is erased a 4K sector at a time, so writing to only a subset of a 4K flash sector will leave the rest of that flash sector undefined. Beyond that there is no requirement that a binary be contiguous.

@kilograham
Copy link
Contributor

Please reformat that output!

@kilograham
Copy link
Contributor

Yes this is a bug. UF2s that do not start on a 4K boundary are not written correctly.
elf2uf2 and the docs will be updated in the next release

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

No branches or pull requests

2 participants