-
-
Notifications
You must be signed in to change notification settings - Fork 80
EV3 u-boot fixes #315
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
Merged
Merged
EV3 u-boot fixes #315
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This script is meant to be run as an executable. Not all systems will have python, so we should explicitly use python3.
Do not truncate u-boot.bin to 256KiB. This could cause crashes or other undefined behavior. Instead, just fail with an error message.
Change the uImage type to standalone, not Linux kernel. Technically it isn't u-boot either, but there isn't any other better option for the OS selection.
79efaa1 to
1fec940
Compare
Download u-boot.bin instead of committing it to the repository. We should not be committing binary blobs to source control. instead, we can commit the SHA256 checksum to ensure we are getting what we expect and only download the file when needed.
The entry point address in the uImage was hardcoded to 0xC0008000, but the actual entry point address is determined by the linker. It was just by luck that the entry point was close to the load address and there weren't any jumps between, so it eventually got to the entry point after executing some random code. Instead, we can scrape the entry point address from the ELF file using `readelf`, which will adapt to any changes. For good measure, we also scrape the load address, which is also determined by the linker script.
There was lots of trailing whitespace and one comment was misaligned.
laurensvalk
reviewed
Jul 5, 2025
|
|
||
| if len(uboot_blob) > UBOOT_MAX_SIZE: | ||
| print("u-boot file is bigger than expected. Using only the first 256KiB.") | ||
| uboot_blob = uboot_blob[:UBOOT_MAX_SIZE] |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was initially used to use the original LEGO firmware as a source to extract u-boot. But if we have a proper u-boot now, we should indeed no longer need it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This cleans up some stuff related to using u-boot on the EV3 and updates to the latest mainline u-boot (with some Pybricks modifications).