Hi Thomas,

 

I have created a patch:

 

https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/12145

 

But my IAR license server is down hence I can not verify it. Could you please help to verify? Feel free to comment or just submit a new patchset (or just patch) to fix the problems met.

 

And could please to review this file: https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/12145/2/secure_fw/include/compiler_ext_defs.h

 

Not sure if this attribute (used) work for the IAR from now on. As we wont support legacy toolchain hence if there are some legacy defs for IAR toolchain we could just skip them – I saw CMSIS checks __ICCARM_V8 also for IAR toolchain.

 

Thanks.

 

/Ken

 

From: TF-M <tf-m-bounces@lists.trustedfirmware.org> On Behalf Of Ken Liu via TF-M
Sent: Wednesday, October 27, 2021 4:57 PM
To: tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: Re: [TF-M] Inline asm syntax unified and symbol reference in IAR toolchain

 

Hi Thomas,

 

Yeah, we just noticed quite some ASM problems, creating patches…

 

/Ken

 

From: TF-M <tf-m-bounces@lists.trustedfirmware.org> On Behalf Of Thomas Törnblom via TF-M
Sent: Wednesday, October 27, 2021 4:41 PM
To: tf-m@lists.trustedfirmware.org
Subject: Re: [TF-M] Inline asm syntax unified and symbol reference in IAR toolchain

 

Hi Ken,

I see you implemented this change anyway  in psa_interface_thread.c and other places. This breaks IAR builds unfortunately:
---
...
          :: "i" (spm_interface_thread_dispatcher)
             ^
"C:\Users\thomasto\Projects\tf-m13\trusted-firmware-m\secure_fw\spm\cmsis_psa\psa_interface_thread.c",29  Error[Ta094]:
          Operand modifier a is not valid for operand
          #spm_interface_thread_dispatcher

          :: "i" (tfm_spm_client_psa_framework_version),
             ^
"C:\Users\thomasto\Projects\tf-m13\trusted-firmware-m\secure_fw\spm\cmsis_psa\psa_interface_thread.c",43  Error[Ta094]:
          Operand modifier a is not valid for operand
          #tfm_spm_client_psa_framework_version
...
---

For IAR we need to use the #pragma required method previously used.

/Thomas

Den 2021-10-19 kl. 11:11, skrev Ken Liu via TF-M:

Hi Thomas,

 

Thanks for the confirm 😉

 

Let’s see if we can refine this part from a coding perspective.

 

/Ken

 

From: TF-M <tf-m-bounces@lists.trustedfirmware.org> On Behalf Of Thomas Törnblom via TF-M
Sent: Tuesday, October 19, 2021 4:53 PM
To: tf-m@lists.trustedfirmware.org
Subject: Re: [TF-M] Inline asm syntax unified and symbol reference in IAR toolchain

 

Hi Ken,

We have an open ticket for just consuming the ".syntax unified", which is set to be fixed in a future update.

I've tested your suggestion for "#pragma required" and it doesn't seem to work.

Cheers,
Thomas

Den 2021-10-19 kl. 09:22, skrev Ken Liu via TF-M:

Hi Thomas and all,

 

I noticed there are some

 

#if !defined(__ICCARM__)

        ".syntax unified                  \n"

#endif

 

In source code, looks like �.syntax unified� is not support in IAR, is that true? If it could not be supported in a short term, we can define some wrapper such as:

 

#ifdef __ICCARM__

#define CLAIM_SYNTAX_UNIFIED �\n�

#else

#define CLAIM_SYNTAX_UNIFIED ".syntax unified                  \n"

#endif

 

 

Another question is about the:

#if defined(__ICCARM__)

#pragma required = do_schedule

#endif

 

If we claim do_schedule in the constraints, is the above �#pragma required� still needed?

 

__asm (��.  :: �i�(do_schedule));

 

We can create a patch to test this � using a constraint looks more proper.

 

Thanks.

 

/Ken

 



 

--

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.com Website: www.iar.com
Twitter:
www.twitter.com/iarsystems

 

 

--

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.com Website: www.iar.com
Twitter:
www.twitter.com/iarsystems