TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 1 | ################################################### |
| 2 | Additional build instructions for the IAR toolchain |
| 3 | ################################################### |
| 4 | |
| 5 | Follow the instructions in |
| 6 | :doc:`software requirements <tfm_build_instruction>`, but replace the -DCOMPILER= setting with IARARM. |
| 7 | |
| 8 | |
| 9 | Notes for building with IARARM |
| 10 | ------------------------------ |
| 11 | |
TTornblom | befd3ca | 2020-04-30 11:09:08 +0200 | [diff] [blame] | 12 | IAR Embedded Workbench for ARM (EWARM) versions 8.42 or later are required. |
| 13 | |
TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 14 | Currently the MUSCA_B1, MUSCA_S1 and SSE-200_AWS targets are not supported with IARARM, |
Mark Horvath | 9a5a9b9 | 2019-11-29 15:57:55 +0100 | [diff] [blame] | 15 | due to lack of testing. The FVP_SSE300_MPS2 target is currently not supported by IARARM. |
TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 16 | |
| 17 | bash needs to be installed and used by cmake for the build steps. |
| 18 | |
| 19 | cmake needs to be version 3.14 or newer. |
| 20 | |
| 21 | The V8M IAR CMSIS_5 RTX libraries in CMSIS_5 5.5.0 has a problem and has been updated in |
Kevin Peng | 6710c82 | 2020-05-21 16:52:14 +0800 | [diff] [blame^] | 22 | CMSIS_5 5.7.0. The updated libraries are part of the tf-m-tests repo and no special instructions |
| 23 | are needed when the libraries from this repo are used. |
TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 24 | |
| 25 | For all configurations and build options some of the QCBOR tests fail due to the tests not handling |
| 26 | double float NaN:s according to the Arm Runtime ABI. This should be sorted out in the future. |
| 27 | |
| 28 | Some minor changes to the mbed-crypto pack is required to allow building TF-M with the |
| 29 | IAR tools. This will be sorted out once tf-m upgrades to >3.1.0 |
| 30 | |
| 31 | For mbed-crypto (CMakeLists.txt): |
| 32 | |
TTornblom | befd3ca | 2020-04-30 11:09:08 +0200 | [diff] [blame] | 33 | .. code-block:: bash |
| 34 | |
| 35 | if(CMAKE_COMPILER_IS_IAR) |
| 36 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts --warnings_are_errors -Ohz") |
| 37 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts") |
| 38 | + set(CMAKE_C_FLAGS_RELEASE "-Ohz") |
| 39 | + set(CMAKE_C_FLAGS_DEBUG "--debug -On") |
| 40 | + set(CMAKE_C_FLAGS_CHECK "--warnings_are_errors") |
| 41 | endif(CMAKE_COMPILER_IS_IAR) |
TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 42 | |
| 43 | |
| 44 | Build steps: |
| 45 | ============ |
| 46 | .. code-block:: bash |
| 47 | |
| 48 | cd <TF-M base folder> |
| 49 | cd trusted-firmware-m |
| 50 | mkdir cmake_build |
| 51 | cd cmake_build |
| 52 | cmake ../ -G"Unix Makefiles" -DTARGET_PLATFORM=AN521 -DCOMPILER=IARARM |
| 53 | cmake --build ./ -- install |
| 54 | |
| 55 | Regression Tests for the AN521 target platform |
| 56 | ============================================== |
| 57 | *TF-M build regression tests on Linux* |
| 58 | |
| 59 | .. code-block:: bash |
| 60 | |
| 61 | cd <TF-M base folder> |
| 62 | cd trusted-firmware-m |
| 63 | mkdir cmake_test |
| 64 | cd cmake_test |
| 65 | cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=IARARM ../ |
| 66 | cmake --build ./ -- install |
| 67 | |
| 68 | *TF-M build regression tests on Windows* |
| 69 | |
| 70 | .. code-block:: bash |
| 71 | |
| 72 | cd <TF-M base folder> |
| 73 | cd trusted-firmware-m |
| 74 | mkdir cmake_test |
| 75 | cd cmake_test |
| 76 | cmake -G"Unix Makefiles" -DPROJ_CONFIG=`cygpath -am ../configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=IARARM ../ |
| 77 | cmake --build ./ -- install |
| 78 | |
| 79 | *Copyright (c) 2020, Arm Limited. All rights reserved.* |