Documentation generation
Two documents are available for generation:
Reference Manual (HTML, PDF)
User Guide (HTML, PDF)
The documentation build is independent from building the binary artifacts.
Tools and building environment
These tools are used to generate TF-M documentation:
Doxygen v1.8.0 or later
Graphviz dot v2.38.0 or later
PlantUML v1.2018.11 or later
Java runtime environment v1.8 or later (for running PlantUML)
(Optional) uv <https://docs.astral.sh/uv/getting-started/installation/#standalone-installer>
Additionally, for PDFs format:
LaTeX
PdfLaTeX
There are two ways of building TF-M reference manual:
As a custom target of TF-M CMake build system
Directly, using the command line tools
To prepare your building environment execute the following steps:
Install the required tools:
sudo apt-get install -y doxygen graphviz default-jre
mkdir ~/plantuml
curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download --output ~/plantuml/plantuml.jar
# For PDF generation
sudo apt-get install -y doxygen-latex librsvg2-bin
# Setup python venv for the project
python3 -m venv .venv
# NOTE: If your system python install version is <3.10 you can use `uv <https://docs.astral.sh/uv/getting-started/installation/#standalone-installer>` to setup your .venv
uv venv --python 3.12
source .venv/bin/activate
pip install ".[docs]"
# NOTE: If you've used `uv` to setup your `.venv`, prepend the `pip` commands with `uv`
uv pip install ".[docs]"
Set the environment variables:
export PLANTUML_JAR_PATH=~/plantuml/plantuml.jar
Download and install the following tools:
Set the environment variables, assuming that:
doxygen, dot, and MikTeX binaries are available on the PATH.
Java JVM is used from Arm DS installation.
set PLANTUML_JAR_PATH=<plantuml_Path>\plantuml.jar
set PATH=$PATH;<ARM_DS_PATH>\sw\java\bin
# Install the required Python modules
# Setup python venv for the project
python3 -m venv .venv
# NOTE: If your system python install version is <3.10 you can use `uv <https://docs.astral.sh/uv/getting-started/installation/#standalone-installer>` to setup your .venv
uv venv --python 3.12
source .venv/bin/activate
pip install ".[docs]"
# If uv is installed
uv pip install ".[docs]"
# NOTE: If you've used `uv` to setup your `.venv`, prepend the `pip` commands with `uv`
uv pip sync pylock.toml
Build TF-M Reference Manual
The Reference Manual will be generated in the build_docs/reference_manual.
Note
Please make sure to follow Tools and building environment before proceeding
cd <TF-M base folder>
source .venv/bin/activate
cmake -S docs -B build_docs
cmake --build build_docs -- tfm_docs_refman_html tfm_docs_refman_pdf
cd <TF-M base folder>
source .venv/bin/activate
pip install ".[docs]"
# If uv is installed
uv pip install ".[docs]"
cmake -S docs -B build_docs -G"Unix Makefiles"
cmake --build build_docs -- tfm_docs_refman_html tfm_docs_refman_pdf
Build TF-M User Guide
The User Manual will be available under the directory build_docs/user_guide.
cd <TF-M base folder>
source .venv/bin/activate
cmake -S docs -B build_docs
cmake --build build_docs -- tfm_docs_userguide_html tfm_docs_userguide_pdf
cd <TF-M base folder>
source .venv/bin/activate
cmake -S docs -B build_docs -G"Unix Makefiles"
cmake --build build_docs -- tfm_docs_userguide_html tfm_docs_userguide_pdf
Direct build using a command line tools
The direct build will build both user_guide and reference_manual.
# Build the documentation from build_docs directory
cd <TF-M base folder>
source .venv/bin/activate
mkdir build_docs
cp docs/conf.py build_docs/conf.py
cd build_docs
sphinx-build ./ user_guide
# Command line tools is yet not available for Windows
Dependencies
Copyright (c) 2017-2024, Arm Limited. All rights reserved.