-
Notifications
You must be signed in to change notification settings - Fork 3k
Enable boot-loader builds #3733
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
Conversation
/morph test |
2887a7d
to
956d9b9
Compare
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest Prep failed! |
test prep failed !? :/ ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Looks like my rebasing killed it. /morph test |
tools/build_api.py
Outdated
part = IntelHex() | ||
_, inteltype = splitext(region.filename) | ||
part.fromfile(region.filename, inteltype[1:]) | ||
if part.maxaddr() > region.size: |
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.
Should this be ">=" rather than ">"?
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.
Yes
tools/build_api.py
Outdated
pad_size = region.size - (part.maxaddr() + 1) | ||
if pad_size > 0 and region != region_list[-1]: | ||
print(" Padding region %s with %d bytes" % (region.name, pad_size)) | ||
merged.puts(region.start + part.maxaddr(), |
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.
Is this going to clobber the last byte of region
?
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.
Nope. The size should be calculated correctly as pad_size
above
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.
Wait, yes.
tools/build_api.py
Outdated
|
||
if not exists(dirname(destination)): | ||
makedirs(dirname(destination)) | ||
print("Space used after regions merged: %d" % merged.maxaddr()) |
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.
Should one be added here?
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.
Yes
tools/config.py
Outdated
_, inteltype = splitext(filename) | ||
ih = IntelHex() | ||
ih.fromfile(filename, format=inteltype[1:]) | ||
if ih.minaddr() != 0: |
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.
I just realized that the STMF429 has flash starting at address 0x08000000 so non-zero flash address support will be needed.
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.
Okay. Thanks.
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
956d9b9
to
e604eaf
Compare
Just rebased to address @c1728p9's comments. It's good to run testing again. /morph test |
e604eaf
to
d8b54ef
Compare
tools/config.py
Outdated
_, inteltype = splitext(filename) | ||
ih = IntelHex() | ||
ih.fromfile(filename, format=inteltype[1:]) | ||
if ih.minaddr() != 0 and ih.minaddr() != rom_start: |
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.
Why is this still checked against address 0?
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.
In the case of .bin files, there is no specified start address, so it defaults to zero.
Result: FAILUREYour command has finished executing! Here's what you wrote!
|
0033855
to
3025fd3
Compare
Rebased master so that travis will pass. /morph test |
tools/build_api.py
Outdated
|
||
if not exists(dirname(destination)): | ||
makedirs(dirname(destination)) | ||
print("Space used after regions merged: 0x%x" % (merged.maxaddr() + 1)) |
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 is printing the max address rather than size
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.
Yes it is.
tools/build_api.py
Outdated
(region.name.upper() + "_SIZE", region.size)]: | ||
profile["common"].append("-D%s=0x%x" % define) | ||
active_region = [r for r in regions if r.active][0] | ||
for define in [("MBED_APP_OFFSET", active_region.start), |
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.
Since this is an absolute address it might make more sense as "MBED_APP_START"
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.
You're right.
tools/config.py
Outdated
part = intelhex_offset(filename, offset=rom_start) | ||
if part.minaddr() != rom_start: | ||
raise ConfigException("bootloader executable does not " | ||
"start at 0") |
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 message should be updated to use the new address
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.
Yes it should.
tools/utils.py
Outdated
if inteltype == ".bin": | ||
ih.loadbin(filename, offset=offset) | ||
elif inteltype == ".hex": | ||
ih.loadhex(filename) |
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.
Might want to raise an exception here indicating that the filetype is unsupported.
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.
I will do that.
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.
It now does that.
3025fd3
to
3b1c1b6
Compare
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest Prep failed! |
looks like another rebase killed the bot. /morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
bf6117d
to
3e15542
Compare
/morph test |
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.
Can you add a second commit that adds a flag bootload-support
to the target class which represents that the linker scripts have been modified to support multiple execution regions in a flat memory space
bootloader_exec can this be binary or hex or both? If only one maybe bootloader_bin or bootloader_hex otherwise just bootloader_img if can handle both
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
retest uvisor |
@theotherjimmy Can you please review the @sg- comment above? |
3e15542
to
319647d
Compare
@sg- This has been updated to reflect your comment. |
@sg- What do you want from the |
To enable a boot-loader style application, override "targets.bootloader_exec" or "targets.restrict_size" on a particular target. These parameters are a bin or hex file, and an integer, in bytes, respectively. If either override is present, then an application region is created after the boot-loader region, when "targets.bootloader_exec" is present, and before post-application, when "targets.restric_size" is present. The size of the boot-loader region is read from the file provided in the configuration.
This patch will prevent building bootloader builds on targets that have not yet had their linker scripts/scatter files changed to allow for the ROM space shrinking expected by bootloader builds. At the point of this patch, bootloader linker script modifications are only supported by the NUCLEO_F429ZI, K64F, KL46Z, and Odin.
319647d
to
d62f046
Compare
Lolwut? did not mean to do that. Might have been a stray return /morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
To enable a boot-loader style application, overrides
"targets.bootloader_exec" or "targets.restrict_size" on a particular
target. These parameters are a bin or hex file and an integer, in bytes,
respectively. If either override is present, then an application region
is created after the boot-loader region, when "targets.bootloader_exec"
is present, and before post-application, when "targets.restric_size" is
present. The size of the boot-loader region is read from the file
provided in the configuration.
Status
READY
Todos