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

Fix MBED_RAM_START/MBED_RAM_SIZE symbol generation #10008

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Mar 8, 2019

Description

This PR tries to fix #9716 with build tool-generated MBED_RAM_START/MBED_RAM_SIZE symbols passed to C/C++ and linker files. It has the effects:

  1. Fix MBED_RAM_START/MBED_RAM_SIZE symbols are not passed to C/C++ file (see build tool-generated .profile-c/.profile-cxx) when there are target.mbed_ram_start/target.mbed_ram_size overrides.
  2. Avoid duplicate MBED_RAM_START/MBED_RAM_SIZE symbols passed to linker file (see build tool-generated .profile-ld).

Pull request type

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

Related issue or PR

#10004
#9716

@ciarmcom ciarmcom requested a review from a team March 8, 2019 12:00
@ciarmcom
Copy link
Member

ciarmcom commented Mar 8, 2019

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

@ciarmcom ciarmcom requested a review from a team March 8, 2019 12:00
@@ -872,7 +872,7 @@ def add_regions(self):
"s" if len(regions) > 1 else "",
", ".join(r.name for r in regions)
))
self._add_all_regions(regions, "MBED_RAM")
self._add_all_regions(regions, "MBED_RAM_APP")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not keen to make this change yet. While we certainly will get to a point where we have application's ram separated from physical ram, we have no configuration for that use right now. Your proposal to use mbed_ram_start and mbed_ram_size for this purpose will:

  1. Break any project that depends on those configuration settings current behavior.
  2. Be inconsistent with mbed_rom_start and mbed_rom_size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to fix duplicate MBED_RAM_START symbol in .profile-ld. Would you point out another solution to it?

@theotherjimmy
Copy link
Contributor

theotherjimmy commented Mar 8, 2019

Based on the description in #9716 I would expect this PR to rename the C flag APPLICAITON_RAM_START to MBED_RAM_START.

@ccli8
Copy link
Contributor Author

ccli8 commented Mar 9, 2019

@theotherjimmy Please correct me for my understanding:

  1. target.mbed_ram_start is for overriding physical ram from cmsis pack memory spec, just like target.mbed_rom_start is for physical rom.
  2. Currently, there's no target.mbed_ram_app_start configuration option to override application ram.
  3. MBED_RAM_START is generated from cmsis pack memory spec or target.mbed_ram_start override and means physical ram start.

Then to address #9716, how to make MBED_RAM_START symbol available both to c/c++ and linker files and avoid duplicate?

@theotherjimmy
Copy link
Contributor

@ccli8 I would do something like:

  • remove the if block from 868 - 877
  • expand the memory list in 885 to include RAM defines.

Does that help?

@ccli8
Copy link
Contributor Author

ccli8 commented Mar 11, 2019

@theotherjimmy Follow your suggestion but implement with another approach by skipping duplicate MBED_RAM_START in .profile-ld.

@theotherjimmy
Copy link
Contributor

@ccli8 Could you update the PR description to reflect the affects of this PR? Nice diff BTW. Clever.

@theotherjimmy
Copy link
Contributor

@ccli8 Reading through the related code, I think this may have the unintended side affect of never passing CMSIS defined RAM to the linker. Sorry for being blunt, I can't think of a better way of wording this right now. How have you tested this?

@ccli8
Copy link
Contributor Author

ccli8 commented Mar 12, 2019

I think this may have the unintended side affect of never passing CMSIS defined RAM to the linker

@theotherjimmy To verify it, I check build-tool generated symbols in .profile-c and .profile-ld:

  1. When there are no target.mbed_ram_start/target.mbed_ram_size overrides, MBED_RAM_START/MBED_RAM_SIZE reflect CMSIS defined RAM.
  2. When there are target.mbed_ram_start/target.mbed_ram_size overrides, MBED_RAM_START/MBED_RAM_SIZE reflect these RAM overrides.
  3. MBED_RAM_START/MBED_RAM_SIZE are always generated in both .profile-c and .profile-ld.
  4. MBED_RAM_START/MBED_RAM_SIZE are not duplicate in both .profile-c and .profile-ld.

@ccli8
Copy link
Contributor Author

ccli8 commented Mar 12, 2019

Could you update the PR description to reflect the affects of this PR?

@theotherjimmy Update done

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.

Diff looks great. Thanks!

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 16, 2019

Needs rebase

@ccli8
Copy link
Contributor Author

ccli8 commented Mar 18, 2019

@0xc0170 Rebase done

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 18, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 18, 2019

Test run: SUCCESS

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

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 20, 2019

@ccli8 Can you please rebase? Latest PR to the tools (fix) created this conflict. sorry about that, should move to CI asap and merge.

@ccli8
Copy link
Contributor Author

ccli8 commented Mar 21, 2019

@0xc0170 Rebase done

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 21, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Mar 21, 2019

Test run: FAILED

Summary: 6 of 9 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-ARMC5
  • jenkins-ci/mbed-os-ci_build-ARMC6
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR8
  • jenkins-ci/mbed-os-ci_build-IAR8

@alekla01
Copy link
Contributor

CI Restarted

@mbed-ci
Copy link

mbed-ci commented Mar 21, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 21, 2019

io serial for one device (networking tests), will restart

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 22, 2019

@ccli8 Let's wait until we finalize rc4 , to avoid rebasing/CI as we might have another config fix. Will go to CI as soon as 5.12 rc4 is completed. Sorry about it, this week landed lot of fixes to config for 5.12.0 resulting in conflicts with this PR.

@cmonr
Copy link
Contributor

cmonr commented Mar 25, 2019

Rebase when able. RC4 has since been made and merged.

1. Fix MBED_RAM_START/MBED_RAM_SIZE are not generated when there are
   target.mbed_ram_start/target.mbed_ram_size overrides
2. Fix MBED_RAM_START/MBED_RAM_SIZE are duplicated.
@ccli8
Copy link
Contributor Author

ccli8 commented Mar 26, 2019

@cmonr Rebase done.

@cmonr
Copy link
Contributor

cmonr commented Mar 26, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 26, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 4
Build artifacts

cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Mar 26, 2019
Fix MBED_RAM_START/MBED_RAM_SIZE symbol generation
@cmonr cmonr merged commit a6c9c8c into ARMmbed:master Mar 27, 2019
@ccli8 ccli8 deleted the nuvoton_fix-ram-symbol branch March 27, 2019 05:42
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.

Inconsistent symbol generation with target.mbed_ram_start override
8 participants