blob: aa8796248e4707df4fe203a41293c4716cb2c3c7 [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
David Vincze4a6555e2019-11-06 09:32:13 +0100215Install the following tools:
216
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100217- DS-5 |DS5_VERSION|.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200218- Git tools v2.10.0
219- CMake (see the "Supported CMake versions" chapter)
220- GNU Make (see the "Supported make versions" chapter)
David Vincze4a6555e2019-11-06 09:32:13 +0100221- Python3 and the pip package manager (from Python 3.4 it's included)
222- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
223
224 .. code-block:: bash
225
226 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
227
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200228- SRecord v1.58 (for Musca test chip boards)
229
230Setup a shell to enable compiler toolchain and CMake after installation.
231------------------------------------------------------------------------
232
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100233To import Arm Compiler v6.10 in your bash shell console:
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200234
235.. Warning::
236 Arm compiler specific environment variable may need updating based on
237 specific products and licenses as explained in
238 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
239
240.. code-block:: bash
241
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100242 export PATH=<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100243 export ARM_TOOL_VARIANT=ult
244 export ARM_PRODUCT_PATH=<DS-5_PATH>/sw/mappings
245 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200246
247To import CMake in your bash shell console:
248
249.. code-block:: bash
250
251 export PATH=/bin:$PATH
252
253To import GNU Arm in your bash shell console:
254
255.. code-block:: bash
256
257 export PATH=/bin:$PATH
258
Mingyang Sun1e590642019-09-24 10:46:21 +0800259Windows + Cygwin setup
260======================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200261
David Vincze4a6555e2019-11-06 09:32:13 +0100262Install the following tools:
263
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100264- uVision |KEIL_VERSION| or DS-5 |DS5_VERSION| (DS-5 Ultimate Edition) which
265 provides the Arm Compiler v6.10 compiler or GNU Arm compiler v6.3.1.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200266- Git client latest version (https://git-scm.com/download/win)
Mingyang Sun1e590642019-09-24 10:46:21 +0800267- CMake (`native Windows version <https://cmake.org/download/>`__,
268 see the `Supported CMake versions`_ chapter)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200269- `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877
270 (64 bits)
271- GNU make should be installed by selecting appropriate package during
272 cygwin
273 installation.
David Vincze4a6555e2019-11-06 09:32:13 +0100274- Python3 `(native Windows version) <https://www.python.org/downloads/>`__ and
275 the pip package manager (from Python 3.4 it's included)
276- Python3 packages: *cryptography, pyasn1, yaml, jinja2 v2.10, cbor v1.0.0*
277
278 .. code-block:: bash
279
280 pip3 install --user cryptography pyasn1 pyyaml jinja2 cbor
281
Jamie Foxb8a92702019-06-05 17:19:31 +0100282- `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for Musca test
283 chip boards)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200284
285Setup Cygwin to enable a compiler toolchain and CMake after installation.
286-------------------------------------------------------------------------
287
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100288If applicable, import Arm Compiler v6.10 in your shell console. To make this
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200289change permanent, add the command line into ~/.bashrc
290
291Armclang + DS-5
292^^^^^^^^^^^^^^^
293.. Note::
294
295 - Arm compiler specific environment variable may need updating based on
296 specific products and licenses as explained in
297 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
298 - Arm licensing related environment variables must use Windows paths, and not
299 the Cygwin specific one relative to */cygrive*.
300
301.. code-block:: bash
302
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100303 export PATH=/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
304 export ARM_PRODUCT_PATH=C:/<DS-5_PATH>/sw/mappings
305 export ARM_TOOL_VARIANT=ult
306 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200307
308Armclang + Keil MDK Arm
309^^^^^^^^^^^^^^^^^^^^^^^
310
311.. Note::
312
313 - Arm compiler specific environment variable may need updating based
314 on specific products and licenses as explained in
315 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
316
317.. code-block:: bash
318
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100319 export PATH=/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin:$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200320
321GNU Arm
322^^^^^^^
323
324If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make
325this change permanent, add the command line into ~/.bashrc
326
327.. code-block:: bash
328
329 export PATH=<GNU Arm path>/bin:$PATH
330
331CMake
332^^^^^
333
334To import CMake in your bash shell console:
335
336.. code-block:: bash
337
338 export PATH=/cygdrive/c/<CMake path>/bin:$PATH
339
340Building the documentation
341==========================
342
343The build system is prepared to support generation of two documents.
344The Reference Manual which is Doxygen based, and the User Guide which is
345Sphinx based. Both document can be generated in HTML and PDF format.
346
347.. Note::
348
349 Support for document generation in the build environment is not mandatory.
350 Missing document generation tools will not block building the TF-M
351 firmware.
352
353To compile the TF-M Reference Manual
354------------------------------------
355
356The following additional tools are needed:
357
358 - Doxygen v1.8.0 or later
359 - Graphviz dot v2.38.0 or later
360 - PlantUML v1.2018.11 or later
361 - Java runtime environment 1.8 or later (for running PlantUML)
362
363For PDF generation the following tools are needed in addition to the
364above list:
365
366 - LaTeX
367 - PdfLaTeX
368
369Set-up the needed tools
370^^^^^^^^^^^^^^^^^^^^^^^
371
372Linux
373"""""
374.. code-block:: bash
375
376 sudo apt-get install -y doxygen graphviz default-jre
377 mkdir ~/plantuml
378 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
379
380For PDF generation:
381
382.. code-block:: bash
383
384 sudo apt-get install -y doxygen-latex
385
386Windows + Cygwin
387""""""""""""""""
388
389Download and install the following tools:
390 - `Doxygen
391 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__
392 - `Graphviz
393 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
394 - The Java runtime is part of the DS5 installation or can be
395 `downloaded from here <https://www.java.com/en/download/>`__
396 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
397
398For PDF generation:
399
400 - `MikTeX <https://miktex.org/download>`__
401
402 .. Note::
403 When building the documentation the first time, MikTeX might prompt for
404 installing missing LaTeX components. Please allow the MikTeX package
405 manager to set-up these.
406
407Configure the shell
408^^^^^^^^^^^^^^^^^^^
409
410Linux
411"""""
412
413::
414
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100415 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200416
417Windows + Cygwin
418""""""""""""""""
419
420Assumptions for the settings below:
421
422 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
423 - doxygen, dot, and MikTeX binaries are available on the PATH.
424 - Java JVM is used from DS5 installation.
425
426::
427
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100428 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200429 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
430
431To compile the TF-M User Guide
432------------------------------
433
434The following additional tools are needed:
435
436 - Python3 and the following modules:
437 - Sphinx v1.7.9
438 - m2r v0.2.0
439 - sphinxcontrib-plantuml
440 - sphinx-rtd-theme
441 - Graphviz dot v2.38.0 or later
442 - PlantUML v1.2018.11 or later
443 - Java runtime environment 1.8 or later (for running PlantUML)
444
445For PDF generation the following tools are needed in addition to the
446above list:
447
448 - LaTeX
449 - PdfLaTeX
450
451Set-up the needed tools
452^^^^^^^^^^^^^^^^^^^^^^^
453
454Linux
455"""""
456
457.. code-block:: bash
458
459 sudo apt-get install -y python3 graphviz default-jre
460 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
461 mkdir ~/plantuml
462 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
463
464For PDF generation:
465
466.. code-block:: bash
467
468 sudo apt-get install -y doxygen-latex
469
470Windows + Cygwin
471""""""""""""""""
472Download and install the following tools:
473 - Python3 `(native Windows version) <https://www.python.org/downloads/>`__
474 - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml*
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100475
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200476 .. code-block:: bash
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100477
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200478 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100479
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200480 - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
481 - The Java runtime is part of the DS5 installation or can be
482 `downloaded from here <https://www.java.com/en/download/>`__
483 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
484
485For PDF generation:
486
487- `MikTeX <https://miktex.org/download>`__
488
489.. Note::
490 When building the documentation the first time, MikTeX might
491 prompt for installing missing LaTeX components. Please allow the MikTeX
492 package manager to set-up these.
493
494Configure the shell
495^^^^^^^^^^^^^^^^^^^
496
497Linux
498"""""
499.. code-block:: bash
500
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100501 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200502
503Windows + Cygwin
504""""""""""""""""
505
506Assumptions for the settings below:
507
508 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
509 - doxygen, dot, and MikTeX binaries are available on the PATH.
510 - Java JVM is used from DS5 installation.
511
512.. code-block:: bash
513
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100514 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200515 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
516
517--------------
518
519*Copyright (c) 2017-2019, Arm Limited. All rights reserved.*