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, |
| 15 | due to lack of testing. |
| 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 |
| 22 | CMSIS_5 5.7.0. However 5.7.0 causes link errors and is currently unsupported in tf-m. Use |
| 23 | the 5.5.0 branch and replace the libraries in .../CMSIS_5/CMSIS/RTOS2/RTX/Library/IAR |
| 24 | with the ones from 5.7.0. |
| 25 | |
| 26 | This will be sorted out once tf-m upgrades to use CMSIS_5 5.7.0 (or later) |
| 27 | |
| 28 | For all configurations and build options some of the QCBOR tests fail due to the tests not handling |
| 29 | double float NaN:s according to the Arm Runtime ABI. This should be sorted out in the future. |
| 30 | |
| 31 | Some minor changes to the mbed-crypto pack is required to allow building TF-M with the |
| 32 | IAR tools. This will be sorted out once tf-m upgrades to >3.1.0 |
| 33 | |
| 34 | For mbed-crypto (CMakeLists.txt): |
| 35 | |
TTornblom | befd3ca | 2020-04-30 11:09:08 +0200 | [diff] [blame^] | 36 | .. code-block:: bash |
| 37 | |
| 38 | if(CMAKE_COMPILER_IS_IAR) |
| 39 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts --warnings_are_errors -Ohz") |
| 40 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts") |
| 41 | + set(CMAKE_C_FLAGS_RELEASE "-Ohz") |
| 42 | + set(CMAKE_C_FLAGS_DEBUG "--debug -On") |
| 43 | + set(CMAKE_C_FLAGS_CHECK "--warnings_are_errors") |
| 44 | endif(CMAKE_COMPILER_IS_IAR) |
TTornblom | b9e5ed0 | 2020-02-13 16:53:15 +0100 | [diff] [blame] | 45 | |
| 46 | |
| 47 | Build steps: |
| 48 | ============ |
| 49 | .. code-block:: bash |
| 50 | |
| 51 | cd <TF-M base folder> |
| 52 | cd trusted-firmware-m |
| 53 | mkdir cmake_build |
| 54 | cd cmake_build |
| 55 | cmake ../ -G"Unix Makefiles" -DTARGET_PLATFORM=AN521 -DCOMPILER=IARARM |
| 56 | cmake --build ./ -- install |
| 57 | |
| 58 | Regression Tests for the AN521 target platform |
| 59 | ============================================== |
| 60 | *TF-M build regression tests on Linux* |
| 61 | |
| 62 | .. code-block:: bash |
| 63 | |
| 64 | cd <TF-M base folder> |
| 65 | cd trusted-firmware-m |
| 66 | mkdir cmake_test |
| 67 | cd cmake_test |
| 68 | cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=IARARM ../ |
| 69 | cmake --build ./ -- install |
| 70 | |
| 71 | *TF-M build regression tests on Windows* |
| 72 | |
| 73 | .. code-block:: bash |
| 74 | |
| 75 | cd <TF-M base folder> |
| 76 | cd trusted-firmware-m |
| 77 | mkdir cmake_test |
| 78 | cd cmake_test |
| 79 | cmake -G"Unix Makefiles" -DPROJ_CONFIG=`cygpath -am ../configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=IARARM ../ |
| 80 | cmake --build ./ -- install |
| 81 | |
| 82 | *Copyright (c) 2020, Arm Limited. All rights reserved.* |