Skip to content

Commit b3b4906

Browse files
nicola-mazzucato-armtomi-font
authored andcommitted
docs: rp2350: Minor docs & script improvements
- Adjust minor punctuations, add a couple of notes, - Remove 2 links causing documentation build failure. Plan to bring it back after the Intersphinx investigation. - Fix the pico_uf2 script. Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com> Change-Id: I670d09312708c3df6686ae3805924c24bab7569d
1 parent f513f2d commit b3b4906

File tree

3 files changed

+51
-36
lines changed

3 files changed

+51
-36
lines changed

docs/platform/arm/rse/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Previously known as Runtime Security Subsystem (RSS).
1616

1717
RSE also includes the following extra partitions:
1818

19-
- :doc:`Authenticated Debug Access Control (ADAC) <TF-M-Extras:partitions/adac/index>`
19+
- Authenticated Debug Access Control (ADAC)
2020
- :doc:`Measured boot partition <TF-M-Extras:partitions/measured_boot_integration_guide>`
2121
- :doc:`Delegated attestation partition<TF-M-Extras:partitions/delegated_attestation/delegated_attest_integration_guide>`
22-
- :doc:`DICE Protection Environment partition <TF-M-Extras:partitions/dice_protection_environment>`
22+
- DICE Protection Environment partition
2323

2424
--------------
2525

docs/platform/rpi/rp2350/readme.rst

+46-31
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ with Isolation Level 1 and 2.
1616

1717
Only GNU toolchain is supported.
1818

19+
.. note::
20+
21+
Only "profile_medium" predefined profile is supported.
22+
1923
Building TF-M
2024
-------------
2125

@@ -29,9 +33,9 @@ Build instructions with platform name: rpi/rp2350
2933
.. note::
3034

3135
This platform port relies on
32-
`Raspberry Pi Pico SDK <https://github.com/raspberrypi/pico-sdk>`__
36+
`Raspberry Pi Pico SDK <https://github.com/raspberrypi/pico-sdk>`__.
3337
Make sure it is either cloned locally or available to download during build.
34-
SDK version used for testing: SDK 2.0.0 release
38+
SDK version used for testing: SDK 2.0.0 release.
3539

3640
.. note::
3741

@@ -45,7 +49,7 @@ Build instructions with platform name: rpi/rp2350
4549

4650
If ``-DPLATFORM_DEFAULT_PROVISIONING=OFF`` and
4751
``-DTFM_DUMMY_PROVISIONING=ON`` then the keys in the
48-
``tf-m/platform/ext/common/provisioning_bundle/provisioning_config.cmake``
52+
``<TF-M source dir>/platform/ext/common/provisioning_bundle/provisioning_config.cmake``
4953
and the default MCUBoot signing keys will be used for provisioning.
5054

5155
If ``-DPLATFORM_DEFAULT_PROVISIONING=OFF`` and
@@ -54,7 +58,7 @@ Build instructions with platform name: rpi/rp2350
5458
the build command, or by setting the ``-DPROVISIONING_KEYS_CONFIG`` flag to a
5559
.cmake file that contains the keys. An example config cmake file can be seen
5660
at
57-
``tf-m/platform/ext/common/provisioning_bundle/provisioning_config.cmake``.
61+
``<TF-M source dir>/platform/ext/common/provisioning_bundle/provisioning_config.cmake``.
5862
Otherwise new random values are going to be generated and used. For the image
5963
signing the ${MCUBOOT_KEY_S} and ${MCUBOOT_KEY_NS} will be used. These
6064
variables should point to .pem files that contain the code signing private
@@ -69,68 +73,79 @@ Build instructions with platform name: rpi/rp2350
6973
The new generated keypair can be found in the ``<build dir>/bin`` folder or
7074
in the ``<install directory>/image_signing/keys`` after installation.
7175
The generated provisioning_data.c file can be found at
72-
``<build directory>/platform/target/provisioning/provisioning_data.c``
76+
``<build dir>/platform/target/provisioning/provisioning_data.c``
7377

7478
.. note::
7579

76-
The provisioning bundle generation depends on pyelftools that's have to be
77-
installed::
80+
The provisioning bundle generation depends on pyelftools that needs to be
81+
installed via::
7882

7983
pip3 install pyelftools
8084

81-
Example build instructions for regression tests with dummy keys:
82-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85+
Example of build instructions for regression tests with dummy keys:
86+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8387
Building Secure side with provisioning bundle:
8488

8589
.. note::
8690

87-
Add -DTFM_MULTI_CORE_TOPOLOGY=ON to the above for multicore support
91+
Add optionally:
8892

93+
- -DTFM_MULTI_CORE_TOPOLOGY=ON for multicore support
94+
- -DPICO_SDK_PATH=<abs-path-to-pico-sdk> for a pre-fetched Pico SDK
8995

9096
.. code-block:: bash
9197
92-
cmake -S <TF-M tests source dir>/tests_reg/spe \
93-
-B <TF-M tests source dir>/tests_reg/spe/build_rpi_myns_single \
98+
cmake -S <TF-M-tests source dir>/tests_reg/spe \
99+
-B <TF-M-tests source dir>/tests_reg/spe/build_rpi_single \
94100
-DTFM_PLATFORM=rpi/rp2350 \
95101
-DTFM_TOOLCHAIN_FILE=<TF-M source dir>/toolchain_GNUARM.cmake \
96102
-DCONFIG_TFM_SOURCE_PATH=<TF-M source dir> \
97-
-DTFM_PROFILE=profile_medium -DPLATFORM_DEFAULT_PROVISIONING=OFF \
98-
-DTEST_S=ON -DTEST_NS=ON
103+
-DTFM_PROFILE=profile_medium \
104+
-DPLATFORM_DEFAULT_PROVISIONING=OFF \
105+
-DTEST_S=ON \
106+
-DTEST_NS=ON
99107
100108
.. code-block:: bash
101109
102-
cmake --build <TF-M tests source dir>/tests_reg/spe/build_rpi_myns_single \
110+
cmake --build <TF-M-tests source dir>/tests_reg/spe/build_rpi_single \
103111
-- -j8 install
104112
105113
106114
Building Non-Secure side:
107115

