Thanks Kevin, that was indeed the issue.
I've been puzzled by these _ATTR_ sections in the armclang and gnuarm link scripts and adding them to our scripts seems to fix the issue.
Cheers, Thomas
Den 2021-12-20 kl. 03:58, skrev Kevin Peng:
Hi Thomas,
Looks like an MPU setting issue.
But have no idea why single step running could pass.
I do noticed something is missing in the IAR linker script for L3 if you check the one for armclang:
https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ex...
The IAR one is missing the /*_////ATTR_*/ part.
Those allow /TFM_LINK_SET_XX_IN_PARTITION_SECTION/ to tell the linker to put symbols in particular sections.
I think that’s the root cause.
Best Regards,
Kevin
*From:* TF-M tf-m-bounces@lists.trustedfirmware.org *On Behalf Of *Thomas Törnblom via TF-M *Sent:* Saturday, December 18, 2021 12:15 AM *To:* tf-m@lists.trustedfirmware.org *Subject:* Re: [TF-M] Change in ...trusted-firmware-m[master]: Platform: Refine image flash layout
I'm working on the IAR part of this and I'm having a problem with the following test in isolation level 3:
Running Test Suite TFM IRQ Test (TFM_IRQ_TEST_1xxx)...
Executing 'TFM_NS_IRQ_TEST_SLIH_1001'
Description: 'SLIH HANDLING Case 1'
If I run the test at full speed, it will run into a MemManage fault while if I single step through the entire test it will pass.
Is there a race condition somewhere in there?
If I disable the SLIH tests it succeeds.
The exception happens when dereferencing "dev" in this function:
bool timer_cmsdk_is_initialized(const struct timer_cmsdk_dev_t* dev) { return dev->data->is_initialized; }
dev is 0x30002440 at the time.
I've been trying to figure out what part of the memory protection system it is that is causing the exception. DACCVIOL is set and MMFAR shows the faulting address.
Ideas?
The build line: cmake -GNinja -S .. -B . -DTFM_PLATFORM=arm/musca_b1/sse_200 "-DTFM_TOOLCHAIN_FILE=..\toolchain_IARARM.cmake" -DTEST_NS=ON -DTEST_S=ON -DCMAKE_BUILD_TYPE=Debug -DBL2=ON -DTFM_ISOLATION_LEVEL=3 -DTEST_NS_SLIH_IRQ=ON -DTEST_NS_QCBOR=OFF
Notice that this build runs into a linker bug in the IAR toolchain and I have a non-released fixed version I'm using, in case anyone is attempting to replicate the issue.
Cheers, Thomas
Den 2021-12-17 kl. 11:30, skrev TrustedFirmware Code Review (Code Review):
Attention is currently required from: Kevin Peng, Ken Liu, David Hu, Chris Brand, Anton Komlev, Thomas Törnblom. "Build Successful http://ci.trustedfirmware.org/job/tf-m-static/3226/display/redirect : SUCCESS" Patch set 16:Verified +1 View Change <https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/12620> To view, visit change 12620 <https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/12620>. To unsubscribe, or for help writing mail filters, visit settings <https://review.trustedfirmware.org/settings>. Gerrit-Project: TF-M/trusted-firmware-m Gerrit-Branch: master Gerrit-Change-Id: I0084aef576d90af45513c7eaae58ba6c6dbbddab Gerrit-Change-Number: 12620 Gerrit-PatchSet: 16 Gerrit-Owner: sherryzhang <sherry.zhang2@arm.com> <mailto:sherry.zhang2@arm.com> Gerrit-Reviewer: Anton Komlev <Anton.Komlev@arm.com> <mailto:Anton.Komlev@arm.com> Gerrit-Reviewer: David Hu <david.hu@arm.com> <mailto:david.hu@arm.com> Gerrit-Reviewer: Ken Liu <ken.liu@arm.com> <mailto:ken.liu@arm.com> Gerrit-Reviewer: Sebastian Bøe <Sebastian.boe@nordicsemi.no> <mailto:Sebastian.boe@nordicsemi.no> Gerrit-Reviewer: Thomas Törnblom <thomas.tornblom@iar.com> <mailto:thomas.tornblom@iar.com> Gerrit-Reviewer: TrustedFirmware Code Review Gerrit-Reviewer: sherryzhang <sherry.zhang2@arm.com> <mailto:sherry.zhang2@arm.com> Gerrit-CC: Andrej Butok <andrey.butok@nxp.com> <mailto:andrey.butok@nxp.com> Gerrit-CC: Chris Brand <chris.brand@cypress.com> <mailto:chris.brand@cypress.com> Gerrit-CC: Gabor Abonyi <gabor.abonyi@arm.com> <mailto:gabor.abonyi@arm.com> Gerrit-CC: Kevin Peng <kevin.peng@arm.com> <mailto:kevin.peng@arm.com> Gerrit-CC: Michel Jaouen Gerrit-CC: Márk Horváth <mark.horvath@arm.com> <mailto:mark.horvath@arm.com> Gerrit-CC: Satish Kumar <satish.kumar01@arm.com> <mailto:satish.kumar01@arm.com> Gerrit-CC: jamie.mccrae@lairdconnect.com Gerrit-Attention: Kevin Peng <kevin.peng@arm.com> <mailto:kevin.peng@arm.com> Gerrit-Attention: Ken Liu <ken.liu@arm.com> <mailto:ken.liu@arm.com> Gerrit-Attention: David Hu <david.hu@arm.com> <mailto:david.hu@arm.com> Gerrit-Attention: Chris Brand <chris.brand@cypress.com> <mailto:chris.brand@cypress.com> Gerrit-Attention: Anton Komlev <Anton.Komlev@arm.com> <mailto:Anton.Komlev@arm.com> Gerrit-Attention: Thomas Törnblom <thomas.tornblom@iar.com> <mailto:thomas.tornblom@iar.com> Gerrit-Comment-Date: Fri, 17 Dec 2021 10:30:20 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
--
*Thomas Törnblom*, /Product Engineer/ IAR Systems AB Box 23051, Strandbodgatan 1 SE-750 23 Uppsala, SWEDEN Mobile: +46 76 180 17 80 Fax: +46 18 16 78 01 E-mail: thomas.tornblom@iar.comWebsite: www.iar.com http://www.iar.com Twitter: www.twitter.com/iarsystems http://www.twitter.com/iarsystems