blob: d9f0ac87de17462798e3fb5912b7a51e542252a1 [file] [log] [blame]
Galanakis, Minos41f85972019-09-30 15:56:40 +01001#####################
2Software requirements
3#####################
Gyorgy Szingdb9783c2019-04-17 21:08:48 +02004
Antonio de Angelis065ce4a2019-06-04 14:02:33 +01005.. |DS5_VERSION| replace:: v5.29.1
6.. |KEIL_VERSION| replace:: v5.25.2
7.. |DEV_STUDIO_VERSION| replace:: 2018.0
8
Galanakis, Minos757139a2019-11-11 15:00:11 +00009A quick reference table is included in the
10:ref:`docs/user_guides/tfm_sw_requirement:Tool & Dependency overview` section
11of this document.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020012
13****************************
14Supported build environments
15****************************
16
17TF-M officially supports a limited set of build environments and setups. In
18this context, official support means that the environments listed below
19are actively used by team members and active developers hence users should
20be able to recreate the same configurations by following the instructions
21described below. In case of problems, the TF-M team provides support
22only for these environments, but building in other environments can still be
23possible.
24
25The following environments are supported:
Kevin Townsend0f869bb2019-08-01 21:06:48 +020026
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020027 - Ubuntu 16.04 x64
28 - Ubuntu 18.04 x64
Mingyang Sun1e590642019-09-24 10:46:21 +080029 - Windows 10 x64 + git-bash (MinGW) + gnumake from DS-5 or msys2.
30 - Windows 10 x64 + Cygwin x64 (example configuration is provided for
31 this Windows setup only).
32
33.. note::
34 Some tools (i.e. python3 and CMake) must NOT be installed from
35 Cygwin and instead a native windows version is needed. Please see the
36 chapter `Windows + Cygwin setup`_ below.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020037
38*********************
39Supported C compilers
40*********************
41
42To compile TF-M code, at least one of the supported compiler toolchains have to
43be available in the build environment. The currently supported compiler
44versions are:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +010045
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020046 - Arm Compiler v6.10
47 - Arm Compiler v6.11
Gary Morrison81fb08c2019-05-30 10:14:35 -050048 - Arm Compiler v6.12
Ronald Cronc0c38fa2019-09-23 09:36:56 +020049 - Arm Compiler v6.13
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020050 - GNU Arm compiler v6.3.1
51 - GNU Arm compiler v7.3
52
53.. Note::
Antonio de Angelis065ce4a2019-06-04 14:02:33 +010054 - The Arm compilers above are provided via Keil uVision |KEIL_VERSION|
55 or greater, DS-5 |DS5_VERSION| or greater, and Development Studio
56 |DEV_STUDIO_VERSION| or greater, or they can be downloaded as standalone
57 packages from
58 `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__.
59
60 - Arm compiler specific environment variable may need updating based
61 on specific products and licenses as explained in
62 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
63
64 - The GNU Arm compiler can be downloaded from
65 `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__.
66 On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update*
67 or *GNU Arm Embedded Toolchain: 7-2018-q2-update*
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020068
69************************
70Supported CMake versions
71************************
72
73The build-system is CMake based and supports the following versions:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +010074
75 - 3.7
76 - 3.10
77 - 3.11
78 - 3.12
79 - 3.13
80 - 3.14
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020081
82.. Note::
83 - Please use the latest build version available (i.e. 3.7.2 instead of
84 3.7.0).
85 While it is preferable to use the newest version this is not required
86 and any version from the above list should work.
87 - Recent versions of CMake can be downloaded from
88 https://cmake.org/download/, and older releases are available from
89 https://cmake.org/files.
Mingyang Sun1e590642019-09-24 10:46:21 +080090 - For Cygwin users, please use a native windows CMake version
91 instead of the version installed with Cygwin.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020092
93***************************
94Supported GNU make versions
95***************************
96
97The TF-M team builds using the "Unix Makefiles" generator of CMake and
98thus GNU make is needed for the build. On Linux please use the version
99available from the official repository of your distribution.
100
101On Windows the following binaries are supported:
Kevin Townsend0f869bb2019-08-01 21:06:48 +0200102
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200103 - GNU make v4.2.1 executable from Cygwin
104 - GNU make v4.2.1 executable from msys2
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100105 - GNU make v4.2 executable from DS5 |DS5_VERSION| (see <DS5 directory>/bin)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200106
107CMake is quiet tolerant to GNU make versions and basically any
108"reasonably recent" GNU make version shall work.
109
110CMake generators other than "Unix Makefiles" may work, but are not
111officially supported.
112
Minos Galanakisac6b06c2020-03-19 12:57:02 +0000113*********************
114External dependencies
115*********************
116
117In order to build TF-M the following external projects are required:
118
119 - `Mbed Crypto library <https://github.com/ARMmbed/mbed-crypto>`__ v3.0.1
120 is used as crypto library on the secure side
121 - `CMSIS Version 5 <https://github.com/ARM-software/CMSIS_5>`__ v5.5.0
122 is used to import RTX for the example non-secure app
123
124Each of the listed dependencies should be placed in a common root directory
125with trustedfirmware-m
126
127.. code-block:: bash
128
129 .
130 ├── CMSIS_5
131 ├── mbed-crypto
132 └── trusted-firmware-m
133
134.. Note::
135 `CMSIS_5` v5.5.0 has a known issue, affecting compilation using
136 Arm Compiler v6.10. Please refer to
137 `CMSIS release notes <https://github.com/ARM-software/CMSIS_5/releases>`__.
138 for guidance.
139
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200140**************
141Example setups
142**************
143
144This section lists dependencies and some exact and tested steps to set-up a
145TF-M-m build environment under various OSes.
146
Mingyang Sun1e590642019-09-24 10:46:21 +0800147Ubuntu setup
148============
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200149
David Vincze4a6555e2019-11-06 09:32:13 +0100150Install the following tools:
151
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100152- DS-5 |DS5_VERSION|.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200153- Git tools v2.10.0
Minos Galanakisac6b06c2020-03-19 12:57:02 +0000154- Git Large File Storage (git-lfs)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200155- CMake (see the "Supported CMake versions" chapter)
156- GNU Make (see the "Supported make versions" chapter)
David Vincze4a6555e2019-11-06 09:32:13 +0100157- Python3 and the pip package manager (from Python 3.4 it's included)
158- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
159
160 .. code-block:: bash
161
162 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
163
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200164- SRecord v1.58 (for Musca test chip boards)
165
166Setup a shell to enable compiler toolchain and CMake after installation.
167------------------------------------------------------------------------
168
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100169To import Arm Compiler v6.10 in your bash shell console:
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200170
171.. Warning::
172 Arm compiler specific environment variable may need updating based on
173 specific products and licenses as explained in
174 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
175
176.. code-block:: bash
177
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100178 export PATH=<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100179 export ARM_TOOL_VARIANT=ult
180 export ARM_PRODUCT_PATH=<DS-5_PATH>/sw/mappings
181 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200182
183To import CMake in your bash shell console:
184
185.. code-block:: bash
186
187 export PATH=/bin:$PATH
188
189To import GNU Arm in your bash shell console:
190
191.. code-block:: bash
192
193 export PATH=/bin:$PATH
194
Mingyang Sun1e590642019-09-24 10:46:21 +0800195Windows + Cygwin setup
196======================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200197
David Vincze4a6555e2019-11-06 09:32:13 +0100198Install the following tools:
199
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100200- uVision |KEIL_VERSION| or DS-5 |DS5_VERSION| (DS-5 Ultimate Edition) which
201 provides the Arm Compiler v6.10 compiler or GNU Arm compiler v6.3.1.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200202- Git client latest version (https://git-scm.com/download/win)
Minos Galanakisac6b06c2020-03-19 12:57:02 +0000203- Git Large File Storage (`native Windows version <https://git-lfs.github.com/>`__,
Mingyang Sun1e590642019-09-24 10:46:21 +0800204- CMake (`native Windows version <https://cmake.org/download/>`__,
205 see the `Supported CMake versions`_ chapter)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200206- `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877
207 (64 bits)
208- GNU make should be installed by selecting appropriate package during
209 cygwin
210 installation.
David Vincze4a6555e2019-11-06 09:32:13 +0100211- Python3 `(native Windows version) <https://www.python.org/downloads/>`__ and
212 the pip package manager (from Python 3.4 it's included)
213- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
214
215 .. code-block:: bash
216
217 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
218
Jamie Foxb8a92702019-06-05 17:19:31 +0100219- `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for Musca test
220 chip boards)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200221
222Setup Cygwin to enable a compiler toolchain and CMake after installation.
223-------------------------------------------------------------------------
224
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100225If applicable, import Arm Compiler v6.10 in your shell console. To make this
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200226change permanent, add the command line into ~/.bashrc
227
228Armclang + DS-5
229^^^^^^^^^^^^^^^
230.. Note::
231
232 - Arm compiler specific environment variable may need updating based on
233 specific products and licenses as explained in
234 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
235 - Arm licensing related environment variables must use Windows paths, and not
236 the Cygwin specific one relative to */cygrive*.
237
238.. code-block:: bash
239
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100240 export PATH=/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
241 export ARM_PRODUCT_PATH=C:/<DS-5_PATH>/sw/mappings
242 export ARM_TOOL_VARIANT=ult
243 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200244
245Armclang + Keil MDK Arm
246^^^^^^^^^^^^^^^^^^^^^^^
247
248.. Note::
249
250 - Arm compiler specific environment variable may need updating based
251 on specific products and licenses as explained in
252 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
253
254.. code-block:: bash
255
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100256 export PATH=/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin:$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200257
258GNU Arm
259^^^^^^^
260
261If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make
262this change permanent, add the command line into ~/.bashrc
263
264.. code-block:: bash
265
266 export PATH=<GNU Arm path>/bin:$PATH
267
268CMake
269^^^^^
270
271To import CMake in your bash shell console:
272
273.. code-block:: bash
274
275 export PATH=/cygdrive/c/<CMake path>/bin:$PATH
276
277Building the documentation
278==========================
279
280The build system is prepared to support generation of two documents.
281The Reference Manual which is Doxygen based, and the User Guide which is
282Sphinx based. Both document can be generated in HTML and PDF format.
283
284.. Note::
285
286 Support for document generation in the build environment is not mandatory.
287 Missing document generation tools will not block building the TF-M
288 firmware.
289
290To compile the TF-M Reference Manual
291------------------------------------
292
293The following additional tools are needed:
294
295 - Doxygen v1.8.0 or later
296 - Graphviz dot v2.38.0 or later
297 - PlantUML v1.2018.11 or later
298 - Java runtime environment 1.8 or later (for running PlantUML)
299
300For PDF generation the following tools are needed in addition to the
301above list:
302
303 - LaTeX
304 - PdfLaTeX
305
306Set-up the needed tools
307^^^^^^^^^^^^^^^^^^^^^^^
308
309Linux
310"""""
311.. code-block:: bash
312
313 sudo apt-get install -y doxygen graphviz default-jre
314 mkdir ~/plantuml
315 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
316
317For PDF generation:
318
319.. code-block:: bash
320
321 sudo apt-get install -y doxygen-latex
322
323Windows + Cygwin
324""""""""""""""""
325
326Download and install the following tools:
327 - `Doxygen
328 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__
329 - `Graphviz
330 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
331 - The Java runtime is part of the DS5 installation or can be
332 `downloaded from here <https://www.java.com/en/download/>`__
333 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
334
335For PDF generation:
336
337 - `MikTeX <https://miktex.org/download>`__
338
339 .. Note::
340 When building the documentation the first time, MikTeX might prompt for
341 installing missing LaTeX components. Please allow the MikTeX package
342 manager to set-up these.
343
344Configure the shell
345^^^^^^^^^^^^^^^^^^^
346
347Linux
348"""""
349
350::
351
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100352 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200353
354Windows + Cygwin
355""""""""""""""""
356
357Assumptions for the settings below:
358
359 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
360 - doxygen, dot, and MikTeX binaries are available on the PATH.
361 - Java JVM is used from DS5 installation.
362
363::
364
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100365 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200366 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
367
368To compile the TF-M User Guide
369------------------------------
370
371The following additional tools are needed:
372
373 - Python3 and the following modules:
374 - Sphinx v1.7.9
375 - m2r v0.2.0
376 - sphinxcontrib-plantuml
377 - sphinx-rtd-theme
378 - Graphviz dot v2.38.0 or later
379 - PlantUML v1.2018.11 or later
380 - Java runtime environment 1.8 or later (for running PlantUML)
381
382For PDF generation the following tools are needed in addition to the
383above list:
384
385 - LaTeX
386 - PdfLaTeX
387
388Set-up the needed tools
389^^^^^^^^^^^^^^^^^^^^^^^
390
391Linux
392"""""
393
394.. code-block:: bash
395
396 sudo apt-get install -y python3 graphviz default-jre
397 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
398 mkdir ~/plantuml
399 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
400
401For PDF generation:
402
403.. code-block:: bash
404
405 sudo apt-get install -y doxygen-latex
406
407Windows + Cygwin
408""""""""""""""""
409Download and install the following tools:
410 - Python3 `(native Windows version) <https://www.python.org/downloads/>`__
411 - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml*
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100412
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200413 .. code-block:: bash
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100414
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200415 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100416
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200417 - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
418 - The Java runtime is part of the DS5 installation or can be
419 `downloaded from here <https://www.java.com/en/download/>`__
420 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
421
422For PDF generation:
423
424- `MikTeX <https://miktex.org/download>`__
425
426.. Note::
427 When building the documentation the first time, MikTeX might
428 prompt for installing missing LaTeX components. Please allow the MikTeX
429 package manager to set-up these.
430
431Configure the shell
432^^^^^^^^^^^^^^^^^^^
433
434Linux
435"""""
436.. code-block:: bash
437
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100438 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200439
440Windows + Cygwin
441""""""""""""""""
442
443Assumptions for the settings below:
444
445 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
446 - doxygen, dot, and MikTeX binaries are available on the PATH.
447 - Java JVM is used from DS5 installation.
448
449.. code-block:: bash
450
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100451 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200452 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
453
Galanakis, Minos757139a2019-11-11 15:00:11 +0000454**************************
455Tool & Dependency overview
456**************************
457
458To build the TF-M firmware the following tools are needed:
459
460.. csv-table:: Tool dependencies
461 :header: "Name", "Version", "Component"
462
463 "C compiler",See `Supported C compilers`_,"Firmware"
464 "CMake",See `Supported CMake versions`_,
465 "GNU Make",See `Supported GNU make versions`_,
Minos Galanakisac6b06c2020-03-19 12:57:02 +0000466 "CMSIS 5",See `External dependencies`_,
467 "mbed-crypto",See `External dependencies`_,
Galanakis, Minos757139a2019-11-11 15:00:11 +0000468 "Python",3.x,"Firmware, User Guide"
469 "yaml",,"Firmware"
470 "pyasn1",,"Firmware"
471 "jinja2",,"Firmware"
472 "cryptography",,"Firmware"
473 "cbor",,"Firmware"
474 "Doxygen",">1.8","Reference manual"
475 "Sphinx",">1.4","User Guide"
476 "sphinxcontrib-plantuml",,"User Guide"
477 "sphinx-trd-theme",,"User Guide"
478 "Git",,
479 "PlantUML",">v1.2018.11","Reference Manual, User Guide"
480 "Graphviz dot",">v2.38.0","Reference manual"
481 "Java runtime environment (JRE)",">1.8","Reference Manual, User Guide"
482 "LaTex",,"pdf version of Reference Manual and User Guide"
483 "PdfLaTex",,"pdf version of Reference Manual and User Guide"
484
485Dependency chain:
486
487.. uml::
488
489 @startuml
490 skinparam state {
491 BackgroundColor #92AEE0
492 FontColor black
493 FontSize 16
494 AttributeFontColor black
495 AttributeFontSize 16
496 BackgroundColor<<pdf>> #A293E2
497 BackgroundColor<<doc>> #90DED6
498 }
499 state fw as "Firmware" : TF-M binary
500 state c_comp as "C Compiler" : C99
501 state gmake as "GNU make"
502 state u_guide as "User Guide" <<doc>>
503 state refman as "Reference Manual" <<doc>>
504 state rtd_theme as "sphinx-rtd-theme" <<doc>>
505 state sphnix_puml as "sphinxcontrib-plantuml" <<doc>>
506 state JRE as "JRE" <<doc>> : Java Runtime Environment
507 state gwiz as "Graphwiz dot" <<doc>>
508 state Sphinx as "Sphinx" <<doc>>
509 state m2r as "m2r" <<doc>>
510 state PlantUML as "PlantUML" <<doc>>
511 state LaTex as "LaTex" <<pdf>>
512 state PdfLaTex as "PdfLaTex" <<<<pdf>>>>
513 state Doxygen as "Doxygen" <<doc>>
514
515 [*] --> fw
516 fw --> c_comp
517 fw --> CMake
518 CMake --> gmake
519 fw --> cryptography
520 fw --> pyasn1
521 fw --> yaml
522 fw --> jinja2
523 fw --> cbor
524 cryptography --> Python3
525 pyasn1 --> Python3
526 yaml --> Python3
527 jinja2 --> Python3
528 cbor --> Python3
529
530 [*] --> u_guide
531 u_guide --> Sphinx
532 Sphinx --> m2r
533 Sphinx --> rtd_theme
534 Sphinx --> sphnix_puml
535 m2r --> Python3
536 rtd_theme --> Python3
537 sphnix_puml --> Python3
538 Sphinx --> PlantUML
539 PlantUML --> JRE
540 PlantUML --> gwiz
541 Sphinx --> LaTex
542 LaTex --> PdfLaTex
543
544 [*] --> refman
545 refman --> Doxygen
546 Doxygen --> PlantUML
547 Doxygen --> LaTex
548 state Legend {
549 state x as "For PDF generation only" <<pdf>>
550 state y as "For document generation only" <<doc>>
551 state z as "Mandatory"
552 }
553
554 @enduml
555
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200556--------------
557
Ronald Cronc0c38fa2019-09-23 09:36:56 +0200558*Copyright (c) 2017-2020, Arm Limited. All rights reserved.*