108116
.. code-block:: bash
109117
110-
cmake -S <TF-M tests source dir>/tests_reg \
111-
-B <TF-M tests source dir>/tests_reg/build_rpi_myns_single \
112-
-DCONFIG_SPE_PATH=<TF-M tests source dir>/tests_reg/spe/build_rpi_myns_single/api_ns \
113-
-DTFM_TOOLCHAIN_FILE=<TF-M tests source dir>/tests_reg/spe/build_rpi_myns_single/api_ns/cmake/toolchain_ns_GNUARM.cmake
114-
cmake --build <TF-M tests source dir>/tests_reg/build_rpi_myns_single -- -j8
118+
cmake -S <TF-M-tests source dir>/tests_reg \
119+
-B <TF-M-tests source dir>/tests_reg/build_rpi_single \
120+
-DCONFIG_SPE_PATH=<TF-M tests source dir>/tests_reg/spe/build_rpi_single/api_ns \
121+
-DTFM_TOOLCHAIN_FILE=<TF-M-tests source dir>/tests_reg/spe/build_rpi_single/api_ns/cmake/toolchain_ns_GNUARM.cmake
122+
123+
.. code-block:: bash
124+
125+
cmake --build <TF-M-tests source dir>/tests_reg/build_rpi_single -- -j8
115126
116-
Binaries need to be converted with a small script pico_uf2.sh
117-
It uses uf2conv.py from here:
118-
https://github.com/microsoft/uf2/blob/master/utils/uf2conv.py
127+
Binaries need to be converted with a small script pico_uf2.sh.
128+
It requires uf2conv.py from here:
129+
https://github.com/microsoft/uf2/blob/master/utils/uf2conv.py.
119130
It depends on:
120-
https://github.com/microsoft/uf2/blob/master/utils/uf2families.json
131+
https://github.com/microsoft/uf2/blob/master/utils/uf2families.json.
132+
Both the above files need to be copied into the same place where pico_uf2.sh
133+
runs.
134+
Also, you may need to give executable permissions to both pico_uf2.sh and
135+
uf2conv.py.
121136
The tool takes the combined and signed S and NS images in .bin format, and
122-
outputs .uf2. It also generates the .uf2 for the bootloader (bl2.uf2) and the
123-
provisioning bundle.
137+
generates the corresponding .uf2 file. It also generates the .uf2 for the
138+
bootloader (bl2.uf2) and the provisioning bundle one.
124139

125140
.. code-block:: bash
126141
127-
pico_uf2.sh <TF-M tests source dir> build_rpi_myns_single
142+
pico_uf2.sh <TF-M-tests source dir> build_rpi_single
128143
129-
Then just copy the bl2.uf and tfm_s_ns_signed.bin.uf2 files to the board. It
130-
will run the BL2, S and NS tests and print the results to the UART (Baudrate
131-
115200).
144+
Then just copy (drag-and-drop) the bl2.uf2 and tfm_s_ns_signed.uf2 files into
145+
the board, one at time. It will run the BL2, S and NS tests and print the
146+
results to the UART (Baudrate 115200).
132147
If the board needs provisioning, the .uf2 file containing the provisioning
133-
bundle needs to be copied before tfm_s_ns_signed.bin.uf2. It only needs to be
148+
bundle needs to be copied before tfm_s_ns_signed.uf2. It only needs to be
134149
done once.
135150

136151
.. note::

platform/ext/target/rpi/pico_uf2.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ tfm_tests_dir=$1
33
build_dir=$2
44
spe_bin="${tfm_tests_dir}/tests_reg/spe/${build_dir}/bin"
55
ns_bin="${tfm_tests_dir}/tests_reg/${build_dir}/bin"
6-
uf2conv.py "${spe_bin}/bl2.bin" --base 0x10000000 --convert --output "${spe_bin}/bl2.uf2" --family 0xe48bff59
7-
uf2conv.py "${ns_bin}/../tfm_s_ns_signed.bin" --base 0x10011000 --convert --output "${spe_bin}/tfm_s_ns_signed.uf2" --family 0xe48bff59
8-
uf2conv.py "${spe_bin}/provisioning_bundle.bin" --base 0x1019F000 --convert --output "${spe_bin}/provisioning_bundle.uf2" --family 0xe48bff59
6+
python uf2conv.py "${spe_bin}/bl2.bin" --base 0x10000000 --convert --output "${spe_bin}/bl2.uf2" --family 0xe48bff59
7+
python uf2conv.py "${ns_bin}/../tfm_s_ns_signed.bin" --base 0x10011000 --convert --output "${spe_bin}/tfm_s_ns_signed.uf2" --family 0xe48bff59
8+
python uf2conv.py "${spe_bin}/provisioning_bundle.bin" --base 0x1019F000 --convert --output "${spe_bin}/provisioning_bundle.uf2" --family 0xe48bff59

0 commit comments

Comments
 (0)