Hi Thomas,

 

The diff below is caused by this patch https://review.trustedfirmware.org/c/trusted-firmware-m/+/3942 .

 

REGION_NAME is used to pasting the input parameters into a string. So there should be no difference between Image$$ARM_LIB_STACK_MSP$$ZI$$Base and REGION_NAME(Image$$, ARM_LIB_STACK_MSP,  $$ZI$$Base) basing on the current implementation of REGION_NAME in file platform/include/region.h

 

So, is there a specific REGION_NAME macro implementation for IAR compiler? Or the automatically generated region related symbols are with different names in IAR compiler?

 

Regards,

Sherry Zhang

 

From: TF-M <tf-m-bounces@lists.trustedfirmware.org> On Behalf Of Thomas Törnblom via TF-M
Sent: Tuesday, April 28, 2020 4:58 PM
To: tf-m@lists.trustedfirmware.org
Subject: Re: [TF-M] REGION_DECLARE macros

 

I have no idea what causes the crap characters in the diff below, they should be blanks. Looks like a problem with the mailing list software.

Trying another type:

     /* Set Main Stack Pointer limit */
-    extern uint32_t Image$$ARM_LIB_STACK_MSP$$ZI$$Base;
-    __set_MSPLIM((uint32_t)&Image$$ARM_LIB_STACK_MSP$$ZI$$Base);
+    REGION_DECLARE(Image$$, ARM_LIB_STACK_MSP,  $$ZI$$Base);
+    __set_MSPLIM((uint32_t)&REGION_NAME(Image$$, ARM_LIB_STACK_MSP,
+                                        $$ZI$$Base));

 

Den 2020-04-28 kl. 10:51, skrev Thomas T�rnblom via TF-M:

With the integration of the IAR toolchain support in TF-M it has become important to use the REGION_DECLARE/REGION_NAME macros in platform/region.h instead of using symbols like "Image$$ARM_LIB_STACK_MSP$$ZI$$Base".

The IAR linker can not use these symbols and the macros in combination with the IAR specific cmake rules creates appropriate symbols for all the supported toolchains.

Example diff:
---
���� /* Set Main Stack Pointer limit */
-��� extern uint32_t Image$$ARM_LIB_STACK_MSP$$ZI$$Base;
-��� __set_MSPLIM((uint32_t)&Image$$ARM_LIB_STACK_MSP$$ZI$$Base);
+��� REGION_DECLARE(Image$$, ARM_LIB_STACK_MSP,� $$ZI$$Base);
+��� __set_MSPLIM((uint32_t)&REGION_NAME(Image$$, ARM_LIB_STACK_MSP,
+��������������������������������������� $$ZI$$Base));

---

Thomas

--

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