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