blob: 89dabedbc520612d00072e33a205ac4a6bf6abfa [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 + msys2 x64.
30 - Windows 10 x64 + git-bash (MinGW) + gnumake from DS-5 or msys2.
31 - Windows 10 x64 + Cygwin x64 (example configuration is provided for
32 this Windows setup only).
33
34.. note::
35 Some tools (i.e. python3 and CMake) must NOT be installed from
36 Cygwin and instead a native windows version is needed. Please see the
37 chapter `Windows + Cygwin setup`_ below.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020038
39*********************
40Supported C compilers
41*********************
42
43To compile TF-M code, at least one of the supported compiler toolchains have to
44be available in the build environment. The currently supported compiler
45versions are:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +010046
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020047 - Arm Compiler v6.10
48 - Arm Compiler v6.11
Gary Morrison81fb08c2019-05-30 10:14:35 -050049 - Arm Compiler v6.12
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
113**************
114Example setups
115**************
116
117This section lists dependencies and some exact and tested steps to set-up a
118TF-M-m build environment under various OSes.
119
Mingyang Sun1e590642019-09-24 10:46:21 +0800120Ubuntu setup
121============
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200122
David Vincze4a6555e2019-11-06 09:32:13 +0100123Install the following tools:
124
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100125- DS-5 |DS5_VERSION|.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200126- Git tools v2.10.0
127- CMake (see the "Supported CMake versions" chapter)
128- GNU Make (see the "Supported make versions" chapter)
David Vincze4a6555e2019-11-06 09:32:13 +0100129- Python3 and the pip package manager (from Python 3.4 it's included)
130- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
131
132 .. code-block:: bash
133
134 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
135
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200136- SRecord v1.58 (for Musca test chip boards)
137
138Setup a shell to enable compiler toolchain and CMake after installation.
139------------------------------------------------------------------------
140
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100141To import Arm Compiler v6.10 in your bash shell console:
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200142
143.. Warning::
144 Arm compiler specific environment variable may need updating based on
145 specific products and licenses as explained in
146 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
147
148.. code-block:: bash
149
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100150 export PATH=<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100151 export ARM_TOOL_VARIANT=ult
152 export ARM_PRODUCT_PATH=<DS-5_PATH>/sw/mappings
153 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200154
155To import CMake in your bash shell console:
156
157.. code-block:: bash
158
159 export PATH=/bin:$PATH
160
161To import GNU Arm in your bash shell console:
162
163.. code-block:: bash
164
165 export PATH=/bin:$PATH
166
Mingyang Sun1e590642019-09-24 10:46:21 +0800167Windows + Cygwin setup
168======================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200169
David Vincze4a6555e2019-11-06 09:32:13 +0100170Install the following tools:
171
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100172- uVision |KEIL_VERSION| or DS-5 |DS5_VERSION| (DS-5 Ultimate Edition) which
173 provides the Arm Compiler v6.10 compiler or GNU Arm compiler v6.3.1.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200174- Git client latest version (https://git-scm.com/download/win)
Mingyang Sun1e590642019-09-24 10:46:21 +0800175- CMake (`native Windows version <https://cmake.org/download/>`__,
176 see the `Supported CMake versions`_ chapter)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200177- `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877
178 (64 bits)
179- GNU make should be installed by selecting appropriate package during
180 cygwin
181 installation.
David Vincze4a6555e2019-11-06 09:32:13 +0100182- Python3 `(native Windows version) <https://www.python.org/downloads/>`__ and
183 the pip package manager (from Python 3.4 it's included)
184- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
185
186 .. code-block:: bash
187
188 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
189
Jamie Foxb8a92702019-06-05 17:19:31 +0100190- `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for Musca test
191 chip boards)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200192
193Setup Cygwin to enable a compiler toolchain and CMake after installation.
194-------------------------------------------------------------------------
195
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100196If applicable, import Arm Compiler v6.10 in your shell console. To make this
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200197change permanent, add the command line into ~/.bashrc
198
199Armclang + DS-5
200^^^^^^^^^^^^^^^
201.. Note::
202
203 - Arm compiler specific environment variable may need updating based on
204 specific products and licenses as explained in
205 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
206 - Arm licensing related environment variables must use Windows paths, and not
207 the Cygwin specific one relative to */cygrive*.
208
209.. code-block:: bash
210
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100211 export PATH=/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
212 export ARM_PRODUCT_PATH=C:/<DS-5_PATH>/sw/mappings
213 export ARM_TOOL_VARIANT=ult
214 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200215
216Armclang + Keil MDK Arm
217^^^^^^^^^^^^^^^^^^^^^^^
218
219.. Note::
220
221 - Arm compiler specific environment variable may need updating based
222 on 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
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100227 export PATH=/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin:$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200228
229GNU Arm
230^^^^^^^
231
232If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make
233this change permanent, add the command line into ~/.bashrc
234
235.. code-block:: bash
236
237 export PATH=<GNU Arm path>/bin:$PATH
238
239CMake
240^^^^^
241
242To import CMake in your bash shell console:
243
244.. code-block:: bash
245
246 export PATH=/cygdrive/c/<CMake path>/bin:$PATH
247
248Building the documentation
249==========================
250
251The build system is prepared to support generation of two documents.
252The Reference Manual which is Doxygen based, and the User Guide which is
253Sphinx based. Both document can be generated in HTML and PDF format.
254
255.. Note::
256
257 Support for document generation in the build environment is not mandatory.
258 Missing document generation tools will not block building the TF-M
259 firmware.
260
261To compile the TF-M Reference Manual
262------------------------------------
263
264The following additional tools are needed:
265
266 - Doxygen v1.8.0 or later
267 - Graphviz dot v2.38.0 or later
268 - PlantUML v1.2018.11 or later
269 - Java runtime environment 1.8 or later (for running PlantUML)
270
271For PDF generation the following tools are needed in addition to the
272above list:
273
274 - LaTeX
275 - PdfLaTeX
276
277Set-up the needed tools
278^^^^^^^^^^^^^^^^^^^^^^^
279
280Linux
281"""""
282.. code-block:: bash
283
284 sudo apt-get install -y doxygen graphviz default-jre
285 mkdir ~/plantuml
286 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
287
288For PDF generation:
289
290.. code-block:: bash
291
292 sudo apt-get install -y doxygen-latex
293
294Windows + Cygwin
295""""""""""""""""
296
297Download and install the following tools:
298 - `Doxygen
299 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__
300 - `Graphviz
301 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
302 - The Java runtime is part of the DS5 installation or can be
303 `downloaded from here <https://www.java.com/en/download/>`__
304 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
305
306For PDF generation:
307
308 - `MikTeX <https://miktex.org/download>`__
309
310 .. Note::
311 When building the documentation the first time, MikTeX might prompt for
312 installing missing LaTeX components. Please allow the MikTeX package
313 manager to set-up these.
314
315Configure the shell
316^^^^^^^^^^^^^^^^^^^
317
318Linux
319"""""
320
321::
322
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100323 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200324
325Windows + Cygwin
326""""""""""""""""
327
328Assumptions for the settings below:
329
330 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
331 - doxygen, dot, and MikTeX binaries are available on the PATH.
332 - Java JVM is used from DS5 installation.
333
334::
335
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100336 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200337 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
338
339To compile the TF-M User Guide
340------------------------------
341
342The following additional tools are needed:
343
344 - Python3 and the following modules:
345 - Sphinx v1.7.9
346 - m2r v0.2.0
347 - sphinxcontrib-plantuml
348 - sphinx-rtd-theme
349 - Graphviz dot v2.38.0 or later
350 - PlantUML v1.2018.11 or later
351 - Java runtime environment 1.8 or later (for running PlantUML)
352
353For PDF generation the following tools are needed in addition to the
354above list:
355
356 - LaTeX
357 - PdfLaTeX
358
359Set-up the needed tools
360^^^^^^^^^^^^^^^^^^^^^^^
361
362Linux
363"""""
364
365.. code-block:: bash
366
367 sudo apt-get install -y python3 graphviz default-jre
368 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
369 mkdir ~/plantuml
370 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
371
372For PDF generation:
373
374.. code-block:: bash
375
376 sudo apt-get install -y doxygen-latex
377
378Windows + Cygwin
379""""""""""""""""
380Download and install the following tools:
381 - Python3 `(native Windows version) <https://www.python.org/downloads/>`__
382 - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml*
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100383
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200384 .. code-block:: bash
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100385
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200386 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100387
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200388 - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
389 - The Java runtime is part of the DS5 installation or can be
390 `downloaded from here <https://www.java.com/en/download/>`__
391 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
392
393For PDF generation:
394
395- `MikTeX <https://miktex.org/download>`__
396
397.. Note::
398 When building the documentation the first time, MikTeX might
399 prompt for installing missing LaTeX components. Please allow the MikTeX
400 package manager to set-up these.
401
402Configure the shell
403^^^^^^^^^^^^^^^^^^^
404
405Linux
406"""""
407.. code-block:: bash
408
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100409 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200410
411Windows + Cygwin
412""""""""""""""""
413
414Assumptions for the settings below:
415
416 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
417 - doxygen, dot, and MikTeX binaries are available on the PATH.
418 - Java JVM is used from DS5 installation.
419
420.. code-block:: bash
421
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100422 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200423 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
424
Galanakis, Minos757139a2019-11-11 15:00:11 +0000425**************************
426Tool & Dependency overview
427**************************
428
429To build the TF-M firmware the following tools are needed:
430
431.. csv-table:: Tool dependencies
432 :header: "Name", "Version", "Component"
433
434 "C compiler",See `Supported C compilers`_,"Firmware"
435 "CMake",See `Supported CMake versions`_,
436 "GNU Make",See `Supported GNU make versions`_,
437 "Python",3.x,"Firmware, User Guide"
438 "yaml",,"Firmware"
439 "pyasn1",,"Firmware"
440 "jinja2",,"Firmware"
441 "cryptography",,"Firmware"
442 "cbor",,"Firmware"
443 "Doxygen",">1.8","Reference manual"
444 "Sphinx",">1.4","User Guide"
445 "sphinxcontrib-plantuml",,"User Guide"
446 "sphinx-trd-theme",,"User Guide"
447 "Git",,
448 "PlantUML",">v1.2018.11","Reference Manual, User Guide"
449 "Graphviz dot",">v2.38.0","Reference manual"
450 "Java runtime environment (JRE)",">1.8","Reference Manual, User Guide"
451 "LaTex",,"pdf version of Reference Manual and User Guide"
452 "PdfLaTex",,"pdf version of Reference Manual and User Guide"
453
454Dependency chain:
455
456.. uml::
457
458 @startuml
459 skinparam state {
460 BackgroundColor #92AEE0
461 FontColor black
462 FontSize 16
463 AttributeFontColor black
464 AttributeFontSize 16
465 BackgroundColor<<pdf>> #A293E2
466 BackgroundColor<<doc>> #90DED6
467 }
468 state fw as "Firmware" : TF-M binary
469 state c_comp as "C Compiler" : C99
470 state gmake as "GNU make"
471 state u_guide as "User Guide" <<doc>>
472 state refman as "Reference Manual" <<doc>>
473 state rtd_theme as "sphinx-rtd-theme" <<doc>>
474 state sphnix_puml as "sphinxcontrib-plantuml" <<doc>>
475 state JRE as "JRE" <<doc>> : Java Runtime Environment
476 state gwiz as "Graphwiz dot" <<doc>>
477 state Sphinx as "Sphinx" <<doc>>
478 state m2r as "m2r" <<doc>>
479 state PlantUML as "PlantUML" <<doc>>
480 state LaTex as "LaTex" <<pdf>>
481 state PdfLaTex as "PdfLaTex" <<<<pdf>>>>
482 state Doxygen as "Doxygen" <<doc>>
483
484 [*] --> fw
485 fw --> c_comp
486 fw --> CMake
487 CMake --> gmake
488 fw --> cryptography
489 fw --> pyasn1
490 fw --> yaml
491 fw --> jinja2
492 fw --> cbor
493 cryptography --> Python3
494 pyasn1 --> Python3
495 yaml --> Python3
496 jinja2 --> Python3
497 cbor --> Python3
498
499 [*] --> u_guide
500 u_guide --> Sphinx
501 Sphinx --> m2r
502 Sphinx --> rtd_theme
503 Sphinx --> sphnix_puml
504 m2r --> Python3
505 rtd_theme --> Python3
506 sphnix_puml --> Python3
507 Sphinx --> PlantUML
508 PlantUML --> JRE
509 PlantUML --> gwiz
510 Sphinx --> LaTex
511 LaTex --> PdfLaTex
512
513 [*] --> refman
514 refman --> Doxygen
515 Doxygen --> PlantUML
516 Doxygen --> LaTex
517 state Legend {
518 state x as "For PDF generation only" <<pdf>>
519 state y as "For document generation only" <<doc>>
520 state z as "Mandatory"
521 }
522
523 @enduml
524
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200525--------------
526
527*Copyright (c) 2017-2019, Arm Limited. All rights reserved.*