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

Deduplicate IAR MBED_ROM__xxxx defines #10157

Merged
merged 3 commits into from Mar 20, 2019

Conversation

Projects
None yet
8 participants
@theotherjimmy
Copy link
Contributor

commented Mar 19, 2019

Description

PR #10113 allowed a porter or application author to configure
secure or non-secure rom through the use of:

  • target.secure-rom-start
  • target.secure-rom-size
  • target.non-secure-rom-start
  • target.non-secure-rom-size

and use these in managed bootloader modes and report them as ROM.
This created a duplicate MBED_ROM_START and MBED_ROM_SIZE
define on the IAR linker command line.

Further, the overrides:

  • target.secure-ram-start
  • target.secure-ram-size
  • target.non-secure-ram-start
  • target.non-secure-ram-size

Would create further command line defines that conflicted with RAM
reporting.

This PR removes the duplicated command line arguments.

Fixes #10153

Pull request type

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

This comment has been minimized.

Copy link
Member

commented Mar 19, 2019

@mikisch81 Please can you test?

@mikisch81

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

I am OOO all day today, not near devices.
@alzix @davidsaada @orenc17 anyone with LPC55S69 device and iar8 toolchains at hand?

@@ -929,15 +929,11 @@ def add_linker_defines(self):
flags2params = {}
if self.target.is_PSA_non_secure_target:
flags2params = {
"MBED_ROM_START": "target.non-secure-rom-start",

This comment has been minimized.

Copy link
@mikisch81

mikisch81 Mar 19, 2019

Contributor

So how will these parameter be passed to the linker?

This comment has been minimized.

Copy link
@theotherjimmy

theotherjimmy Mar 19, 2019

Author Contributor

With other code that was duplicating this define. It was duplicated this is the one that's no longer needed.

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@theotherjimmy are you sure that it won't break targets without bootloader?

@theotherjimmy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 19, 2019

@orenc17 Yes. ROM is always reported as of 5.11.

@alzix

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

tested this PR on the target with @davidsaada help.
We see regression when building secure image with new changes - the board does not boot regardless to toolchain used to build nonsecure image
In addition the board does not boot when building nonsecure image with IAR and using default prebuilt secure image. GCC_ARM seems to work fine though.

@theotherjimmy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 19, 2019

@alzix Thanks. Is this regression compared to master or compared to some other point?

@davidsaada

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@alzix Thanks. Is this regression compared to master or compared to some other point?

Sorry - just double checked. It was compared to master, but behaves just the same. No harm to secure side, but no improvement to non secure side on IAR toolchain.

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@theotherjimmy i can confirm that MBED_RAM_START/SIZE also has duplications

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@theotherjimmy to be clear i'm talking about GCC_ARM

@theotherjimmy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 19, 2019

@orenc17 Good catch. I'll deduplicate the RAM as well.

@theotherjimmy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 19, 2019

It looks like the RAM duplication is possibly causing bugs as they are not the same value.

@theotherjimmy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 19, 2019

@orenc17 New commit should deduplicate RAM defines as well.

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

CI started

@orenc17

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

@theotherjimmy looks and build fine on GCC_ARM
will do a full regression check in the morning

Update: CI build log looks ok

@cmonr

cmonr approved these changes Mar 19, 2019

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 19, 2019

Test run: SUCCESS

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

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

Hold until @orenc17 does his checks: #10157 (comment)

@mikisch81

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

@ARMmbed/mbed-os-maintainers I can verify that IAR builds and runs OK with this PR changes.

Ran all the PSA related tests:

| target          | platform_name | test suite                                                   | result | elapsed_time (sec) | copy_method |
|-----------------|---------------|--------------------------------------------------------------|--------|--------------------|-------------|
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_attestation-test_a001 | OK     | 32.58              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c001      | OK     | 17.14              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c002      | OK     | 17.92              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c003      | OK     | 17.78              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c004      | OK     | 17.85              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c005      | OK     | 17.6               | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c006      | OK     | 17.81              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c007      | OK     | 17.76              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c008      | OK     | 17.72              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c009      | OK     | 17.24              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c010      | OK     | 17.4               | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c011      | OK     | 17.03              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c012      | OK     | 17.29              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c013      | OK     | 17.29              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c014      | OK     | 17.3               | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c015      | OK     | 17.13              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c016      | OK     | 17.53              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c017      | OK     | 17.42              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c018      | OK     | 17.05              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c019      | OK     | 17.05              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c020      | OK     | 17.43              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c021      | OK     | 17.04              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c022      | OK     | 17.59              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c023      | OK     | 17.27              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c024      | OK     | 17.6               | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c025      | OK     | 17.71              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c026      | OK     | 17.63              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c027      | OK     | 17.18              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c028      | OK     | 17.15              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c029      | OK     | 17.71              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c030      | OK     | 17.12              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c031      | OK     | 17.18              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c032      | OK     | 17.93              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c033      | OK     | 17.95              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c034      | OK     | 17.18              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c035      | OK     | 17.15              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c036      | OK     | 17.69              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c037      | OK     | 17.83              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c038      | OK     | 17.44              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c039      | OK     | 18.4               | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c040      | OK     | 20.07              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c041      | OK     | 19.63              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c042      | OK     | 20.0               | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_crypto-test_c043      | OK     | 21.75              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s001         | OK     | 17.44              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s002         | OK     | 17.44              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s004         | OK     | 17.01              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s005         | OK     | 16.99              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s006         | OK     | 16.93              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s007         | OK     | 17.12              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s008         | OK     | 17.08              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s009         | OK     | 17.23              | default     |
| LPC55S69_NS-IAR | LPC55S69      | components-target_psa-tests-compliance_its-test_s010         | OK     | 16.91              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-mbed-crypto-sanity                                     | OK     | 19.77              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-attestation                                        | OK     | 20.11              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-crypto_access_control                              | OK     | 20.5               | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-crypto_init                                        | OK     | 17.17              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-entropy_inject                                     | OK     | 18.18              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-its_ps                                             | OK     | 18.6               | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-spm_client                                         | OK     | 22.65              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-spm_server                                         | OK     | 20.17              | default     |
| LPC55S69_NS-IAR | LPC55S69      | tests-psa-spm_smoke                                          | OK     | 16.7               | default     |
mbedgt: test suite results: 62 OK

@0xc0170 0xc0170 merged commit da3a759 into ARMmbed:master Mar 20, 2019

28 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARMC5 Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR8 Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARMC5 Success
Details
jenkins-ci/mbed2-build-ARMC6 Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR8 Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 10409 cycles (+572 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B (+0.00%)
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.