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

armcc - remove fromelf output before regenerating one #6344

Merged
merged 1 commit into from
Mar 21, 2018

Conversation

tung7970
Copy link
Contributor

Description

Fix armcc recompile errors during elf2bin stage. Errors shown as follows:

Elf2Bin: mbed-os-example-wifi
Error: Q0147E: Failed to create Directory .\BUILD\REALTEK_RTL8195AM\ARM\mbed-os-example-wifi.bin\IMAGE2_TABLE: File exists
Finished: 0 information, 0 warning and 1 error messages.
[ERROR] Error: Q0147E: Failed to create Directory .\BUILD\REALTEK_RTL8195AM\ARM\mbed-os-example-wifi.bin\IMAGE2_TABLE: File exists
Finished: 0 information, 0 warning and 1 error messages.

Fix issue #6306

Pull request type

  • Fix
  • Refactor
  • New target
  • Feature
  • Breaking change

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 13, 2018

This is related, similar change that resulted in this issue #5537 , see #5021

In the issue 6306:

I personally prefer option 2 since it solves the problem and also makes armcc behave like the rest

How is it with rest ? IAR and GCC ARM?

@samchuarm
Copy link

@ARMmbed/team-realtek

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excerpts from prior PRs that proposed the same change:

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.

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.

How do you plan on correcting that behavior for the LPC4088_DM? How do you plan on making this change in a way that is backwards compatible? Could using a .hex file be a viable workaround?

@samchuarm
Copy link

Hi @tung7970 could you please help comment on @0xc0170 @theotherjimmy questions? Thanks.

Fix armcc recompile errors during elf2bin stage. Errors shown as follows:

Elf2Bin: mbed-os-example-wifi
Error: Q0147E: Failed to create Directory .\BUILD\REALTEK_RTL8195AM\ARM\mbed-os-example-wifi.bin\IMAGE2_TABLE: File exists
Finished: 0 information, 0 warning and 1 error messages.
[ERROR] Error: Q0147E: Failed to create Directory .\BUILD\REALTEK_RTL8195AM\ARM\mbed-os-example-wifi.bin\IMAGE2_TABLE: File exists
Finished: 0 information, 0 warning and 1 error messages.

Signed-off-by: Tony Wu <tonywu@realtek.com>
@tung7970
Copy link
Contributor Author

@0xc0170 So far, only ARMCC creates directory if there are multiple load regions.
@theotherjimmy The other solution is to remove output file/directory before regenerating one. Please see the revised patch. This should be backward compatible and target independent.

@tung7970 tung7970 changed the title armcc - generates one output file for multiple load regions armcc - remove fromelf output before regenerating one Mar 20, 2018
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 20, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 20, 2018

Build : SUCCESS

Build number : 1496
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6344/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 20, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants