-
Notifications
You must be signed in to change notification settings - Fork 178
Added documentation for using ARM Compiler 5 with 5.12 release #999
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
Changes from 1 commit
3aaac11
98edb64
dadc7db
33ea6b3
58b852d
1a8c222
aad083e
b706d08
f5ecf4f
39acf7b
abe394a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,39 @@ For more information, please see the [Online Compiler page](developing-mbed-onli | |
|
||
You can export your project from any of our tools to third party tools. For instructions, as well as tool-specific information, see [the Exporting to third party toolchains page](exporting.html). | ||
|
||
#### Forcing compilation with ARM Compiler 5 for targets already supporting ARM Compiler 6 | ||
|
||
It's possible that some developers may need to update to Mbed 5.12 release but still requires compiling with ARM Compiler 5 until they are in possession of ARM Compiler 6. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add a list of currently known targets that cannot be used with ARMC6 yet (IIRC.. PSoC6, KW24D, any others) ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ashok-rao - I think we should not capture that list explicitly here as we plan to move the rest of the targets to ARMC6 soon, updating the list as each target gets moved into ARMC6 might be error-prone or we may miss it and docs also need re-publishing. Instead, the mbed_targets.md captures the fact that if the supported_toolchains contains ARMC5 the target uses ARMC5. In addition you can also list the toolchain support for targets using the command "mbed config -S" which is already documented. |
||
In those cases, you may still be able to use ARM Compiler 5 depending on the target. If your target uses any ARM Compiler 6 specific binaries or code, then it may not | ||
be able to compile with ARM Compiler 5 or you may see undefined behaviors. In other cases, if you want to try force ARM Compiler 5 you can do so with the following options: | ||
|
||
##### By creating a mbed_app.json to override `supported_toolchains` | ||
|
||
In this method, you can create or update your `mbed_app.json` with the following content. Note that you can still keep other entries such as `GCC_ARM` or `IAR` while overriding `supported_toolchains` as below. | ||
SenRamakri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
{ | ||
"target_overrides": { | ||
"*": { | ||
"target.supported_toolchains": ["ARMC5", "GCC_ARM", "IAR"] | ||
SenRamakri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved the porting content out in another PR: #1013 |
||
|
||
##### By local modifications to `targets.json` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't recommend that applications modify Mbed OS elsewhere in the documentation. Perhaps this needs to be in a porting targets section instead. |
||
|
||
In this method, you have to modify the `supported_toolchains` entry for your target in targets.json to remove all `ARM`, `ARMC6` entries and replace it with `ARMC5`. Note that you can still keep other entries such as `GCC_ARM` or `IAR`. | ||
|
||
See below for example: | ||
``` | ||
"MY_TARGET_NAME": { | ||
"supported_form_factors": [...], | ||
"core": "Cortex-M4", | ||
"supported_toolchains": ["ARMC5", "GCC_ARM", "IAR"], | ||
... | ||
} | ||
``` | ||
|
||
<span class="note"> **Note:** The above methods to override ARM toolchain version is made available only to enable developers migrating from ARM Compiler 5 to ARM Compiler 6. Future releases of Mbed OS may remove | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be rephrased to reflect the Product Management direction, e.g. "We encourage you to plan to make use of ARM Compiler 6 soon. We do plan to deprecate ARM Compiler 5 support in the future and this migration would ensure that your software is compatible with it." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with softening of tone, but still pressing the message. |
||
this option and thus developers are strongly encouraged to move to ARM Compiler 6.</span> |
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.
Can we make this a note and shorten it?
Maybe something like:
Note: We encourage you to switch to Arm Compiler 6 soon because we will deprecate Arm Compiler 5 support in the future. However, if you need to update to Mbed OS 5.12 but still require compiling with Arm Compiler 5 until you are in possession of Arm Compiler 6, we provide methods to override the Arm toolchain version. If you do this, your target may not be able to compile with Arm Compiler 5, or you may see undefined behaviors.
To force Arm Compiler 5, you can use the following options:
mbed_app.json
with:supported_toolchains
entry in targets.json to replace allARM
,ARMC6
entries withARMC5
: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.
See my comment below about
targets.json
modifications. I think that bit may need to move to target porting.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.
@ChiefBureaucraticOfficer @screamerbg - Please review if the shortened note of the content provided by @AnotherButler above works.
@theotherjimmy - I don't think this belongs in porting section just because we refer targets.json. Also it makes hard to find if its in porting section as this would be the page most people would land on to find compiler info.
Uh oh!
There was an error while loading. Please reload this page.
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.
Should a modification above to mbed_app.json be enough? Just testing mbed-os-example-blinky with that on mbed OS master (b80c961da) and it still fails to build on ARMC5.
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.
@TeroJaasko - Yes, please follow the changes as mentioned here to enable ARMC5 and try. By the way "-t ARMC5" is an invalid option. After adding ARMC5 to supported_toolchains you should still do "-t ARM". Please let me know if you need help with making the changes.
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.
I already copied the
"target.supported_toolchains": ["ARMC5", "GCC_ARM", "IAR"]
to mbed_app.json and the results are no better with "-t ARM".Diff on mbed-os-example-blinky:
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.
@TeroJaasko - Although we tested this in past, I tried the same thing again with the exact version you are using(b80c961da) and it appears to be working fine on my machine, and yes, the compilation works with ARMC5. And yet, I don't see anything wrong with what you are trying to do.
Uh oh!
There was an error while loading. Please reload this page.
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.
I also tried the same on Ubuntu and that worked fine as well. So I wonder whats causing your failure :-(. One thing you can make sure is that you are in mbeb-os-example-blinky dir and not in mbed-os when doing mbed compile.
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.
Have you tried removing ARMC6 from paths? I don't have ARMC6 at my paths by default, there are at least one ticket open where wrong compiler is used: ARMmbed/mbed-os#10069
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.
Ah ok, that makes sense if you dont have ARMC6 configured. I believe the tools would check for ARMC6 as in this PR ARMmbed/mbed-os#10044 , have you tried adding ARMC6 and see if that fixes the problem?