blob: 2c4f47022b399fbfa24f948130de828e64b0a61c [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"
Kevin Townsend0f869bb2019-08-01 21:06:48 +020021 "cryptography",,"Firmware"
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020022 "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::
Kevin Townsend0f869bb2019-08-01 21:06:48 +020036
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020037 @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
Kevin Townsend0f869bb2019-08-01 21:06:48 +020067 fw --> cryptography
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020068 fw --> pyasn1
69 fw --> yaml
70 fw --> jinja2
Kevin Townsend0f869bb2019-08-01 21:06:48 +020071 cryptography --> Python3
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020072 pyasn1 --> Python3
73 yaml --> Python3
74 jinja2 --> Python3
Kevin Townsend0f869bb2019-08-01 21:06:48 +020075
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020076 [*] --> 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
Kevin Townsend0f869bb2019-08-01 21:06:48 +020089
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020090 [*] --> 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:
Kevin Townsend0f869bb2019-08-01 21:06:48 +0200115
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200116 - Ubuntu 16.04 x64
117 - Ubuntu 18.04 x64
Mingyang Sun1e590642019-09-24 10:46:21 +0800118 - Windows 10 x64 + msys2 x64.
119 - Windows 10 x64 + git-bash (MinGW) + gnumake from DS-5 or msys2.
120 - Windows 10 x64 + Cygwin x64 (example configuration is provided for
121 this Windows setup only).
122
123.. note::
124 Some tools (i.e. python3 and CMake) must NOT be installed from
125 Cygwin and instead a native windows version is needed. Please see the
126 chapter `Windows + Cygwin setup`_ below.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200127
128*********************
129Supported C compilers
130*********************
131
132To compile TF-M code, at least one of the supported compiler toolchains have to
133be available in the build environment. The currently supported compiler
134versions are:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100135
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200136 - Arm Compiler v6.10
137 - Arm Compiler v6.11
Gary Morrison81fb08c2019-05-30 10:14:35 -0500138 - Arm Compiler v6.12
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200139 - GNU Arm compiler v6.3.1
140 - GNU Arm compiler v7.3
141
142.. Note::
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100143 - The Arm compilers above are provided via Keil uVision |KEIL_VERSION|
144 or greater, DS-5 |DS5_VERSION| or greater, and Development Studio
145 |DEV_STUDIO_VERSION| or greater, or they can be downloaded as standalone
146 packages from
147 `here <https://developer.arm.com/products/software-development-tools/compilers/arm-compiler/downloads/version-6>`__.
148
149 - Arm compiler specific environment variable may need updating based
150 on specific products and licenses as explained in
151 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
152
153 - The GNU Arm compiler can be downloaded from
154 `here <https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads>`__.
155 On the page select *GNU Arm Embedded Toolchain: 6-2017-q1-update*
156 or *GNU Arm Embedded Toolchain: 7-2018-q2-update*
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200157
158************************
159Supported CMake versions
160************************
161
162The build-system is CMake based and supports the following versions:
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100163
164 - 3.7
165 - 3.10
166 - 3.11
167 - 3.12
168 - 3.13
169 - 3.14
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200170
171.. Note::
172 - Please use the latest build version available (i.e. 3.7.2 instead of
173 3.7.0).
174 While it is preferable to use the newest version this is not required
175 and any version from the above list should work.
176 - Recent versions of CMake can be downloaded from
177 https://cmake.org/download/, and older releases are available from
178 https://cmake.org/files.
Mingyang Sun1e590642019-09-24 10:46:21 +0800179 - For Cygwin users, please use a native windows CMake version
180 instead of the version installed with Cygwin.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200181
182***************************
183Supported GNU make versions
184***************************
185
186The TF-M team builds using the "Unix Makefiles" generator of CMake and
187thus GNU make is needed for the build. On Linux please use the version
188available from the official repository of your distribution.
189
190On Windows the following binaries are supported:
Kevin Townsend0f869bb2019-08-01 21:06:48 +0200191
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200192 - GNU make v4.2.1 executable from Cygwin
193 - GNU make v4.2.1 executable from msys2
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100194 - GNU make v4.2 executable from DS5 |DS5_VERSION| (see <DS5 directory>/bin)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200195
196CMake is quiet tolerant to GNU make versions and basically any
197"reasonably recent" GNU make version shall work.
198
199CMake generators other than "Unix Makefiles" may work, but are not
200officially supported.
201
202**************
203Example setups
204**************
205
206This section lists dependencies and some exact and tested steps to set-up a
207TF-M-m build environment under various OSes.
208
Mingyang Sun1e590642019-09-24 10:46:21 +0800209Ubuntu setup
210============
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200211
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100212- DS-5 |DS5_VERSION|.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200213- Git tools v2.10.0
214- CMake (see the "Supported CMake versions" chapter)
215- GNU Make (see the "Supported make versions" chapter)
216- Python3, with the following libraries:
Kevin Townsend0f869bb2019-08-01 21:06:48 +0200217- cryptography
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200218- pyasn1
219- yaml
220- jinja2 v2.10
221- sudo apt-get install python3-crypto python3-pyasn1 python3-yaml
222 python3-jinja2
223- SRecord v1.58 (for Musca test chip boards)
224
225Setup a shell to enable compiler toolchain and CMake after installation.
226------------------------------------------------------------------------
227
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100228To import Arm Compiler v6.10 in your bash shell console:
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200229
230.. Warning::
231 Arm compiler specific environment variable may need updating based on
232 specific products and licenses as explained in
233 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
234
235.. code-block:: bash
236
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100237 export PATH=<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100238 export ARM_TOOL_VARIANT=ult
239 export ARM_PRODUCT_PATH=<DS-5_PATH>/sw/mappings
240 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200241
242To import CMake in your bash shell console:
243
244.. code-block:: bash
245
246 export PATH=/bin:$PATH
247
248To import GNU Arm in your bash shell console:
249
250.. code-block:: bash
251
252 export PATH=/bin:$PATH
253
Mingyang Sun1e590642019-09-24 10:46:21 +0800254Windows + Cygwin setup
255======================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200256
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100257- uVision |KEIL_VERSION| or DS-5 |DS5_VERSION| (DS-5 Ultimate Edition) which
258 provides the Arm Compiler v6.10 compiler or GNU Arm compiler v6.3.1.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200259- Git client latest version (https://git-scm.com/download/win)
Mingyang Sun1e590642019-09-24 10:46:21 +0800260- CMake (`native Windows version <https://cmake.org/download/>`__,
261 see the `Supported CMake versions`_ chapter)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200262- `Cygwin <https://www.cygwin.com/>`__. Tests done with version 2.877
263 (64 bits)
264- GNU make should be installed by selecting appropriate package during
265 cygwin
266 installation.
267- Python3 `(native Windows
268 version) <https://www.python.org/downloads/>`__, with the following
269 libraries:
Kevin Townsend0f869bb2019-08-01 21:06:48 +0200270- cryptography (pip3 install --user cryptography)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200271- pyasn1 (pip3 install --user pyasn1)
272- pyyaml (pip3 install --user pyyaml)
273- jinja2 (pip3 install --user jinja2)
274- Python3 pip
Jamie Foxb8a92702019-06-05 17:19:31 +0100275- `SRecord v1.63 <https://sourceforge.net/projects/srecord/>`__ (for Musca test
276 chip boards)
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200277
278Setup Cygwin to enable a compiler toolchain and CMake after installation.
279-------------------------------------------------------------------------
280
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100281If applicable, import Arm Compiler v6.10 in your shell console. To make this
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200282change permanent, add the command line into ~/.bashrc
283
284Armclang + DS-5
285^^^^^^^^^^^^^^^
286.. Note::
287
288 - Arm compiler specific environment variable may need updating based on
289 specific products and licenses as explained in
290 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
291 - Arm licensing related environment variables must use Windows paths, and not
292 the Cygwin specific one relative to */cygrive*.
293
294.. code-block:: bash
295
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100296 export PATH=/cygdrive/c/<DS-5_PATH>/sw/ARMCompiler6.10/bin:$PATH
297 export ARM_PRODUCT_PATH=C:/<DS-5_PATH>/sw/mappings
298 export ARM_TOOL_VARIANT=ult
299 export ARMLMD_LICENSE_FILE=<LICENSE_FILE_PATH>
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200300
301Armclang + Keil MDK Arm
302^^^^^^^^^^^^^^^^^^^^^^^
303
304.. Note::
305
306 - Arm compiler specific environment variable may need updating based
307 on specific products and licenses as explained in
308 `product-and-toolkit-configuration <https://developer.arm.com/products/software-development-tools/license-management/resources/product-and-toolkit-configuration>`__.
309
310.. code-block:: bash
311
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100312 export PATH=/cygdrive/c/<uVision path>/ARM/ARMCLANG/bin:$PATH
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200313
314GNU Arm
315^^^^^^^
316
317If applicable, import GNU Arm compiler v6.3.1 in your shell console. To make
318this change permanent, add the command line into ~/.bashrc
319
320.. code-block:: bash
321
322 export PATH=<GNU Arm path>/bin:$PATH
323
324CMake
325^^^^^
326
327To import CMake in your bash shell console:
328
329.. code-block:: bash
330
331 export PATH=/cygdrive/c/<CMake path>/bin:$PATH
332
333Building the documentation
334==========================
335
336The build system is prepared to support generation of two documents.
337The Reference Manual which is Doxygen based, and the User Guide which is
338Sphinx based. Both document can be generated in HTML and PDF format.
339
340.. Note::
341
342 Support for document generation in the build environment is not mandatory.
343 Missing document generation tools will not block building the TF-M
344 firmware.
345
346To compile the TF-M Reference Manual
347------------------------------------
348
349The following additional tools are needed:
350
351 - Doxygen v1.8.0 or later
352 - Graphviz dot v2.38.0 or later
353 - PlantUML v1.2018.11 or later
354 - Java runtime environment 1.8 or later (for running PlantUML)
355
356For PDF generation the following tools are needed in addition to the
357above list:
358
359 - LaTeX
360 - PdfLaTeX
361
362Set-up the needed tools
363^^^^^^^^^^^^^^^^^^^^^^^
364
365Linux
366"""""
367.. code-block:: bash
368
369 sudo apt-get install -y doxygen graphviz default-jre
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""""""""""""""""
381
382Download and install the following tools:
383 - `Doxygen
384 1.8.8 <https://sourceforge.net/projects/doxygen/files/snapshots/doxygen-1.8-svn/windows/doxygenw20140924_1_8_8.zip/download>`__
385 - `Graphviz
386 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
387 - The Java runtime is part of the DS5 installation or can be
388 `downloaded from here <https://www.java.com/en/download/>`__
389 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
390
391For PDF generation:
392
393 - `MikTeX <https://miktex.org/download>`__
394
395 .. Note::
396 When building the documentation the first time, MikTeX might prompt for
397 installing missing LaTeX components. Please allow the MikTeX package
398 manager to set-up these.
399
400Configure the shell
401^^^^^^^^^^^^^^^^^^^
402
403Linux
404"""""
405
406::
407
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100408 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200409
410Windows + Cygwin
411""""""""""""""""
412
413Assumptions for the settings below:
414
415 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
416 - doxygen, dot, and MikTeX binaries are available on the PATH.
417 - Java JVM is used from DS5 installation.
418
419::
420
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100421 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200422 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
423
424To compile the TF-M User Guide
425------------------------------
426
427The following additional tools are needed:
428
429 - Python3 and the following modules:
430 - Sphinx v1.7.9
431 - m2r v0.2.0
432 - sphinxcontrib-plantuml
433 - sphinx-rtd-theme
434 - Graphviz dot v2.38.0 or later
435 - PlantUML v1.2018.11 or later
436 - Java runtime environment 1.8 or later (for running PlantUML)
437
438For PDF generation the following tools are needed in addition to the
439above list:
440
441 - LaTeX
442 - PdfLaTeX
443
444Set-up the needed tools
445^^^^^^^^^^^^^^^^^^^^^^^
446
447Linux
448"""""
449
450.. code-block:: bash
451
452 sudo apt-get install -y python3 graphviz default-jre
453 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
454 mkdir ~/plantuml
455 curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
456
457For PDF generation:
458
459.. code-block:: bash
460
461 sudo apt-get install -y doxygen-latex
462
463Windows + Cygwin
464""""""""""""""""
465Download and install the following tools:
466 - Python3 `(native Windows version) <https://www.python.org/downloads/>`__
467 - Pip packages *m2r, Sphinx, sphinx-rtd-theme sphinxcontrib-plantuml*
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100468
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200469 .. code-block:: bash
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100470
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200471 pip --user install m2r Sphinx sphinx-rtd-theme sphinxcontrib-plantuml
Antonio de Angelis065ce4a2019-06-04 14:02:33 +0100472
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200473 - `Graphviz 2.38 <https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi>`__
474 - The Java runtime is part of the DS5 installation or can be
475 `downloaded from here <https://www.java.com/en/download/>`__
476 - `PlantUML <http://sourceforge.net/projects/plantuml/files/plantuml.jar/download>`__
477
478For PDF generation:
479
480- `MikTeX <https://miktex.org/download>`__
481
482.. Note::
483 When building the documentation the first time, MikTeX might
484 prompt for installing missing LaTeX components. Please allow the MikTeX
485 package manager to set-up these.
486
487Configure the shell
488^^^^^^^^^^^^^^^^^^^
489
490Linux
491"""""
492.. code-block:: bash
493
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100494 export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200495
496Windows + Cygwin
497""""""""""""""""
498
499Assumptions for the settings below:
500
501 - plantuml.jar is available at c:\\plantuml\\plantuml.jar
502 - doxygen, dot, and MikTeX binaries are available on the PATH.
503 - Java JVM is used from DS5 installation.
504
505.. code-block:: bash
506
Vikas Katariya1c361cd2019-08-23 15:05:02 +0100507 export PLANTUML_JAR_PATH=c:/plantuml/plantuml.jar
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200508 export PATH=$PATH:/cygdrive/c/<DS-5 path>/sw/java/bin
509
510--------------
511
512*Copyright (c) 2017-2019, Arm Limited. All rights reserved.*