Skip to content

Size should be calculate after confirm the final start address #10448

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 2 commits into from
Apr 30, 2019

Conversation

fredlee12001
Copy link
Contributor

@fredlee12001 fredlee12001 commented Apr 22, 2019

Description

The final size maybe wrong if we caculate the size before start address.
Since the start address may shift after align operation, then the final size/post address should shift as well.

Pull request type

[x ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@fredlee12001 fredlee12001 changed the title Size should be calculate after confirm the start address Size should be calculate after confirm the final start address Apr 22, 2019
@ciarmcom
Copy link
Member

@fredlee12001, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested review from a team April 22, 2019 05:00
@bulislaw
Copy link
Member

@bridadan please review

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

This looks like a correct fix. Before this comes in, would you mind posting a before and after log of the region output? I'm specifically interested in the following part, which is found at the top of the log when running mbed compile from a project that uses a bootloader:

$ mbed compile
[mbed] Working path "C:\Users\bridan01\onedrive_arm\Documents\dev\mbed-cloud-client-example" (program)
Building project mbed-cloud-client-example (K64F, ARMC6)
Scan: mbed-cloud-client-example
Using ROM regions bootloader, header, application in this build.
  Region bootloader: size 0x8000, offset 0x0
  Region header: size 0x70, offset 0xa000
  Region application: size 0xf5c00, offset 0xa400

@fredlee12001
Copy link
Contributor Author

fredlee12001 commented Apr 25, 2019

Hi @bridadan ,

Result before the changes:

freli01@Fred-PC:mbed-os-example-blinky$ mbed compile -t GCC_ARM -m K64F
[mbed] Working path "/home/freli01/mbed/customers/RDA/UNO_91H/mbed-os-example-blinky" (program)
[Warning] @,: Compiler version mismatch: Have 7.3.1; expected version >= 6.0.0 and < 7.0.0
Building project mbed-os-example-blinky (K64F, GCC_ARM)
Scan: mbed-os-example-blinky
Using ROM regions bootloader, header, application, post_application in this build.
Region bootloader: size 0x5000, offset 0x0
Region header: size 0x70, offset 0x8000
Region application: size 0xcef80, offset 0x8400
Region post_application: size 0x28c80, offset 0xd7380

Result after the changes:

freli01@Fred-PC:mbed-os-example-blinky$ mbed compile -t GCC_ARM -m K64F
[mbed] Working path "/home/freli01/mbed/customers/RDA/UNO_91H/mbed-os-example-blinky" (program)
[Warning] @,: Compiler version mismatch: Have 7.3.1; expected version >= 6.0.0 and < 7.0.0
Building project mbed-os-example-blinky (K64F, GCC_ARM)
Scan: mbed-os-example-blinky
Using ROM regions bootloader, header, application, post_application in this build.
Region bootloader: size 0x5000, offset 0x0
Region header: size 0x70, offset 0x8000
Region application: size 0xcfc00, offset 0x8400
Region post_application: size 0x28000, offset 0xd8000
Compile [ 0.5%]: mbed_tz_context.c

Test config value been used:

"K64F": {
"target.features_add": ["BOOTLOADER"],
"target.bootloader_img": "k64f-loader.bin",
"target.app_offset": "0x8400",
"target.header_offset": "0x8000",
"target.restrict_size": "0xCFC00"
},

@adbridge
Copy link
Contributor

@fredlee12001 Please add a reasonable description in the corresponding section. Thanks

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

Looks great, nice work @fredlee12001 !

@adbridge
Copy link
Contributor

ci started

@mbed-ci
Copy link

mbed-ci commented Apr 29, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

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.

7 participants