Hi all,

 

Duplication message again in hope to find solution.

 

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com

 

 

From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.org>
Sent: 26 May 2023 19:26
To: tf-m@lists.trustedfirmware.org
Cc: Mazurak Roman (CSUKR CSS ICW SW FW 3) <Roman.Mazurak@infineon.com>; Kytsun Hennadiy (CSUKR CSS ICW SW FW 3) <Hennadiy.Kytsun@infineon.com>; Brand Chris (CSCA CSS ICW SW PSW 1) <Chris.Brand@infineon.com>
Subject: [TF-M] Using bitwise or (|) / and (&) in Clang scatter file

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.

 

Hi

 

For our platform we use some ,across which should set/clear bit 28 of an address (see code below). We do this for convenience reasons.

#define IFX_S_ADDRESS_ALIAS(x)              ((x) | 0x10000000)

#define IFX_NS_ADDRESS_ALIAS(x)             ((x) & ~0x10000000)

 

 

Those macros are used in declaration of S_CODE_START macro. When expended in linker script (tfm_isolation_l3.o),  the declaration of LR_CODE section looks as follows:

 

LR_CODE (0x24000000 | 0x10000000) (0x4B000) {

 

This code results in following error:

                               

                                tfm_isolation_l3.o", line 46 (column 21): Error: L6292E: Ignoring unknown attribute '|' specified for region LR_CODE.

 

I tried experimenting with this and found out that when | is changed to or (see following code) then linker works fine:

 

LR_CODE (0x24000000 or 0x10000000) (0x4B000) {

 

Same problem is present when using bitwise and (&). But when using bitwise NOT (~0x…) everything works fine.

 

Having to define our macros in different way brings some problems for our platform, so maybe someone knows how to solve this problem? Maybe there are compilation  flags or something like that? Ideally we want | and & to work fine in linker script.

 

Thanks!

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com