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