Closed screamerbg closed 5 years ago
Interesting.
Looking at this problem, it looks like it stretches back all the way back to 5.10.
Doing the following results in the same error:
cd mbed-os
git checkout mbed-os-5.10
cd ..
<test cmd>
Running the command any sooner than 5.10 doesn't work because the BOOTLOADER feature wasn't introduced until them.
If you look at ARM/IAR/GCC_ARM toolchains, the assemble()
routine calls self.get_symbols(True)
, which filters out only the target and generic macros (for_asm=True):
If you look at the latter file, many macros are filtered out for when doing assemble, yet for whatever reason, the app level config macros are being passed to IAR iasmarm.
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-235
Passing of any macros to IAR was originally missing: https://github.com/ARMmbed/mbed-os/issues/6670 Macro passing was added here: https://github.com/ARMmbed/mbed-os/pull/6752
That was required to solve various problems, but it seems that didn't filter the same as the other toolchains?
Last problem I saw in this area was incorrect escaping of string literals (like the error URL) causing failure. Found here: https://github.com/ARMmbed/mbed-os/pull/8023, fix/workaround commit added to that PR: https://github.com/ARMmbed/mbed-os/commit/62a55a642308d37151ebee5448a2096f5d3c7c7b (filter all string literal macros to IAR)
If you know the other 2 toolchains are filtering stuff, then applying same filtering to IAR makes sense. If it makes the problem go away, good, but would still be nice to know what the actual tool complaint is. Is there an incorrect escaping, or are we triggering a variant of the IAR 7.80 bug?
(I don't see any reason in principle why you shouldn't be able to pass mbed conf options to the assembler, but clearly it's causing practical issues).
@theotherjimmy please take a look at this
I believe I've found the issue causing the IAR assembler to error. A macro was being repeated in the .xcl file, specifically "-DPAL_DTLS_PEER_MIN_TIMEOUT=5000"
. It doesn't look like the IAR assembler likes repeated macros.
This macro appears twice in this case because it is set as a macro
in the mbed_app.json
of the pelion-enablement repository as well as an actual parameter set by the simple-mbed-cloud-client
library.
For consistency reasons, I'd recommend removing the macro
definition from the pelion-enablement mbed_app.json
file and leave the macro to be set by the parameter. That being said, the config system should probably be able to handle this case gracefully, so I've added a fix in #8982.
Description
While trying to compile Pelion DM tests (and also example programs) for IAR, compilation fails with the following message:
Upon further investigation, running the IAR's iasmarm command
"D:\Tools\IAR\IAR 7.8\arm\bin\iasmarm" --cpu Cortex-M4F -DTRANSACTION_QUEUE_SIZE_SPI=2 -D__CORTEX_M4 -DARM_MATH_CM4 -D__FPU_PRESENT=1 -DUSBHOST_OTHER -D__MBED_CMSIS_RTOS_CM -D__CMSIS_RTOS -DTWO_RAM_REGIONS -f .\BUILD\tests\DISCO_L475VG_IOT01A\IAR\asm_macros_d292d317e7777fda6310dff5bcba2c50.xcl -o BUILD\tests\DISCO_L475VG_IOT01A\IAR\mbed-os\cmsis\TARGET_CORTEX_M\TOOLCHAIN_IAR\cmain.o .\mbed-os\cmsis\TARGET_CORTEX_M\TOOLCHAIN_IAR\cmain.S
returns:I'm attaching the
asm_macros_d292d317e7777fda6310dff5bcba2c50.xcl
for convenience - asm_macros_d292d317e7777fda6310dff5bcba2c50.zipUpon even further investigation, removing the aforementioned file from the iasmarm command allows the file to be compiled successfully, e.g.
Continuing to try to compile the tests and manually removing the .xcl file from the compile helps me to finally compile + link the tests, and then successfully pass greentea run:
This makes me think that there's something fundamentally broken in the IAR support in Mbed OS 5.10.4 / master, where the toolchain assembling receives application level macros/config (some of which look invalid for IAR), while it's expected that assembling should only receive the target level config variables.
Note that this impacts all Pelion examples and fails with both mbed-os-5.10.4 and mbed-os master branch.
CC @theotherjimmy @cmonr @bridadan
How to reproduce:
mbed import pelion-enablement
mbed test -t IAR -m DISCO_L475VG_IOT01A -n simple-mbed-cloud-client-tests*dev* -v
@ashok-rao Please label this in JIRA. FYI @MarceloSalazar regarding Mbed OS 5.11 OOB.
Issue request type