Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | #------------------------------------------------------------------------------- |
| 3 | # Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | #------------------------------------------------------------------------------- |
| 8 | |
| 9 | # |
| 10 | # Builds a single configuration on Trusted Firmware M. |
| 11 | # Relies on environment variables pre-populated. |
| 12 | # These variables can be obtained using configs.py. |
| 13 | # Expected to have trusted-firmware-m cloned to same level as this git tree |
| 14 | # |
| 15 | |
| 16 | set -ex |
| 17 | mkdir trusted-firmware-m/build |
| 18 | cd trusted-firmware-m/build |
| 19 | cmake -G "Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../configs/$PROJ_CONFIG.cmake` -DTARGET_PLATFORM=$TARGET_PLATFORM -DCOMPILER=$COMPILER -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DBL2=$BL2 .. |
| 20 | cmake --build ./ -- -j 2 install |
| 21 | if [ "$TARGET_PLATFORM" == "MUSCA_A" ] ; then |
| 22 | export OFFSET1=0x200000 |
| 23 | export OFFSET2=0x220000 |
| 24 | elif [ "$TARGET_PLATFORM" == "MUSCA_B1" ] ; then |
| 25 | export OFFSET1=0xA000000 |
| 26 | export OFFSET2=0xA020000 |
| 27 | fi |
| 28 | if [ ! -z "$OFFSET1" ] && [ ! -z "$OFFSET2" ] ; then |
| 29 | # Cleanup offset(s)? |
| 30 | srec_cat install/outputs/$TARGET_PLATFORM/mcuboot.bin -Binary -offset $OFFSET1 install/outputs/$TARGET_PLATFORM/tfm_sign.bin -Binary -offset $OFFSET2 -o install/outputs/$TARGET_PLATFORM/tfm.hex -Intel |
| 31 | fi |