Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 1 | ########################## |
| 2 | TF-M Software requirements |
| 3 | ########################## |
| 4 | |
| 5 | To build the TF-M firmware the following tools are needed: |
| 6 | |
| 7 | .. csv-table:: Tool dependencies |
| 8 | :header: "Name", "Version", "Component" |
| 9 | |
| 10 | "C compiler",See `Supported C compilers`_,"Firmware" |
| 11 | "CMake",See `Supported CMake versions`_, |
| 12 | "GNU Make",See `Supported GNU make versions`_, |
| 13 | "Python",3.x,"Firmware, User Guide" |
| 14 | "yaml",,"Firmware" |
| 15 | "pyasn1",,"Firmware" |
| 16 | "jinja2",,"Firmware" |
| 17 | "pycrypto",,"Firmware" |
| 18 | "Doxygen",">1.8","Reference manual" |
| 19 | "Sphinx",">1.4","User Guide" |
| 20 | "sphinxcontrib-plantuml",,"User Guide" |
| 21 | "sphinx-trd-theme",,"User Guide" |
| 22 | "Git",, |
| 23 | "PlantUML",">v1.2018.11","Reference Manual, User Guide" |
| 24 | "Graphviz dot",">v2.38.0","Reference manual" |
| 25 | "Java runtime environment (JRE)",">1.8","Reference Manual, User Guide" |
| 26 | "LaTex",,"pdf version of Reference Manual and User Guide" |
| 27 | "PdfLaTex",,"pdf version of Reference Manual and User Guide" |
| 28 | |
| 29 | Dependency chain: |
| 30 | |
| 31 | .. uml:: |
| 32 | |
| 33 | @startuml |
| 34 | skinparam state { |
| 35 | BackgroundColor #92AEE0 |
| 36 | FontColor black |
| 37 | FontSize 16 |
| 38 | AttributeFontColor black |
| 39 | AttributeFontSize 16 |
| 40 | BackgroundColor<<pdf>> #A293E2 |
| 41 | BackgroundColor<<doc>> #90DED6 |
| 42 | } |
| 43 | state fw as "Firmware" : TF-M binary |
| 44 | state c_comp as "C Compiler" : C99 |
| 45 | state gmake as "GNU make" |
| 46 | state u_guide as "User Guide" <<doc>> |
| 47 | state refman as "Reference Manual" <<doc>> |
| 48 | state rtd_theme as "sphinx-rtd-theme" <<doc>> |
| 49 | state sphnix_puml as "sphinxcontrib-plantuml" <<doc>> |
| 50 | state JRE as "JRE" <<doc>> : Java Runtime Environment |
| 51 | state gwiz as "Graphwiz dot" <<doc>> |
| 52 | state Sphinx as "Sphinx" <<doc>> |
| 53 | state m2r as "m2r" <<doc>> |
| 54 | state PlantUML as "PlantUML" <<doc>> |
| 55 | state LaTex as "LaTex" <<pdf>> |
| 56 | state PdfLaTex as "PdfLaTex" <<<<pdf>>>> |
| 57 | state Doxygen as "Doxygen" <<doc>> |
| 58 | |
| 59 | [*] --> fw |
| 60 | fw --> c_comp |
| 61 | fw --> CMake |
| 62 | CMake --> gmake |
| 63 | fw --> pycrypto |
| 64 | fw --> pyasn1 |
| 65 | fw --> yaml |
| 66 | fw --> jinja2 |
| 67 | pycrypto --> Python3 |
| 68 | pyasn1 --> Python3 |
| 69 | yaml --> Python3 |
| 70 | jinja2 --> Python3 |
| 71 | |
| 72 | [*] --> u_guide |
| 73 | u_guide --> Sphinx |
| 74 | Sphinx --> m2r |
| 75 | Sphinx --> rtd_theme |
| 76 | Sphinx --> sphnix_puml |
| 77 | m2r --> Python3 |
| 78 | rtd_theme --> Python3 |
| 79 | sphnix_puml --> Python3 |
| 80 | Sphinx --> PlantUML |
| 81 | PlantUML --> JRE |
| 82 | PlantUML --> gwiz |
| 83 | Sphinx --> LaTex |
| 84 | LaTex --> PdfLaTex |
| 85 | |
| 86 | [*] --> refman |
| 87 | refman --> Doxygen |
| 88 | Doxygen --> PlantUML |
| 89 | Doxygen --> LaTex |
| 90 | state Legend { |
| 91 | state x as "For PDF generation only" <<pdf>> |
| 92 | state y as "For document generation only" <<doc>> |
| 93 | state z as "Mandatory" |
| 94 | } |
| 95 | |
| 96 | @enduml |
| 97 | |
| 98 | **************************** |
| 99 | Supported build environments |
| 100 | **************************** |
| 101 | |
| 102 | TF-M officially supports a limited set of build environments and setups. In |
| 103 | this context, official support means that the environments listed below |
| 104 | are actively used by team members and active developers hence users should |
| 105 | be able to recreate the same configurations by following the instructions |
| 106 | described below. In case of problems, the TF-M team provides support |
| 107 | only for these environments, but building in other environments can still be |
| 108 | possible. |
| 109 | |
| 110 | The following environments are supported: |
| 111 | |
| 112 | - Windows 10 x64 + Cygwin x64 (example configuration is provided for |
| 113 | this Windows setup only). |
| 114 | - Windows 10 x64 + msys2 x64. |
| 115 | - Windows 10 x65 + git-bash (MinGW) + gnumake from DS-5 or msys2. |
| 116 | - Ubuntu 16.04 x64 |
| 117 | - Ubuntu 18.04 x64 |
| 118 | |
| 119 | ********************* |
| 120 | Supported C compilers |
| 121 | ********************* |
| 122 | |
| 123 | To compile TF-M code, at least one of the supported compiler toolchains have to |
| 124 | be available in the build environment. The currently supported compiler |
| 125 | versions are: |
| 126 | |
| 127 | - Arm Compiler v6.7.1 |
| 128 | - Arm Compiler v6.9 |
| 129 | - Arm Compiler v6.10 |
| 130 | - Arm Compiler v6.11 |
Gary Morrison | 81fb08c | 2019-05-30 10:14:35 -0500 | [diff] [blame] | 131 | - Arm Compiler v6.12 |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 132 | - GNU Arm compiler v6.3.1 |
| 133 | - GNU Arm compiler v7.3 |
| 134 | |
| 135 | .. Note:: |
| 136 | - The Arm compilers above are provided via Keil uVision v5.24.1 or |
Gary Morrison | 81fb08c | 2019-05-30 10:14:35 -0500 | [diff] [blame] | 137 | greater, DS-5 v5.27.1 or greater, and Development Studio 2018.0 or greater, |
| 138 | or they can be downloaded as standalone packages from |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 139 | `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__. |
| 140 | |
| 141 | - Arm compiler specific environment variable may need updating based |
| 142 | on specific products and licenses as explained in |
| 143 | `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__. |
| 144 | |
| 145 | - The GNU Arm compiler can be downloaded from |
| 146 | `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__. |
| 147 | On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update* |
| 148 | or *GNU Arm Embedded Toolchain: 7-2018-q2-update* |
| 149 | |
| 150 | ************************ |
| 151 | Supported CMake versions |
| 152 | ************************ |
| 153 | |
| 154 | The build-system is CMake based and supports the following versions: |
| 155 | |
| 156 | - 3.7 |
| 157 | - 3.10 |
| 158 | - 3.11 |
| 159 | - 3.12 |
| 160 | - 3.13 |
| 161 | - 3.14 |
| 162 | |
| 163 | .. Note:: |
| 164 | - Please use the latest build version available (i.e. 3.7.2 instead of |
| 165 | 3.7.0). |
| 166 | While it is preferable to use the newest version this is not required |
| 167 | and any version from the above list should work. |
| 168 | - Recent versions of CMake can be downloaded from |
| 169 | https://cmake.org/download/, and older releases are available from |
| 170 | https://cmake.org/files. |
| 171 | |
| 172 | *************************** |
| 173 | Supported GNU make versions |
| 174 | *************************** |
| 175 | |
| 176 | The TF-M team builds using the "Unix Makefiles" generator of CMake and |
| 177 | thus GNU make is needed for the build. On Linux please use the version |
| 178 | available from the official repository of your distribution. |
| 179 | |
| 180 | On Windows the following binaries are supported: |
| 181 | |
| 182 | - GNU make v4.2.1 executable from Cygwin |
| 183 | - GNU make v4.2.1 executable from msys2 |
| 184 | - GNU make v4.2 executable from DS5 v5.29.1 (see <DS5 install root>/bin) |
| 185 | |
| 186 | CMake is quiet tolerant to GNU make versions and basically any |
| 187 | "reasonably recent" GNU make version shall work. |
| 188 | |
| 189 | CMake generators other than "Unix Makefiles" may work, but are not |
| 190 | officially supported. |
| 191 | |
| 192 | ************** |
| 193 | Example setups |
| 194 | ************** |
| 195 | |
| 196 | This section lists dependencies and some exact and tested steps to set-up a |
| 197 | TF-M-m build environment under various OSes. |
| 198 | |
| 199 | Ubuntu |
| 200 | ====== |
| 201 | |
| 202 | - DS-5 v5.27.1. |
| 203 | - Git tools v2.10.0 |
| 204 | - CMake (see the "Supported CMake versions" chapter) |
| 205 | - GNU Make (see the "Supported make versions" chapter) |
| 206 | - Python3, with the following libraries: |
| 207 | - pycrypto |
| 208 | - pyasn1 |
| 209 | - yaml |
| 210 | - jinja2 v2.10 |
| 211 | - sudo apt-get install python3-crypto python3-pyasn1 python3-yaml |
| 212 | python3-jinja2 |
| 213 | - SRecord v1.58 (for Musca test chip boards) |
| 214 | |
| 215 | Setup a shell to enable compiler toolchain and CMake after installation. |
| 216 | ------------------------------------------------------------------------ |
| 217 | |
| 218 | To import Arm Compiler v6.7.1 in your bash shell console: |
| 219 | |
| 220 | .. Warning:: |
| 221 | Arm compiler specific environment variable may need updating based on |
| 222 | specific products and licenses as explained in |
| 223 | `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__. |
| 224 | |
| 225 | .. code-block:: bash |
| 226 | |
| 227 | export PATH=<DS-5_PATH>/sw/ARMCompiler6.7.1/bin:$PATH |
| 228 | export ARM_TOOL_VARIANT="ult" |
| 229 | export ARM_PRODUCT_PATH="<DS-5_PATH>/sw/mappings" |
| 230 | export ARMLMD_LICENSE_FILE="<LICENSE_FILE_PATH>" |
| 231 | |
| 232 | To import CMake in your bash shell console: |
| 233 | |
| 234 | .. code-block:: bash |
| 235 | |
| 236 | export PATH=/bin:$PATH |
| 237 | |
| 238 | To import GNU Arm in your bash shell console: |
| 239 | |
| 240 | .. code-block:: bash |
| 241 | |
| 242 | export PATH=/bin:$PATH |
| 243 | |
| 244 | Windows + Cygwin |
| 245 | ================ |
| 246 | |
| 247 | - uVision v5.24.1 or DS-5 v5.27.1 (DS-5 Ultimate Edition) which |
| 248 | provides the |
| 249 | Arm Compiler v6.7.1 compiler or GNU Arm compiler v6.3.1. |
| 250 | - Git client latest version (https://git-scm.com/download/win) |
| 251 | - CMake (see the "Supported CMake versions" chapter) |
| 252 | - `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877 |
| 253 | (64 bits) |
| 254 | - GNU make should be installed by selecting appropriate package during |
| 255 | cygwin |
| 256 | installation. |
| 257 | - Python3 `(native Windows |
| 258 | version) <https://www.python.org/downloads/>`__, with the following |
| 259 | libraries: |
| 260 | - pycryptodome (pip3 install --user pycryptodome) |
| 261 | - pyasn1 (pip3 install --user pyasn1) |
| 262 | - pyyaml (pip3 install --user pyyaml) |
| 263 | - jinja2 (pip3 install --user jinja2) |
| 264 | - Python3 pip |
| 265 | - `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for |
| 266 | Musca-A1 test chip board) |
| 267 | |
| 268 | Setup Cygwin to enable a compiler toolchain and CMake after installation. |
| 269 | ------------------------------------------------------------------------- |
| 270 | |
| 271 | If applicable, import Arm Compiler v6.7.1 in your shell console. To make this |
| 272 | change permanent, add the command line into ~/.bashrc |
| 273 | |
| 274 | Armclang + DS-5 |
| 275 | ^^^^^^^^^^^^^^^ |
| 276 | .. Note:: |
| 277 | |
| 278 | - Arm compiler specific environment variable may need updating based on |
| 279 | specific products and licenses as explained in |
| 280 | `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__. |
| 281 | - Arm licensing related environment variables must use Windows paths, and not |
| 282 | the Cygwin specific one relative to */cygrive*. |
| 283 | |
| 284 | .. code-block:: bash |
| 285 | |
| 286 | export PATH="/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.7.1/bin":$PATH |
| 287 | export ARM_PRODUCT_PATH="C:/<DS-5_PATH>/sw/mappings" |
| 288 | export ARM_TOOL_VARIANT="ult" |
| 289 | export ARMLMD_LICENSE_FILE="<LICENSE_FILE_PATH>" |
| 290 | |
| 291 | Armclang + Keil MDK Arm |
| 292 | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 293 | |
| 294 | .. Note:: |
| 295 | |
| 296 | - Arm compiler specific environment variable may need updating based |
| 297 | on specific products and licenses as explained in |
| 298 | `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__. |
| 299 | |
| 300 | .. code-block:: bash |
| 301 | |
| 302 | export PATH="/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin":$PATH |
| 303 | |
| 304 | GNU Arm |
| 305 | ^^^^^^^ |
| 306 | |
| 307 | If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make |
| 308 | this change permanent, add the command line into ~/.bashrc |
| 309 | |
| 310 | .. code-block:: bash |
| 311 | |
| 312 | export PATH=<GNU Arm path>/bin:$PATH |
| 313 | |
| 314 | CMake |
| 315 | ^^^^^ |
| 316 | |
| 317 | To import CMake in your bash shell console: |
| 318 | |
| 319 | .. code-block:: bash |
| 320 | |
| 321 | export PATH=/cygdrive/c/<CMake path>/bin:$PATH |
| 322 | |
| 323 | Building the documentation |
| 324 | ========================== |
| 325 | |
| 326 | The build system is prepared to support generation of two documents. |
| 327 | The Reference Manual which is Doxygen based, and the User Guide which is |
| 328 | Sphinx based. Both document can be generated in HTML and PDF format. |
| 329 | |
| 330 | .. Note:: |
| 331 | |
| 332 | Support for document generation in the build environment is not mandatory. |
| 333 | Missing document generation tools will not block building the TF-M |
| 334 | firmware. |
| 335 | |
| 336 | To compile the TF-M Reference Manual |
| 337 | ------------------------------------ |
| 338 | |
| 339 | The following additional tools are needed: |
| 340 | |
| 341 | - Doxygen v1.8.0 or later |
| 342 | - Graphviz dot v2.38.0 or later |
| 343 | - PlantUML v1.2018.11 or later |
| 344 | - Java runtime environment 1.8 or later (for running PlantUML) |
| 345 | |
| 346 | For PDF generation the following tools are needed in addition to the |
| 347 | above list: |
| 348 | |
| 349 | - LaTeX |
| 350 | - PdfLaTeX |
| 351 | |
| 352 | Set-up the needed tools |
| 353 | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 354 | |
| 355 | Linux |
| 356 | """"" |
| 357 | .. code-block:: bash |
| 358 | |
| 359 | sudo apt-get install -y doxygen graphviz default-jre |
| 360 | mkdir ~/plantuml |
| 361 | curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar |
| 362 | |
| 363 | For PDF generation: |
| 364 | |
| 365 | .. code-block:: bash |
| 366 | |
| 367 | sudo apt-get install -y doxygen-latex |
| 368 | |
| 369 | Windows + Cygwin |
| 370 | """""""""""""""" |
| 371 | |
| 372 | Download and install the following tools: |
| 373 | - `Doxygen |
| 374 | 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__ |
| 375 | - `Graphviz |
| 376 | 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__ |
| 377 | - The Java runtime is part of the DS5 installation or can be |
| 378 | `downloaded from here <https://www.java.com/en/download/>`__ |
| 379 | - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__ |
| 380 | |
| 381 | For PDF generation: |
| 382 | |
| 383 | - `MikTeX <https://miktex.org/download>`__ |
| 384 | |
| 385 | .. Note:: |
| 386 | When building the documentation the first time, MikTeX might prompt for |
| 387 | installing missing LaTeX components. Please allow the MikTeX package |
| 388 | manager to set-up these. |
| 389 | |
| 390 | Configure the shell |
| 391 | ^^^^^^^^^^^^^^^^^^^ |
| 392 | |
| 393 | Linux |
| 394 | """"" |
| 395 | |
| 396 | :: |
| 397 | |
| 398 | export PLANTUML_JAR_PATH="~/plantuml/plantuml.jar" |
| 399 | |
| 400 | Windows + Cygwin |
| 401 | """""""""""""""" |
| 402 | |
| 403 | Assumptions for the settings below: |
| 404 | |
| 405 | - plantuml.jar is available at c:\\plantuml\\plantuml.jar |
| 406 | - doxygen, dot, and MikTeX binaries are available on the PATH. |
| 407 | - Java JVM is used from DS5 installation. |
| 408 | |
| 409 | :: |
| 410 | |
| 411 | export PLANTUML_JAR_PATH="c:/plantuml/plantuml.jar" |
| 412 | export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin |
| 413 | |
| 414 | To compile the TF-M User Guide |
| 415 | ------------------------------ |
| 416 | |
| 417 | The following additional tools are needed: |
| 418 | |
| 419 | - Python3 and the following modules: |
| 420 | - Sphinx v1.7.9 |
| 421 | - m2r v0.2.0 |
| 422 | - sphinxcontrib-plantuml |
| 423 | - sphinx-rtd-theme |
| 424 | - Graphviz dot v2.38.0 or later |
| 425 | - PlantUML v1.2018.11 or later |
| 426 | - Java runtime environment 1.8 or later (for running PlantUML) |
| 427 | |
| 428 | For PDF generation the following tools are needed in addition to the |
| 429 | above list: |
| 430 | |
| 431 | - LaTeX |
| 432 | - PdfLaTeX |
| 433 | |
| 434 | Set-up the needed tools |
| 435 | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 436 | |
| 437 | Linux |
| 438 | """"" |
| 439 | |
| 440 | .. code-block:: bash |
| 441 | |
| 442 | sudo apt-get install -y python3 graphviz default-jre |
| 443 | pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml |
| 444 | mkdir ~/plantuml |
| 445 | curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar |
| 446 | |
| 447 | For PDF generation: |
| 448 | |
| 449 | .. code-block:: bash |
| 450 | |
| 451 | sudo apt-get install -y doxygen-latex |
| 452 | |
| 453 | Windows + Cygwin |
| 454 | """""""""""""""" |
| 455 | Download and install the following tools: |
| 456 | - Python3 `(native Windows version) <https://www.python.org/downloads/>`__ |
| 457 | - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml* |
| 458 | |
| 459 | .. code-block:: bash |
| 460 | |
| 461 | pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml |
| 462 | |
| 463 | - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__ |
| 464 | - The Java runtime is part of the DS5 installation or can be |
| 465 | `downloaded from here <https://www.java.com/en/download/>`__ |
| 466 | - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__ |
| 467 | |
| 468 | For PDF generation: |
| 469 | |
| 470 | - `MikTeX <https://miktex.org/download>`__ |
| 471 | |
| 472 | .. Note:: |
| 473 | When building the documentation the first time, MikTeX might |
| 474 | prompt for installing missing LaTeX components. Please allow the MikTeX |
| 475 | package manager to set-up these. |
| 476 | |
| 477 | Configure the shell |
| 478 | ^^^^^^^^^^^^^^^^^^^ |
| 479 | |
| 480 | Linux |
| 481 | """"" |
| 482 | .. code-block:: bash |
| 483 | |
| 484 | export PLANTUML_JAR_PATH="~/plantuml/plantuml.jar" |
| 485 | |
| 486 | Windows + Cygwin |
| 487 | """""""""""""""" |
| 488 | |
| 489 | Assumptions for the settings below: |
| 490 | |
| 491 | - plantuml.jar is available at c:\\plantuml\\plantuml.jar |
| 492 | - doxygen, dot, and MikTeX binaries are available on the PATH. |
| 493 | - Java JVM is used from DS5 installation. |
| 494 | |
| 495 | .. code-block:: bash |
| 496 | |
| 497 | export PLANTUML_JAR_PATH="c:/plantuml/plantuml.jar" |
| 498 | export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin |
| 499 | |
| 500 | -------------- |
| 501 | |
| 502 | *Copyright (c) 2017-2019, Arm Limited. All rights reserved.* |