Use CMSIS startup file and add example linker scripts
The CMSIS_5 repository provides a reference startup file and for each
Cortex-M core. We add a library `cmsis-startup-cortex-m` which pulls in
a startup file from CMSIS_5 based on `CMAKE_SYSTEM_PROCESSOR`. Currently
only Cortex-M55 has been added as we have only one platform at the time
of writing.
While a startup file is generic to the Cortex core, a linker script is
specific to the memory layout of the hardware and the application. We
add to each non-TF-M example `an552_armclang.sct` for ARMClang and
`an552_gcc.ld` for GCC. Both files are based on the ones from
`Device/ARM/ARMCM55/Source` inside CMSIS_5 (git tag: 5.8.0) with memory
layout edited to match AN552. Having linker scripts inside each example
reflects what an actual user project would do. Note that the TF-M
examples need linker scripts from the trusted-firmware-m repository and
will be handled by a subsequent commit.
By pointing each executable's `LINK_DEPENDS` property to its linker
script, we instruct CMake to redo linking upon modification of the
linker script.
Signed-off-by:
Lingkai Dong <lingkai.dong@arm.com>
Loading
Please register or sign in to comment