-
Notifications
You must be signed in to change notification settings - Fork 3k
ARMCC - FromELF multiple regions #5021
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
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.
Awesome diff. How backwards compatible do you think this is?
It shouldn't make any difference if there is a single region.
|
http://www.keil.com/support/man/docs/armutil/armutil_pge1362128885938.htm
|
Thanks for the clarification. I think that |
How can I find the reason for failure? |
@chrissnow I'm looking for the error right now. Just a moment. |
I think the logging borked for that job. @tommikas Could you verify? It looks very suspicious:
|
@chrissnow I'm not sure why it failed. Maybe @tommikas can help us out with this one. |
@theotherjimmy Looks like some 6lowpan tests failed. A few other builds also failed for the same reason so it's probably nothing to do with this PR. I'll restart the builds. |
@theotherjimmy it passed this time :-) , Thanks @tommikas |
…ltiple regions are converted to a single binary and not a folder of regions
08a544a
to
3bffb49
Compare
cc @c1728p9 |
@chrissnow, with this change are you able to get mbed-os-example-bootloader-blinky_application running, or does this only enable you to build a binary? I would imagine this change still does not create a bootable image. Normally the CRP region (0x02FC) lies inside a load region as seen in the lpc1768 scatter file. If you are building blinky with a bootloader then the application is at a higher address, so the CRP (fixed at 0x02FC) no longer resides in in a load region. A safer solution would be to put the CRP data in a section relative to the load region. That way when you build a program with a bootloader the CRP moves with the application. An example of this can be found in the K64F scatter file which has a dedicated execution region in the load region for flash settings. |
@chrissnow, with the changes in #5038 do you still see two separate regions created? |
@c1728p9 not as it stands, though that might not be the case if I add extra ER as suggested. |
@chrissnow I believe an extra binary will only be created if there are multiple LRs (Load Regions). Extra ERs (Execution Regions) shouldn't be a problem, as many targets already have several ERs. Typically when there are multiple LRs and building creates a directory rather than a binary it indicates something is wrong in the scatter file. Adding this change may mask scatter file errors. Rather than having an obvious error at compile time, a binary will be created that does not work. |
From --bincombined: I found few devices, LPC407X_8X, also REALTEK has 3. Is this regular use case to have multiple load regions? |
/morph test |
Result: ABORTEDYour command has finished executing! Here's what you wrote!
|
This was aborted, needs an approval from @c1728p9 |
It looks like the LPC4088_DM's post build hook makes use of multiple regions being created if the binary is big enough. It does this by manually combining the regions with little padding (up to 512K). With this PR padding is done automatically, but rather than 512K it pads the entire address space from LR_IROM1 to LR_IROM which is ~640MB. |
Short of using hex files over bin there isn't much you can do about this. If nothing else the build tools should deal with this gracefully, it's a bit cryptic as it stands. |
@theotherjimmy @c1728p9 What are you opinions for this? |
Maybe the mbed-os build tools should print a nicely formatted error message if this occurs and there isn't a post build hook for the platform. @theotherjimmy what do you think? |
@c1728p9 That sounds fine. What would you like the tools to say? |
@theotherjimmy @c1728p9 bump |
/morph build |
Build : SUCCESSBuild number : 96 Triggering tests/test mbed-os |
Test : SUCCESSBuild number : 34 |
I set this to needs: clarification. I would like to see this closed with a new tracking issue for tools |
Tracking issue created #5537. We can close this for now @chrissnow Thanks for the effort! |
Description
ELF files containing multiple regions were being converted to a folder with each region as a separate file, this caused the build scripts to fail since the .bin was not created.
This was noticed when building LPC1768 with a bootloader as the CRP word is set as a seperate region.
mbed-os/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/startup_LPC17xx.S
Line 86 in 5bddd88
Status
READY
Migrations
NO
Related PRs
Todos
Deploy notes
Steps to test or reproduce
Enable bootloader support for LPC1768 and try and build