Mbed-os: LPC55S69 IAR build has conflicting RAM/ROM defines

Created on 19 Mar 2019  路  24Comments  路  Source: ARMmbed/mbed-os

Description

Commit cde7d0be589875fcecfc1886aa19979e8974721c added an entry for LPC55S69JBD100 in tools/arm_pack_manager/index.json.

Now when building with the IAR toolchain, for example mbed test -t IAR -m LPC55S69_NS -n mbed-os-tests-psa-spm_smoke --compile, MBED_ROM_START/MBED_RAM_START and MBED_ROM_SIZE/MBED_RAM_SIZE are defined twice with conflicting values.

Content of ./BUILD/tests/LPC55S69_NS/IAR/./mbed-os/TESTS/psa/spm_smoke/.link_options.txt:

--skip_dynamic_initialization --threaded_lib --config_def DOMAIN_NS=0x1
--config_def MBED_ROM_START=0x0 --config_def MBED_ROM_SIZE=0x98000 
--config_def MBED_RAM_START=0x20000000 --config_def MBED_RAM_SIZE=0x44000 
--config_def MBED_RAM_START=0x20022000 --config_def MBED_ROM_SIZE=0x68000 --config_def MBED_RAM_SIZE=0x22000 --config_def MBED_ROM_START=0x00030000
...

So for example MBED_ROM_START is defined both to 0x0 and 0x00030000 which messes the memory map and in v8m targets with security attribution units this results in Secure-faults at run-time.

Issue request type


[ ] Question
[ ] Enhancement
[X] Bug

@alzix @orenc17 @theotherjimmy @bridadan @mmahadevan108 @ARMmbed/mbed-os-maintainers

CLOSED mirrored bug

All 24 comments

This PR added the files #10068. It's marked as 5.12rc3. This is a regression in rc3 candidate.

@mikisch81 Looking at the index.json changes, cant figure out where these double values come from. We might need help from above referenced people.

PR 10068 was included to rc3 candidate. Would it be reasonable to postpone this PR to rc4 ? how urgent was to have exporters support for this LPC target ?
How can we fix it now?

@0xc0170 of course we need help from @ARMmbed/mbed-os-tools, I already sent an e-mail regarding this issue yesterday.

Regarding postponing this PR tp rc4, I think bootloader for LPC uses the index.json as well, @davidsaada can elaborate on this.

The main problem is that we do not have the CI for this target ready yet and this target is in master for quite some time.

Correct, bootloader also affected. I'll try to look at index.json values and see if I can find out where double values come from.

@mikisch81 I've just issued your build command on the latest mbed-os master without any issues. Are you up to date?
In addition, values in index.json file aren't used any more for building bootloader, this was introduce by @ARMmbed/mbed-os-tools in #10113 (which was merged in).

@davidsaada you were able to run the tests? Can you share the non-secure map file?

I was able to reproduce this, on latest master (sha 54602f55ba).

--skip_dynamic_initialization --threaded_lib --config_def DOMAIN_NS=0x1 --config_def MBED_ROM_START=0x30000 --config_def MBED_ROM_SIZE=0x68000 --config_def MBED_RAM_START=0x20000000 --config_def MBED_RAM_SIZE=0x44000 --config_def MBED_BOOT_STACK_SIZE=1024 --config_def MBED_RAM_START=0x20022000 --config_def MBED_ROM_SIZE=0x68000 --config_def MBED_RAM_SIZE=0x22000 --config_def MBED_ROM_START=0x00030000 

@0xc0170 of course, it was never a build issue, but run-time, a secure-fault is triggered.

@mikisch81 Sorry - right now can't run anything on my board (even other tests).
Was going to post map file till I saw your comment about this not being a build issue but a runtime issue.

I know where these come from but dont know which values are valid.

Target overrides in target.json file

        "overrides": {
            "non-secure-rom-start": "0x00030000",
            "non-secure-rom-size": "0x68000",
            "non-secure-ram-start": "0x20022000",
            "non-secure-ram-size": "0x22000",
            "secure-rom-start": "0x10000000",
            "secure-rom-size": "0x28000",
            "secure-ram-start": "0x30000000",
            "secure-ram-size": "0x22000"
        },

And in index.json (looking at RAM start/size here only, how they differ):

            "SRAM": {
                "access": {
                    "execute": false,
                    "non_secure": false,
                    "non_secure_callable": false,
                    "peripheral": false,
                    "read": true,
                    "secure": false,
                    "write": true
                },
                "default": true,
                "size": 278528,
                "start": 536870912,

This two conflicts. SRAM is set to start at 536870912 in index.json file but in "non-secure-ram-start": "0x20022000" (different values). Which one is valid and why both are taken into the account?

Again this happens ONLY in IAR toolchain, ARM and GCC_ARM work fine.

@yossi2le

Sorry, but I have nothing to contribute here.
I get the same numbers as @0xc0170 got.
I think this may be a tool issue.

@mikisch81 @yossi2le Talk about index.json being correct or not is a red herring. It's about how it's used.

The fact that it only happens on IAR is very strange...

The fact that it only happens on IAR is very strange...

Maybe totally off topic, but @offirko has been working on a very strange bug seen on TDBStore with SPIF on the DISCO_F746NG board, also seen on IAR8 only (not even with IAR7).

@davidsaada That sounds like it's not something tools related (as it would probably be present on both IAR7 and IAR8 if it were)

@mikisch81 I can only reproduce the duplication of MBED_ROM_{START|SIZE} I cannot reproduce the different values.

Ah, that's because https://github.com/ARMmbed/mbed-os/pull/10113 fixed the difference.

@theotherjimmy so how does the map file look at your end?

In the mail I sent yesterday I attached the 2 map files (before and after the suspected commit) and the addresses in the "bad" map file we're all strange

@mikisch81 I have just worked on the command line invocation for this issue, as that's what it describes.

That being said, I think you should give my PR a shot, as it might fix the issue.

That being said, I think you should give my PR a shot, as it might fix the issue.

I verified that it does 馃槃

Was this page helpful?
0 / 5 - 0 ratings