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