blob: 078ab1fcdaf6d77d864b390799158e8513794e30 [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
Ronald Cronc0c38fa2019-09-23 09:36:56 +020050 - Arm Compiler v6.13
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020051 - GNU Arm compiler v6.3.1
52 - GNU Arm compiler v7.3
53
54.. Note::
Antonio de Angelis065ce4a2019-06-04 14:02:33 +010055 - The Arm compilers above are provided via Keil uVision |KEIL_VERSION|
56 or greater, DS-5 |DS5_VERSION| or greater, and Development Studio
57 |DEV_STUDIO_VERSION| or greater, or they can be downloaded as standalone
58 packages from
59 `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__.
60
61 - Arm compiler specific environment variable may need updating based
62 on specific products and licenses as explained in
63 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
64
65 - The GNU Arm compiler can be downloaded from
66 `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__.
67 On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update*
68 or *GNU Arm Embedded Toolchain: 7-2018-q2-update*
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020069
70************************
71Supported CMake versions
72************************
73
74The build-system is CMake based and supports the following versions:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +010075
76 - 3.7
77 - 3.10
78 - 3.11
79 - 3.12
80 - 3.13
81 - 3.14
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020082
83.. Note::
84 - Please use the latest build version available (i.e. 3.7.2 instead of
85 3.7.0).
86 While it is preferable to use the newest version this is not required
87 and any version from the above list should work.
88 - Recent versions of CMake can be downloaded from
89 https://cmake.org/download/, and older releases are available from
90 https://cmake.org/files.
Mingyang Sun1e590642019-09-24 10:46:21 +080091 - For Cygwin users, please use a native windows CMake version
92 instead of the version installed with Cygwin.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020093
94***************************
95Supported GNU make versions
96***************************
97
98The TF-M team builds using the "Unix Makefiles" generator of CMake and
99thus GNU make is needed for the build. On Linux please use the version
100available from the official repository of your distribution.
101
102On Windows the following binaries are supported:
Kevin Townsend0f869bb2019-08-01 21:06:48 +0200103
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200104 - GNU make v4.2.1 executable from Cygwin
105 - GNU make v4.2.1 executable from msys2
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100106 - GNU make v4.2 executable from DS5 |DS5_VERSION| (see <DS5 directory>/bin)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200107
108CMake is quiet tolerant to GNU make versions and basically any
109"reasonably recent" GNU make version shall work.
110
111CMake generators other than "Unix Makefiles" may work, but are not
112officially supported.
113
114**************
115Example setups
116**************
117
118This section lists dependencies and some exact and tested steps to set-up a
119TF-M-m build environment under various OSes.
120
Mingyang Sun1e590642019-09-24 10:46:21 +0800121Ubuntu setup
122============
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200123
David Vincze4a6555e2019-11-06 09:32:13 +0100124Install the following tools:
125
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100126- DS-5 |DS5_VERSION|.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200127- Git tools v2.10.0
128- CMake (see the "Supported CMake versions" chapter)
129- GNU Make (see the "Supported make versions" chapter)
David Vincze4a6555e2019-11-06 09:32:13 +0100130- Python3 and the pip package manager (from Python 3.4 it's included)
131- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
132
133 .. code-block:: bash
134
135 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
136
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200137- SRecord v1.58 (for Musca test chip boards)
138
139Setup a shell to enable compiler toolchain and CMake after installation.
140------------------------------------------------------------------------
141
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100142To import Arm Compiler v6.10 in your bash shell console:
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200143
144.. Warning::
145 Arm compiler specific environment variable may need updating based on
146 specific products and licenses as explained in
147 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
148
149.. code-block:: bash
150
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100151 export PATH=<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100152 export ARM_TOOL_VARIANT=ult
153 export ARM_PRODUCT_PATH=<DS-5_PATH>/sw/mappings
154 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200155
156To import CMake in your bash shell console:
157
158.. code-block:: bash
159
160 export PATH=/bin:$PATH
161
162To import GNU Arm in your bash shell console:
163
164.. code-block:: bash
165
166 export PATH=/bin:$PATH
167
Mingyang Sun1e590642019-09-24 10:46:21 +0800168Windows + Cygwin setup
169======================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200170
David Vincze4a6555e2019-11-06 09:32:13 +0100171Install the following tools:
172
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100173- uVision |KEIL_VERSION| or DS-5 |DS5_VERSION| (DS-5 Ultimate Edition) which
174 provides the Arm Compiler v6.10 compiler or GNU Arm compiler v6.3.1.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200175- Git client latest version (https://git-scm.com/download/win)
Mingyang Sun1e590642019-09-24 10:46:21 +0800176- CMake (`native Windows version <https://cmake.org/download/>`__,
177 see the `Supported CMake versions`_ chapter)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200178- `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877
179 (64 bits)
180- GNU make should be installed by selecting appropriate package during
181 cygwin
182 installation.
David Vincze4a6555e2019-11-06 09:32:13 +0100183- Python3 `(native Windows version) <https://www.python.org/downloads/>`__ and
184 the pip package manager (from Python 3.4 it's included)
185- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
186
187 .. code-block:: bash
188
189 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
190
Jamie Foxb8a92702019-06-05 17:19:31 +0100191- `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for Musca test
192 chip boards)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200193
194Setup Cygwin to enable a compiler toolchain and CMake after installation.
195-------------------------------------------------------------------------
196
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100197If applicable, import Arm Compiler v6.10 in your shell console. To make this
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200198change permanent, add the command line into ~/.bashrc
199
200Armclang + DS-5
201^^^^^^^^^^^^^^^
202.. Note::
203
204 - Arm compiler specific environment variable may need updating based on
205 specific products and licenses as explained in
206 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
207 - Arm licensing related environment variables must use Windows paths, and not
208 the Cygwin specific one relative to */cygrive*.
209
210.. code-block:: bash
211
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100212 export PATH=/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
213 export ARM_PRODUCT_PATH=C:/<DS-5_PATH>/sw/mappings
214 export ARM_TOOL_VARIANT=ult
215 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200216
217Armclang + Keil MDK Arm
218^^^^^^^^^^^^^^^^^^^^^^^
219
220.. Note::
221
222 - Arm compiler specific environment variable may need updating based
223 on specific products and licenses as explained in
224 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
225
226.. code-block:: bash
227
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100228 export PATH=/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin:$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200229
230GNU Arm
231^^^^^^^
232
233If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make
234this change permanent, add the command line into ~/.bashrc
235
236.. code-block:: bash
237
238 export PATH=<GNU Arm path>/bin:$PATH
239
240CMake
241^^^^^
242
243To import CMake in your bash shell console:
244
245.. code-block:: bash
246
247 export PATH=/cygdrive/c/<CMake path>/bin:$PATH
248
249Building the documentation
250==========================
251
252The build system is prepared to support generation of two documents.
253The Reference Manual which is Doxygen based, and the User Guide which is
254Sphinx based. Both document can be generated in HTML and PDF format.
255
256.. Note::
257
258 Support for document generation in the build environment is not mandatory.
259 Missing document generation tools will not block building the TF-M
260 firmware.
261
262To compile the TF-M Reference Manual
263------------------------------------
264
265The following additional tools are needed:
266
267 - Doxygen v1.8.0 or later
268 - Graphviz dot v2.38.0 or later
269 - PlantUML v1.2018.11 or later
270 - Java runtime environment 1.8 or later (for running PlantUML)
271
272For PDF generation the following tools are needed in addition to the
273above list:
274
275 - LaTeX
276 - PdfLaTeX
277
278Set-up the needed tools
279^^^^^^^^^^^^^^^^^^^^^^^
280
281Linux
282"""""
283.. code-block:: bash
284
285 sudo apt-get install -y doxygen graphviz default-jre
286 mkdir ~/plantuml
287 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
288
289For PDF generation:
290
291.. code-block:: bash
292
293 sudo apt-get install -y doxygen-latex
294
295Windows + Cygwin
296""""""""""""""""
297
298Download and install the following tools:
299 - `Doxygen
300 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__
301 - `Graphviz
302 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
303 - The Java runtime is part of the DS5 installation or can be
304 `downloaded from here <https://www.java.com/en/download/>`__
305 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
306
307For PDF generation:
308
309 - `MikTeX <https://miktex.org/download>`__
310
311 .. Note::
312 When building the documentation the first time, MikTeX might prompt for
313 installing missing LaTeX components. Please allow the MikTeX package
314 manager to set-up these.
315
316Configure the shell
317^^^^^^^^^^^^^^^^^^^
318
319Linux
320"""""
321
322::
323
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100324 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200325
326Windows + Cygwin
327""""""""""""""""
328
329Assumptions for the settings below:
330
331 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
332 - doxygen, dot, and MikTeX binaries are available on the PATH.
333 - Java JVM is used from DS5 installation.
334
335::
336
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100337 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200338 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
339
340To compile the TF-M User Guide
341------------------------------
342
343The following additional tools are needed:
344
345 - Python3 and the following modules:
346 - Sphinx v1.7.9
347 - m2r v0.2.0
348 - sphinxcontrib-plantuml
349 - sphinx-rtd-theme
350 - Graphviz dot v2.38.0 or later
351 - PlantUML v1.2018.11 or later
352 - Java runtime environment 1.8 or later (for running PlantUML)
353
354For PDF generation the following tools are needed in addition to the
355above list:
356
357 - LaTeX
358 - PdfLaTeX
359
360Set-up the needed tools
361^^^^^^^^^^^^^^^^^^^^^^^
362
363Linux
364"""""
365
366.. code-block:: bash
367
368 sudo apt-get install -y python3 graphviz default-jre
369 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
370 mkdir ~/plantuml
371 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
372
373For PDF generation:
374
375.. code-block:: bash
376
377 sudo apt-get install -y doxygen-latex
378
379Windows + Cygwin
380""""""""""""""""
381Download and install the following tools:
382 - Python3 `(native Windows version) <https://www.python.org/downloads/>`__
383 - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml*
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100384
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200385 .. code-block:: bash
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100386
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200387 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100388
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200389 - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
390 - The Java runtime is part of the DS5 installation or can be
391 `downloaded from here <https://www.java.com/en/download/>`__
392 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
393
394For PDF generation:
395
396- `MikTeX <https://miktex.org/download>`__
397
398.. Note::
399 When building the documentation the first time, MikTeX might
400 prompt for installing missing LaTeX components. Please allow the MikTeX
401 package manager to set-up these.
402
403Configure the shell
404^^^^^^^^^^^^^^^^^^^
405
406Linux
407"""""
408.. code-block:: bash
409
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100410 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200411
412Windows + Cygwin
413""""""""""""""""
414
415Assumptions for the settings below:
416
417 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
418 - doxygen, dot, and MikTeX binaries are available on the PATH.
419 - Java JVM is used from DS5 installation.
420
421.. code-block:: bash
422
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100423 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200424 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
425
Galanakis, Minos757139a2019-11-11 15:00:11 +0000426**************************
427Tool & Dependency overview
428**************************
429
430To build the TF-M firmware the following tools are needed:
431
432.. csv-table:: Tool dependencies
433 :header: "Name", "Version", "Component"
434
435 "C compiler",See `Supported C compilers`_,"Firmware"
436 "CMake",See `Supported CMake versions`_,
437 "GNU Make",See `Supported GNU make versions`_,
438 "Python",3.x,"Firmware, User Guide"
439 "yaml",,"Firmware"
440 "pyasn1",,"Firmware"
441 "jinja2",,"Firmware"
442 "cryptography",,"Firmware"
443 "cbor",,"Firmware"
444 "Doxygen",">1.8","Reference manual"
445 "Sphinx",">1.4","User Guide"
446 "sphinxcontrib-plantuml",,"User Guide"
447 "sphinx-trd-theme",,"User Guide"
448 "Git",,
449 "PlantUML",">v1.2018.11","Reference Manual, User Guide"
450 "Graphviz dot",">v2.38.0","Reference manual"
451 "Java runtime environment (JRE)",">1.8","Reference Manual, User Guide"
452 "LaTex",,"pdf version of Reference Manual and User Guide"
453 "PdfLaTex",,"pdf version of Reference Manual and User Guide"
454
455Dependency chain:
456
457.. uml::
458
459 @startuml
460 skinparam state {
461 BackgroundColor #92AEE0
462 FontColor black
463 FontSize 16
464 AttributeFontColor black
465 AttributeFontSize 16
466 BackgroundColor<<pdf>> #A293E2
467 BackgroundColor<<doc>> #90DED6
468 }
469 state fw as "Firmware" : TF-M binary
470 state c_comp as "C Compiler" : C99
471 state gmake as "GNU make"
472 state u_guide as "User Guide" <<doc>>
473 state refman as "Reference Manual" <<doc>>
474 state rtd_theme as "sphinx-rtd-theme" <<doc>>
475 state sphnix_puml as "sphinxcontrib-plantuml" <<doc>>
476 state JRE as "JRE" <<doc>> : Java Runtime Environment
477 state gwiz as "Graphwiz dot" <<doc>>
478 state Sphinx as "Sphinx" <<doc>>
479 state m2r as "m2r" <<doc>>
480 state PlantUML as "PlantUML" <<doc>>
481 state LaTex as "LaTex" <<pdf>>
482 state PdfLaTex as "PdfLaTex" <<<<pdf>>>>
483 state Doxygen as "Doxygen" <<doc>>
484
485 [*] --> fw
486 fw --> c_comp
487 fw --> CMake
488 CMake --> gmake
489 fw --> cryptography
490 fw --> pyasn1
491 fw --> yaml
492 fw --> jinja2
493 fw --> cbor
494 cryptography --> Python3
495 pyasn1 --> Python3
496 yaml --> Python3
497 jinja2 --> Python3
498 cbor --> Python3
499
500 [*] --> u_guide
501 u_guide --> Sphinx
502 Sphinx --> m2r
503 Sphinx --> rtd_theme
504 Sphinx --> sphnix_puml
505 m2r --> Python3
506 rtd_theme --> Python3
507 sphnix_puml --> Python3
508 Sphinx --> PlantUML
509 PlantUML --> JRE
510 PlantUML --> gwiz
511 Sphinx --> LaTex
512 LaTex --> PdfLaTex
513
514 [*] --> refman
515 refman --> Doxygen
516 Doxygen --> PlantUML
517 Doxygen --> LaTex
518 state Legend {
519 state x as "For PDF generation only" <<pdf>>
520 state y as "For document generation only" <<doc>>
521 state z as "Mandatory"
522 }
523
524 @enduml
525
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200526--------------
527
Ronald Cronc0c38fa2019-09-23 09:36:56 +0200528*Copyright (c) 2017-2020, Arm Limited. All rights reserved.*