blob: 0b2ee22a5bb2a07fcb39862f3248b40de2cea7d4 [file] [log] [blame]
Gyorgy Szingdb9783c2019-04-17 21:08:48 +02001##########################
2TF-M Software requirements
3##########################
4
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"
21 "pycrypto",,"Firmware"
22 "Doxygen",">1.8","Reference manual"
23 "Sphinx",">1.4","User Guide"
24 "sphinxcontrib-plantuml",,"User Guide"
25 "sphinx-trd-theme",,"User Guide"
26 "Git",,
27 "PlantUML",">v1.2018.11","Reference Manual, User Guide"
28 "Graphviz dot",">v2.38.0","Reference manual"
29 "Java runtime environment (JRE)",">1.8","Reference Manual, User Guide"
30 "LaTex",,"pdf version of Reference Manual and User Guide"
31 "PdfLaTex",,"pdf version of Reference Manual and User Guide"
32
33Dependency chain:
34
35.. uml::
36
37 @startuml
38 skinparam state {
39 BackgroundColor #92AEE0
40 FontColor black
41 FontSize 16
42 AttributeFontColor black
43 AttributeFontSize 16
44 BackgroundColor<<pdf>> #A293E2
45 BackgroundColor<<doc>> #90DED6
46 }
47 state fw as "Firmware" : TF-M binary
48 state c_comp as "C Compiler" : C99
49 state gmake as "GNU make"
50 state u_guide as "User Guide" <<doc>>
51 state refman as "Reference Manual" <<doc>>
52 state rtd_theme as "sphinx-rtd-theme" <<doc>>
53 state sphnix_puml as "sphinxcontrib-plantuml" <<doc>>
54 state JRE as "JRE" <<doc>> : Java Runtime Environment
55 state gwiz as "Graphwiz dot" <<doc>>
56 state Sphinx as "Sphinx" <<doc>>
57 state m2r as "m2r" <<doc>>
58 state PlantUML as "PlantUML" <<doc>>
59 state LaTex as "LaTex" <<pdf>>
60 state PdfLaTex as "PdfLaTex" <<<<pdf>>>>
61 state Doxygen as "Doxygen" <<doc>>
62
63 [*] --> fw
64 fw --> c_comp
65 fw --> CMake
66 CMake --> gmake
67 fw --> pycrypto
68 fw --> pyasn1
69 fw --> yaml
70 fw --> jinja2
71 pycrypto --> Python3
72 pyasn1 --> Python3
73 yaml --> Python3
74 jinja2 --> Python3
75
76 [*] --> u_guide
77 u_guide --> Sphinx
78 Sphinx --> m2r
79 Sphinx --> rtd_theme
80 Sphinx --> sphnix_puml
81 m2r --> Python3
82 rtd_theme --> Python3
83 sphnix_puml --> Python3
84 Sphinx --> PlantUML
85 PlantUML --> JRE
86 PlantUML --> gwiz
87 Sphinx --> LaTex
88 LaTex --> PdfLaTex
89
90 [*] --> refman
91 refman --> Doxygen
92 Doxygen --> PlantUML
93 Doxygen --> LaTex
94 state Legend {
95 state x as "For PDF generation only" <<pdf>>
96 state y as "For document generation only" <<doc>>
97 state z as "Mandatory"
98 }
99
100 @enduml
101
102****************************
103Supported build environments
104****************************
105
106TF-M officially supports a limited set of build environments and setups. In
107this context, official support means that the environments listed below
108are actively used by team members and active developers hence users should
109be able to recreate the same configurations by following the instructions
110described below. In case of problems, the TF-M team provides support
111only for these environments, but building in other environments can still be
112possible.
113
114The following environments are supported:
115
116 - Windows 10 x64 + Cygwin x64 (example configuration is provided for
117 this Windows setup only).
118 - Windows 10 x64 + msys2 x64.
119 - Windows 10 x65 + git-bash (MinGW) + gnumake from DS-5 or msys2.
120 - Ubuntu 16.04 x64
121 - Ubuntu 18.04 x64
122
123*********************
124Supported C compilers
125*********************
126
127To compile TF-M code, at least one of the supported compiler toolchains have to
128be available in the build environment. The currently supported compiler
129versions are:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100130
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200131 - Arm Compiler v6.10
132 - Arm Compiler v6.11
Gary Morrison81fb08c2019-05-30 10:14:35 -0500133 - Arm Compiler v6.12
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200134 - GNU Arm compiler v6.3.1
135 - GNU Arm compiler v7.3
136
137.. Note::
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100138 - The Arm compilers above are provided via Keil uVision |KEIL_VERSION|
139 or greater, DS-5 |DS5_VERSION| or greater, and Development Studio
140 |DEV_STUDIO_VERSION| or greater, or they can be downloaded as standalone
141 packages from
142 `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__.
143
144 - Arm compiler specific environment variable may need updating based
145 on 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 - The GNU Arm compiler can be downloaded from
149 `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__.
150 On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update*
151 or *GNU Arm Embedded Toolchain: 7-2018-q2-update*
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200152
153************************
154Supported CMake versions
155************************
156
157The build-system is CMake based and supports the following versions:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100158
159 - 3.7
160 - 3.10
161 - 3.11
162 - 3.12
163 - 3.13
164 - 3.14
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200165
166.. Note::
167 - Please use the latest build version available (i.e. 3.7.2 instead of
168 3.7.0).
169 While it is preferable to use the newest version this is not required
170 and any version from the above list should work.
171 - Recent versions of CMake can be downloaded from
172 https://cmake.org/download/, and older releases are available from
173 https://cmake.org/files.
174
175***************************
176Supported GNU make versions
177***************************
178
179The TF-M team builds using the "Unix Makefiles" generator of CMake and
180thus GNU make is needed for the build. On Linux please use the version
181available from the official repository of your distribution.
182
183On Windows the following binaries are supported:
184
185 - GNU make v4.2.1 executable from Cygwin
186 - GNU make v4.2.1 executable from msys2
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100187 - GNU make v4.2 executable from DS5 |DS5_VERSION| (see <DS5 directory>/bin)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200188
189CMake is quiet tolerant to GNU make versions and basically any
190"reasonably recent" GNU make version shall work.
191
192CMake generators other than "Unix Makefiles" may work, but are not
193officially supported.
194
195**************
196Example setups
197**************
198
199This section lists dependencies and some exact and tested steps to set-up a
200TF-M-m build environment under various OSes.
201
202Ubuntu
203======
204
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100205- DS-5 |DS5_VERSION|.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200206- Git tools v2.10.0
207- CMake (see the "Supported CMake versions" chapter)
208- GNU Make (see the "Supported make versions" chapter)
209- Python3, with the following libraries:
210- pycrypto
211- pyasn1
212- yaml
213- jinja2 v2.10
214- sudo apt-get install python3-crypto python3-pyasn1 python3-yaml
215 python3-jinja2
216- SRecord v1.58 (for Musca test chip boards)
217
218Setup a shell to enable compiler toolchain and CMake after installation.
219------------------------------------------------------------------------
220
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100221To import Arm Compiler v6.10 in your bash shell console:
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200222
223.. Warning::
224 Arm compiler specific environment variable may need updating based on
225 specific products and licenses as explained in
226 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
227
228.. code-block:: bash
229
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100230 export PATH=<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200231 export ARM_TOOL_VARIANT="ult"
232 export ARM_PRODUCT_PATH="<DS-5_PATH>/sw/mappings"
233 export ARMLMD_LICENSE_FILE="<LICENSE_FILE_PATH>"
234
235To import CMake in your bash shell console:
236
237.. code-block:: bash
238
239 export PATH=/bin:$PATH
240
241To import GNU Arm in your bash shell console:
242
243.. code-block:: bash
244
245 export PATH=/bin:$PATH
246
247Windows + Cygwin
248================
249
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100250- uVision |KEIL_VERSION| or DS-5 |DS5_VERSION| (DS-5 Ultimate Edition) which
251 provides the Arm Compiler v6.10 compiler or GNU Arm compiler v6.3.1.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200252- Git client latest version (https://git-scm.com/download/win)
253- CMake (see the "Supported CMake versions" chapter)
254- `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877
255 (64 bits)
256- GNU make should be installed by selecting appropriate package during
257 cygwin
258 installation.
259- Python3 `(native Windows
260 version) <https://www.python.org/downloads/>`__, with the following
261 libraries:
262- pycryptodome (pip3 install --user pycryptodome)
263- pyasn1 (pip3 install --user pyasn1)
264- pyyaml (pip3 install --user pyyaml)
265- jinja2 (pip3 install --user jinja2)
266- Python3 pip
267- `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for
268 Musca-A1 test chip board)
269
270Setup Cygwin to enable a compiler toolchain and CMake after installation.
271-------------------------------------------------------------------------
272
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100273If applicable, import Arm Compiler v6.10 in your shell console. To make this
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200274change permanent, add the command line into ~/.bashrc
275
276Armclang + DS-5
277^^^^^^^^^^^^^^^
278.. Note::
279
280 - Arm compiler specific environment variable may need updating based on
281 specific products and licenses as explained in
282 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
283 - Arm licensing related environment variables must use Windows paths, and not
284 the Cygwin specific one relative to */cygrive*.
285
286.. code-block:: bash
287
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100288 export PATH="/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.10/bin":$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200289 export ARM_PRODUCT_PATH="C:/<DS-5_PATH>/sw/mappings"
290 export ARM_TOOL_VARIANT="ult"
291 export ARMLMD_LICENSE_FILE="<LICENSE_FILE_PATH>"
292
293Armclang + Keil MDK Arm
294^^^^^^^^^^^^^^^^^^^^^^^
295
296.. Note::
297
298 - Arm compiler specific environment variable may need updating based
299 on specific products and licenses as explained in
300 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
301
302.. code-block:: bash
303
304 export PATH="/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin":$PATH
305
306GNU Arm
307^^^^^^^
308
309If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make
310this change permanent, add the command line into ~/.bashrc
311
312.. code-block:: bash
313
314 export PATH=<GNU Arm path>/bin:$PATH
315
316CMake
317^^^^^
318
319To import CMake in your bash shell console:
320
321.. code-block:: bash
322
323 export PATH=/cygdrive/c/<CMake path>/bin:$PATH
324
325Building the documentation
326==========================
327
328The build system is prepared to support generation of two documents.
329The Reference Manual which is Doxygen based, and the User Guide which is
330Sphinx based. Both document can be generated in HTML and PDF format.
331
332.. Note::
333
334 Support for document generation in the build environment is not mandatory.
335 Missing document generation tools will not block building the TF-M
336 firmware.
337
338To compile the TF-M Reference Manual
339------------------------------------
340
341The following additional tools are needed:
342
343 - Doxygen v1.8.0 or later
344 - Graphviz dot v2.38.0 or later
345 - PlantUML v1.2018.11 or later
346 - Java runtime environment 1.8 or later (for running PlantUML)
347
348For PDF generation the following tools are needed in addition to the
349above list:
350
351 - LaTeX
352 - PdfLaTeX
353
354Set-up the needed tools
355^^^^^^^^^^^^^^^^^^^^^^^
356
357Linux
358"""""
359.. code-block:: bash
360
361 sudo apt-get install -y doxygen graphviz default-jre
362 mkdir ~/plantuml
363 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
364
365For PDF generation:
366
367.. code-block:: bash
368
369 sudo apt-get install -y doxygen-latex
370
371Windows + Cygwin
372""""""""""""""""
373
374Download and install the following tools:
375 - `Doxygen
376 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__
377 - `Graphviz
378 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
379 - The Java runtime is part of the DS5 installation or can be
380 `downloaded from here <https://www.java.com/en/download/>`__
381 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
382
383For PDF generation:
384
385 - `MikTeX <https://miktex.org/download>`__
386
387 .. Note::
388 When building the documentation the first time, MikTeX might prompt for
389 installing missing LaTeX components. Please allow the MikTeX package
390 manager to set-up these.
391
392Configure the shell
393^^^^^^^^^^^^^^^^^^^
394
395Linux
396"""""
397
398::
399
400 export PLANTUML_JAR_PATH="~/plantuml/plantuml.jar"
401
402Windows + Cygwin
403""""""""""""""""
404
405Assumptions for the settings below:
406
407 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
408 - doxygen, dot, and MikTeX binaries are available on the PATH.
409 - Java JVM is used from DS5 installation.
410
411::
412
413 export PLANTUML_JAR_PATH="c:/plantuml/plantuml.jar"
414 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
415
416To compile the TF-M User Guide
417------------------------------
418
419The following additional tools are needed:
420
421 - Python3 and the following modules:
422 - Sphinx v1.7.9
423 - m2r v0.2.0
424 - sphinxcontrib-plantuml
425 - sphinx-rtd-theme
426 - Graphviz dot v2.38.0 or later
427 - PlantUML v1.2018.11 or later
428 - Java runtime environment 1.8 or later (for running PlantUML)
429
430For PDF generation the following tools are needed in addition to the
431above list:
432
433 - LaTeX
434 - PdfLaTeX
435
436Set-up the needed tools
437^^^^^^^^^^^^^^^^^^^^^^^
438
439Linux
440"""""
441
442.. code-block:: bash
443
444 sudo apt-get install -y python3 graphviz default-jre
445 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
446 mkdir ~/plantuml
447 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
448
449For PDF generation:
450
451.. code-block:: bash
452
453 sudo apt-get install -y doxygen-latex
454
455Windows + Cygwin
456""""""""""""""""
457Download and install the following tools:
458 - Python3 `(native Windows version) <https://www.python.org/downloads/>`__
459 - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml*
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100460
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200461 .. code-block:: bash
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100462
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200463 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100464
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200465 - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
466 - The Java runtime is part of the DS5 installation or can be
467 `downloaded from here <https://www.java.com/en/download/>`__
468 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
469
470For PDF generation:
471
472- `MikTeX <https://miktex.org/download>`__
473
474.. Note::
475 When building the documentation the first time, MikTeX might
476 prompt for installing missing LaTeX components. Please allow the MikTeX
477 package manager to set-up these.
478
479Configure the shell
480^^^^^^^^^^^^^^^^^^^
481
482Linux
483"""""
484.. code-block:: bash
485
486 export PLANTUML_JAR_PATH="~/plantuml/plantuml.jar"
487
488Windows + Cygwin
489""""""""""""""""
490
491Assumptions for the settings below:
492
493 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
494 - doxygen, dot, and MikTeX binaries are available on the PATH.
495 - Java JVM is used from DS5 installation.
496
497.. code-block:: bash
498
499 export PLANTUML_JAR_PATH="c:/plantuml/plantuml.jar"
500 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
501
502--------------
503
504*Copyright (c) 2017-2019, Arm Limited. All rights reserved.*