Docs: Update example build steps for split build

Signed-off-by: Gergely Korcsák <gergely.korcsak@arm.com>
Change-Id: I8744cc1009b71598f9fae52a5cb7bf268bc9429f
diff --git a/docs/examples/corstone310_fvp_dma/clcd_example.rst b/docs/examples/corstone310_fvp_dma/clcd_example.rst
index 80e6611..a96cf0b 100644
--- a/docs/examples/corstone310_fvp_dma/clcd_example.rst
+++ b/docs/examples/corstone310_fvp_dma/clcd_example.rst
@@ -19,16 +19,18 @@
 ***********
 Build steps
 ***********
-1. Run the following command in the tf-m directory:
+1. Build Secure TF-M with the following commands:
 
 .. code-block::
 
- $ cmake -S . -B cmake_build -DTFM_PLATFORM=arm/mps3/corstone310/fvp -DTFM_TOOLCHAIN_FILE=toolchain_ARMCLANG.cmake -DDEFAULT_NS_SCATTER=OFF -DPLATFORM_SVC_HANDLERS=ON -DNS_EVALUATION_APP_PATH=<tf-m-extras root>/examples/corstone310_fvp_dma/clcd_example
+ $ cmake -S <TF-M Source Dir> -B build/spe -DTFM_PLATFORM=arm/mps3/corstone310/fvp -DTFM_PROFILE=profile_small
+ $ cmake --build build/spe -- -j$(nproc) install
 
-2. Then:
+2. Then to build the Non-Secure app:
 
 .. code-block::
 
- $ cmake --build cmake_build -- install
+ $ cmake -S <path_to_this_example> -B build/nspe -DCONFIG_SPE_PATH=<absolute_path_to>/build/spe/api_ns
+ $ cmake --build build/nspe -- -j$(nproc)
 
-*Copyright (c) 2022-2023, Arm Limited. All rights reserved.*
+*Copyright (c) 2022-2024, Arm Limited. All rights reserved.*
diff --git a/docs/examples/corstone310_fvp_dma/triggering_example.rst b/docs/examples/corstone310_fvp_dma/triggering_example.rst
index f887a10..ddd1531 100644
--- a/docs/examples/corstone310_fvp_dma/triggering_example.rst
+++ b/docs/examples/corstone310_fvp_dma/triggering_example.rst
@@ -10,17 +10,19 @@
 ***********
 Build steps
 ***********
-1. Run the following command in the tf-m directory:
+1. Build Secure TF-M with the following commands:
 
 .. code-block::
 
- $ cmake -S . -B cmake_build -DTFM_PLATFORM=arm/mps3/corstone310/fvp -DTFM_TOOLCHAIN_FILE=toolchain_ARMCLANG.cmake -DNS_EVALUATION_APP_PATH=<tf-m-extras root>/examples/corstone310_fvp_dma/triggering_example
+ $ cmake -S <TF-M Source Dir> -B build/spe -DTFM_PLATFORM=arm/mps3/corstone310/fvp -DTFM_PROFILE=profile_small
+ $ cmake --build build/spe -- -j$(nproc) install
 
-2. Then:
+2. Then to build the Non-Secure app:
 
 .. code-block::
 
- $ cmake --build cmake_build -- install
+ $ cmake -S <path_to_this_example> -B build/nspe -DCONFIG_SPE_PATH=<absolute_path_to>/build/spe/api_ns
+ $ cmake --build build/nspe -- -j$(nproc)
 
 *********
 Run steps
@@ -51,4 +53,4 @@
 
 Select the FVP telnetterminal0 and type in 10 characters. The 10 characters are going to be echoed back in reverse order to the FVP telnetterminal1.
 
-*Copyright (c) 2022-2023, Arm Limited. All rights reserved.*
+*Copyright (c) 2022-2024, Arm Limited. All rights reserved.*
diff --git a/docs/examples/example_partition.rst b/docs/examples/example_partition.rst
index b423b87..59fa27e 100644
--- a/docs/examples/example_partition.rst
+++ b/docs/examples/example_partition.rst
@@ -87,6 +87,33 @@
 
 Refer to `Out-of-tree Secure Partition build`_ for more details.
 
+**********************************************
+Build steps for mps4/corstone315 platform
+**********************************************
+1. Build and install TF-M with the following command:
+
+.. code-block:: bash
+
+ $ cmake -S <TF-M Source Dir> \
+         -B build/spe_test \
+         -DTFM_PLATFORM=arm/mps4/corstone315 \
+         -DTFM_TOOLCHAIN_FILE=<TF-M Source Dir>/toolchain_<toolchain>.cmake \
+         -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON \
+         -DTFM_PARTITION_CRYPTO=ON \
+         -DTEST_NS=ON
+         -DTEST_S=ON \
+ $ cmake --build build/spe_test -- -j$(nproc) install
+
+2. Then build the example with the following:
+
+.. code-block:: bash
+
+ $ cmake -S <this_example_path> \
+         -B build/nspe_test \
+         -DTFM_TOOLCHAIN=<toolchain> \
+         -DCONFIG_SPE_PATH=$(shell pwd)/<build_dir>/spe_test/api_ns
+ $ cmake --build build/nspe_test -- -j$(nproc)
+
 ***********
 How to Test
 ***********
@@ -141,4 +168,4 @@
 
 --------------
 
-*Copyright (c) 2020-2022, Arm Limited. All rights reserved.*
+*Copyright (c) 2020-2024, Arm Limited. All rights reserved.*
diff --git a/docs/index.rst b/docs/index.rst
index 4196589..9176967 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -24,6 +24,44 @@
 - `partitions`: This folder hosts the supplementary or third-party secure
   partitions for TF-M.
 
+*****************
+Building examples
+*****************
+
+Folders represented in the example:
+
+.. code-block:: bash
+
+   <TF-M Source Dir>                Full path to TF-M Source directory/repository
+   └── <toolchain-file-from-tf-m>
+   <build-dir>                      Common build directory
+   ├── spe                          Secure side build directory
+   │   └── api_ns                   Non-Secure API callables directory
+   └── nspe                         Non-Secure side build directory
+
+1. Building the Secure side (comes from TF-M):
+
+.. code-block:: bash
+
+ $ cmake -S <TF-M Source Dir> \
+         -B <build-dir>/spe \
+         -DTFM_PLATFORM=<tf-m-target> \
+         -DTFM_TOOLCHAIN_FILE=<toolchain-file-from-tf-m> \
+         -DCMAKE_BUILD_TYPE=<Debug,Release>
+ $ cmake --build <build-dir>/spe -- -j$(nproc) install
+
+2. Build the Non-Secure side (from examples found here):
+
+.. code-block:: bash
+
+ $ cmake -S <example-path> \
+         -B <build-dir> \
+         -DCONFIG_SPE_PATH=<build-dir>/spe/api_ns
+ $ cmake --build <build-dir> -- -j$(nproc)
+
+Some examples use different flags in Secure and Non-Secure side.
+Check the examples description for further steps on proper building.
+
 *****************************
 Contribute to this repository
 *****************************
@@ -96,4 +134,4 @@
 
 --------------
 
-*Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
+*Copyright (c) 2021-2024, Arm Limited. All rights reserved.*