-
Notifications
You must be signed in to change notification settings - Fork 12
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
unpack/mkrbf produce incorrect rbf files for MakeCode uf2/elf files #37
Comments
@JakubVanek, you may be able to quickly fix this issue as you added the unpack functionality :) . |
I've never used this uf2 feature, so I am afraid I can't help. If you got patches, I can merge them though. |
Hi, I'm sorry for a late reply, I'll take a look at it today. With regards Jakub |
See c4ev3#37. Microsoft MakeCode creates strange UF2 files - they contain extra payload data that need to be in the file even though they overrun the specified file size.
I think I've found the problem. Unfortunately, the files produced by MakeCode are somewhat buggy and they trigger a sanity check in the current ev3duder code. The issue is the PR #38 should fix this. |
See #37. Microsoft MakeCode creates strange UF2 files - they contain extra payload data that need to be in the file even though they overrun the specified file size.
I stumbled over that problem when trying to upload a uf2 file to the EV3 (via Bluetooth on Linux).
How to reproduce:
lego-Untitled.uf2
.ev3duder uf2 unpack lego-Untitled.uf2
After starting the program, the EV3 will show a blank screen until it's return button is pressed.
I compared the correct rbf file, which is created by the EV3 when putting the uf2 file on it via USB, with the rbf file created by
unpack
. To achieve that, I downloaded the working rbf file via ev3duder Bluetooth from the brick. The only difference is the file length - the file created by the brick is 256 bytes long - which is 144null
bytes longer than the one created byunpack
. Appendingnull
bytes to the file created byunpack
can be achieved with the following command.truncate -s +144 Untitled.rbf
mkrbf creates a non-working rbf file which differs in content as well as in size from the working one.
ev3duder mkrbf ../prjs/BrkProg_SAVE/Untitled.elf Untitled.rbf
For OpenRoberta uf2 files, both means produce a working rbf file -
unpack
as well asmkrbf
.Some more remarks:
Edit 2021-03-30: Regarding the file system issue see also Cannot reliably mount emulated storage under Linux microsoft/uf2-linux#6 and Cannot reliably mount emulated storage under Linux microsoft/pxt-ev3#980.
Edit 2021-03-30: Apparently latter uf2 files are emulated according to this comment.
https://github.com/simonedegiacomi/files2uf2
The text was updated successfully, but these errors were encountered: