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 Changehttps://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/12620
To view, visit change 12620https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/12620. To unsubscribe, or for help writing mail filters, visit settingshttps://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.commailto:sherry.zhang2@arm.com Gerrit-Reviewer: Anton Komlev Anton.Komlev@arm.commailto:Anton.Komlev@arm.com Gerrit-Reviewer: David Hu david.hu@arm.commailto:david.hu@arm.com Gerrit-Reviewer: Ken Liu ken.liu@arm.commailto:ken.liu@arm.com Gerrit-Reviewer: Sebastian Bøe Sebastian.boe@nordicsemi.nomailto:Sebastian.boe@nordicsemi.no Gerrit-Reviewer: Thomas Törnblom thomas.tornblom@iar.commailto:thomas.tornblom@iar.com Gerrit-Reviewer: TrustedFirmware Code Review Gerrit-Reviewer: sherryzhang sherry.zhang2@arm.commailto:sherry.zhang2@arm.com Gerrit-CC: Andrej Butok andrey.butok@nxp.commailto:andrey.butok@nxp.com Gerrit-CC: Chris Brand chris.brand@cypress.commailto:chris.brand@cypress.com Gerrit-CC: Gabor Abonyi gabor.abonyi@arm.commailto:gabor.abonyi@arm.com Gerrit-CC: Kevin Peng kevin.peng@arm.commailto:kevin.peng@arm.com Gerrit-CC: Michel Jaouen Gerrit-CC: Márk Horváth mark.horvath@arm.commailto:mark.horvath@arm.com Gerrit-CC: Satish Kumar satish.kumar01@arm.commailto:satish.kumar01@arm.com Gerrit-CC: jamie.mccrae@lairdconnect.commailto:jamie.mccrae@lairdconnect.com Gerrit-Attention: Kevin Peng kevin.peng@arm.commailto:kevin.peng@arm.com Gerrit-Attention: Ken Liu ken.liu@arm.commailto:ken.liu@arm.com Gerrit-Attention: David Hu david.hu@arm.commailto:david.hu@arm.com Gerrit-Attention: Chris Brand chris.brand@cypress.commailto:chris.brand@cypress.com Gerrit-Attention: Anton Komlev Anton.Komlev@arm.commailto:Anton.Komlev@arm.com Gerrit-Attention: Thomas Törnblom thomas.tornblom@iar.commailto: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.commailto:thomas.tornblom@iar.com Website: www.iar.comhttp://www.iar.com Twitter: www.twitter.com/iarsystemshttp://www.twitter.com/iarsystems