Hello,

 

This question is relative to linker script with Compiler armclang 'V6.14' (For the other toolchain IAR , GNUARM ,it works )

 

I need to place code  aligned  to flash PAGE SIZE (0x2000 or 8192) to be able to set hardware protection.

 

 

As follow , here is the description of the issue.

 

With a Linker file having the following value  for Code placement

LR_CODE 0x0c024400 0x20000 {

 

     ER_TFM_CODE 0x0c024400 {

        *.o (RESET +First)

        * (+RO)

 

     }

     TFM_UNPRIV_CODE  +0 ALIGN 0x2000 {

        stm32u5xx_hal*.o (+RO)

        tick.o (+RO)

        *(SFN)

        *armlib*

    }

   

}

 

We get the following error :

 

Build started: Project: Project_s

*** Using Compiler 'V6.14', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'

Build Project 'Project_s' - Target xxxxxxxxxxx _TFM_Appli_S'

linking...

xxxxxxxxxxx_S\Exe\Project.axf: Error: L6244E: Load region LR_CODE address (0x0c024400) not aligned on a 8192 byte boundary.

Not enough information to list image symbols.

Finished: 1 information, 0 warning and 1 error messages.

" xxxxxxxxxxx _S\Exe\Project.axf" - 1 Error(s), 0 Warning(s).

Target not created.

Build Time Elapsed:  00:00:03

 

 

If we change  the linker file as follow :

LR_CODE 0x0c024400 0x20000 {

 

     ER_TFM_CODE 0x0c024400 {

        *.o (RESET +First)

        * (+RO)

 

     }

     TFM_UNPRIV_CODE  +0 ALIGN 0x400 {

        stm32u5xx_hal*.o (+RO)

        tick.o (+RO)

        *(SFN)

        *armlib*

    }

   

}

No Error is reported.

 

Is this an known issue with ARMCLANG ?

 

Best Regards

 

.