-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Introduce an Mbed config to enable XIP #11006
Conversation
@linlingao, thank you for your changes. |
tools/toolchains/mbed_toolchain.py
Outdated
@@ -957,6 +957,12 @@ def add_linker_defines(self): | |||
self.ld.append(define_string) | |||
self.flags["ld"].append(define_string) | |||
|
|||
if "XIP_ENABLE" in self.target.macros : |
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.
Please comment on what XIP is, and why this special case needs to 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.
XIP stands for Execute In Place. Since the text/RO data gets too big to fit on on chip flash, we need to move some code to the QSPI to execute for bigger applications such as Pelion cloud client. This feature is designed to be enabled in mbed_app.json because each application usually has its own JSON. By default it's disabled, because if the text/RO data can fit on the internal flash, there's no need to enable this feature.
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 PR is enormous - 764 changed files!
I can only look at the tools changes; these look to be minor, but contribute to an increasing pool of special cases, each of which make maintaining the tools code more and more difficult.
I would like to see some comments to indicate what this changed code is actually doing and why.
+1, would be good to indicate which commits are actually for review here (range of them if multiple). Otherwise most of us just wait until the rebase is done once PR dependency is in |
This is the commit: b075f76 for review. What does this bring? Are there any implications one enabled? |
Yes, only b075f76 needs to be reviewed. It's fine to wait till the rebase. |
Can you introduce XIP - answer my questions above. |
Hope this helps: |
@linlingao , #10692 is now merged, would you please rebase? |
@ARMmbed/team-cypress - please review after this is rebased |
Rebased. Reviewers, please review. |
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.
Could you please connect it to Mbed config system, similarly to MBED_CONF_TARGET_LSE_AVAILABLE
which can be found in target.json as lse_available
in config section.
@bulislaw I looked at how lse_available is used in targets.json. lse_available only applies to FAMILY_STM32. The default is "1", but on some targets, it's overridden to 0. That is, lse_available is the same setting on a certain target for all applications. I'm not seeing close resemblance between lse_available and XIP_ENABLE. There're two differentiating points with respect to the intended usage of XIP_ENABLE: (1) XIP_ENABLE can be used for ALL targets. For example, on the Nordic boards with XIP, if someone wants to enable XIP, he/she doesn't need to introduce another variable. |
Even more reasons to have it as system config rather than a 'random' flag. |
I had to wait for other PRs to go in first. It's fine to push this out to a minor release. |
…P_ENABLE in mbed_app.json. It's disabled by default.
XIP feature has already been added by Cypress in other PRs. Reduce the scope of this PR to just add the Mbed config. |
To understand the scope now - this provides a config option to enable/disable it. There're Cypress targets already providing all needed, and other targets can follow. This PR should be ready then ? |
@0xc0170 Yes |
@morser499 Please review the change in mbed_override.c |
Looks good to me |
CI started |
Test run: FAILEDSummary: 2 of 4 test jobs failed Failed test jobs:
|
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Introduce an Mbed config to enable XIP (Execute In Place) capability on some boards. XIP can be enabled by adding "target.xip-enable": true in mbed_app.json. It's disabled by default.
Pull request type
Reviewers
Release Notes
Introduce xip-enable config to allow text/RO data to be loaded to QSPI flash where XIP (execute-in-place) is supported. This will allow programs with larger text/RO data section to run on a system with smaller on-chip flash.
This feature is disabled by default on all targets.
XIP can be enabled by adding target.xip-enable: true in mbed_app.json, then locate desired text/RO data sections to QSPI flash region in the linker script. In the boot sequence, QSPI flash needs to be configured to XIP mode.