blob: bea6bdac9724d26546c1cde9507e2f0e3e34d2ea [file] [log] [blame]
Gyorgy Szingdb9783c2019-04-17 21:08:48 +02001##############################
2Trusted Firmware M secure boot
3##############################
4For secure devices it is security critical to enforce firmware authenticity to
5protect against execution of malicious software. This is implemented by building
6a trust chain where each step in the execution chain authenticates the next
7step before execution. The chain of trust in based on a "Root of Trust" which
8is implemented using asymmetric cryptography. The Root of Trust is a combination
9of an immutable bootloader and a public key (ROTPK).
10
11*******************************
12Second stage bootloader in TF-M
13*******************************
14To implement secure boot functionality an external project MCUBoot has been
15integrated to TF-M. For further information please refer to the
David Vincze8a2a4e22019-05-24 10:14:23 +020016`MCUBoot homepage <https://www.mcuboot.com/>`__. Original source-code is
17available at `GitHub <https://github.com/JuulLabs-OSS/mcuboot>`__. This document
18contains information about MCUBoot modifications and how MCUBoot has been
19integrated to TF-M.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020020
21Bootloader is started when CPU is released from reset. It runs in secure mode.
22It authenticates the firmware image by hash (SHA-256) and digital signature
Tamas Ban7801ed42019-05-20 13:21:53 +010023(RSA-3072) validation. Public key, that the checks happens against, is built
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020024into the bootloader image. Metadata of the image is delivered together with the
25image itself in a header and trailer section. In case of successful
26authentication, bootloader passes execution to the secure image. Execution never
27returns to bootloader until next reset.
28
29A default RSA key pair is stored in the repository, public key is in ``keys.c``
Tamas Ban7801ed42019-05-20 13:21:53 +010030and private key is in ``root-rsa-3072.pem``.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020031
David Vincze8a2a4e22019-05-24 10:14:23 +020032.. Warning::
33 DO NOT use them in production code, they are exclusively for testing!
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020034
35Private key must be stored in a safe place outside of the repository.
36``Imgtool.py`` can be used to generate new key pairs.
37
38The bootloader handles the secure and non-secure images as a single blob which
39is contiguous in the device memory. At compile time these images are
Tamas Ban7801ed42019-05-20 13:21:53 +010040concatenated and signed with RSA-3072 digital signature. Preparation of payload
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020041is done by Python scripts: ``bl2/ext/mcuboot/scripts/``. At the end of a
David Vincze8a2a4e22019-05-24 10:14:23 +020042successful build signed TF-M payload can be found in:
43``<build_dir>/install/outputs/fvp/tfm_sign.bin``
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020044
45*********************
46Integration with TF-M
47*********************
48MCUBoot assumes a predefined memory layout which is described below (applicable
David Vincze8a2a4e22019-05-24 10:14:23 +020049for AN521). It is mandatory to define slot 0 and slot 1 partitions, but their
50size can be changed::
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020051
52 - 0x0000_0000 - 0x0007_FFFF: BL2 bootloader - MCUBoot
53 - 0x0008_0000 - 0x000F_FFFF: Slot 0 : Single binary blob: Secure + Non-Secure
54 image; Primary memory partition
55 - 0x0008_0000 - 0x0008_03FF: Common image header
56 - 0x0008_0400 - 0x0008_xxxx: Secure image
57 - 0x0008_xxxx - 0x0010_03FF: Padding (with 0xFF)
58 - 0x0010_0400 - 0x0010_xxxx: Non-secure image
59 - 0x0010_xxxx - 0x0010_xxxx: Hash value(SHA256) and RSA signature
60 of combined image
David Vincze8a2a4e22019-05-24 10:14:23 +020061
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020062 - 0x0018_0000 - 0x0027_FFFF: Slot 1 : Secure + Non-Secure image; Secondary
63 memory partition, structured identically to slot
64 0
David Vincze8a2a4e22019-05-24 10:14:23 +020065 - 0x0028_0000 - 0x0037_FFFF: Scratch area, only used during image swapping
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020066
67**************************
68Firmware upgrade operation
69**************************
70MCUBoot handles only the firmware authenticity check after start-up and the
71firmware switch part of the firmware update process. Downloading the new version
David Vincze8a2a4e22019-05-24 10:14:23 +020072of the firmware is out-of-scope for MCUBoot. MCUBoot supports three different
73ways to switch to the new firmware and it is assumed that firmware images are
74executed-in-place (XIP). The default behaviour is the overwrite-based image
75upgrade. In this case the active firmware is always executed from slot 0 and
76slot 1 is a staging area for new images. Before executing the new firmware
77image, the content of slot 0 must be overwritten with the content of slot 1
78(the new firmware image). The second option is the image swapping strategy when
79the content of the two memory slots must be physically swapped. This needs the
80scratch area to be defined in the memory layout. The third option is the
81non-swapping version, which eliminates the complexity of image swapping and its
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020082administration. Active image can be executed from either memory slot, but new
83firmware must be linked to the address space of the proper (currently inactive)
84memory slot.
85
David Vincze8a2a4e22019-05-24 10:14:23 +020086Overwrite operation
Tamas Bane7efdc62019-06-05 13:14:52 +010087===================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020088Active image is stored in slot 0, and this image is started always by the
David Vincze8a2a4e22019-05-24 10:14:23 +020089bootloader. Therefore images must be linked to slot 0. If the bootloader finds
90a valid image in slot 1, which is marked for upgrade, then the content of slot 0
91will be simply overwritten with the content of slot 1, before starting the new
92image from slot 0. After the content of slot 0 has been successfully
93overwritten, the header and trailer of the new image in slot 1 is erased to
94prevent the triggering of another unncessary image uprade after a restart. The
95overwrite operation is fail-safe and resistant to power-cut failures. For more
96details please refer to the MCUBoot
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020097`documentation <https://www.mcuboot.com/mcuboot/design.html>`__.
98
David Vincze8a2a4e22019-05-24 10:14:23 +020099Swapping operation
100==================
101This operation can be set with the ``MCUBOOT_UPGRADE_STRATEGY`` compile time
102switch (see `Build time configuration`_). With swapping image upgrade strategy
103the active image is also stored in slot 0 and it will always be started by the
104bootloader. If the bootloader finds a valid image in slot 1, which is marked for
105upgrade, then contents of slot 0 and slot 1 will be swapped, before starting the
106new image from slot 0. Scratch area is used as a temporary storage place during
107image swapping. Update mark from slot 1 is removed when the swapping is
108successful. The boot loader can revert the swapping as a fall-back mechanism to
109recover the previous working firmware version after a faulty update. The swap
110operation is fail-safe and resistant to power-cut failures. For more details
111please refer to the MCUBoot
112`documentation <https://www.mcuboot.com/mcuboot/design.html>`__.
113
114.. Note::
115
116 After a successful image upgrade the firmware can mark itself as "OK" at
117 runtime by setting the image_ok flag in the flash. When this happens, the
118 swap is made "permanent" and MCUBoot will then still choose to run it
119 during the next boot. Currently TF-M does not set the image_ok flag,
120 therefore the bootloader will always perform a "revert" (swap the images
121 back) during the next boot.
122
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200123Non-swapping operation
124======================
David Vincze8a2a4e22019-05-24 10:14:23 +0200125This operation can be set with the ``MCUBOOT_UPGRADE_STRATEGY`` compile time
126switch (see `Build time configuration`_). When enabling non-swapping operation
127then the active image flag is moved between slots during firmware upgrade. If
128firmware is executed-in-place (XIP), then two firmware images must be generated.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200129One of them is linked to be executed from slot 0 memory region and the other
130from slot 1. The firmware upgrade client, which downloads the new image, must be
131aware, which slot hosts the active firmware and which acts as a staging area and
132it is responsible for downloading the proper firmware image. At boot time
133MCUBoot inspects the version number in the image header and passes execution to
134the newer firmware version. New image must be marked for upgrade which is
135automatically done by Python scripts at compile time. Image verification is done
David Vincze8a2a4e22019-05-24 10:14:23 +0200136the same way in all operational modes. If new image fails during authentication
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200137then MCUBoot erases the memory slot and starts the other image, after successful
138authentication.
139
140At build time automatically two binaries are generated::
141
Tamas Banbba85642019-06-06 09:31:59 +0100142 <build_dir>/install/outputs/fvp/tfm_s_ns_signed.bin : Image linked for slot 0 memory partition
David Vincze8a2a4e22019-05-24 10:14:23 +0200143
144 <build_dir>/install/outputs/fvp/tfm_s_ns_signed_1.bin : Image linked for slot 1 memory partition
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200145
146RAM Loading firmware upgrade
147============================
David Vincze8a2a4e22019-05-24 10:14:23 +0200148Musca-A supports an image upgrade mode that is separate to the other (overwrite,
149swapping and non-swapping) modes. This is the ``RAM loading`` mode (please refer
150to the table below). Like the non-swapping mode, this selects the newest image
151by reading the image version numbers in the image headers, but instead of
152executing it in place, the newest image is copied to RAM for execution. The load
153address, the location in RAM where the image is copied to, is stored in the
154image header.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200155
156Summary of different modes for image upgrade
157============================================
158Different implementations of the image upgrade operation (whether through
David Vincze8a2a4e22019-05-24 10:14:23 +0200159overwriting, swapping, non-swapping or loading into RAM and executing from
160there) are supported by the platforms. The table below shows which of these
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200161modes are supported by which platforms:
162
David Vincze8a2a4e22019-05-24 10:14:23 +0200163+----------+-----------------+----------------------------------------------------------+
164| | Without BL2 [1]_| With BL2 [2]_ |
165+==========+=================+===============+==========+=============+=================+
166| | XIP | XIP | XIP | XIP | Not XIP |
167+----------+-----------------+---------------+----------+-------------+-----------------+
168| | | Overwrite [3]_| Swap [4]_| No-swap [5]_| RAM loading [6]_|
169+----------+-----------------+---------------+----------+-------------+-----------------+
170| AN521 | Yes | Yes | Yes | Yes | No |
171+----------+-----------------+---------------+----------+-------------+-----------------+
172| AN519 | Yes | Yes | Yes | Yes | No |
173+----------+-----------------+---------------+----------+-------------+-----------------+
174| Musca-A | No | No | No | No | Yes |
175+----------+-----------------+---------------+----------+-------------+-----------------+
176| Musca-B1 | Yes | No | No | Yes | No |
177+----------+-----------------+---------------+----------+-------------+-----------------+
Kevin Peng0a142112018-09-21 10:42:22 +0800178| AN524 | Yes | No | No | Yes | No |
179+----------+-----------------+---------------+----------+-------------+-----------------+
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200180
181.. [1] To disable BL2, please turn off the ``BL2`` compiler switch in the
David Vincze8a2a4e22019-05-24 10:14:23 +0200182 top-level configuration file or in the command line
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200183
184.. [2] BL2 is enabled by default
185
David Vincze8a2a4e22019-05-24 10:14:23 +0200186.. [3] The image executes in-place (XIP) and is in Overwrite mode for image
187 update by default
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200188
David Vincze8a2a4e22019-05-24 10:14:23 +0200189.. [4] To enable XIP Swap mode, assign the "SWAP" string to the
190 ``MCUBOOT_UPGRADE_STRATEGY`` configuration variable in the top-level
191 configuration file, or include this macro definition in the command line
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200192
David Vincze8a2a4e22019-05-24 10:14:23 +0200193.. [5] To enable XIP No-swap, assign the "NO_SWAP" string to the
194 ``MCUBOOT_UPGRADE_STRATEGY`` configuration variable in the top-level
195 configuration file, or include this macro definition in the command line
196
197.. [6] To enable RAM loading, assign the "RAM_LOADING" string to the
198 ``MCUBOOT_UPGRADE_STRATEGY`` configuration variable in the top-level
199 configuration file, or include this macro definition in the command line
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200200
Tamas Ban7801ed42019-05-20 13:21:53 +0100201********************
202Signature algorithms
203********************
204MbedTLS library is used to sign the images. The list of supported signing
205algorithms:
Tamas Bane7efdc62019-06-05 13:14:52 +0100206
207 - `RSA-2048`
208 - `RSA-3072`: default
209
Tamas Ban7801ed42019-05-20 13:21:53 +0100210Example keys stored in ``root-rsa-2048.pem`` and ``root-rsa-3072.pem``.
211
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200212************************
213Build time configuration
214************************
215MCUBoot related compile time switches can be set in the high level build
David Vincze8a2a4e22019-05-24 10:14:23 +0200216configuration file::
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200217
David Vincze8a2a4e22019-05-24 10:14:23 +0200218 CommonConfig.cmake
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200219
220Compile time switches:
221
222- BL2 (default: True):
223 - **True:** TF-M built together with bootloader. MCUBoot is executed after
224 reset and it authenticates TF-M and starts secure code.
225 - **False:** TF-M built without bootloader. Secure image linked to the
226 beginning of the device memory and executed after reset. If it is false
227 then using any of the further compile time switches are invalid.
David Vincze8a2a4e22019-05-24 10:14:23 +0200228- MCUBOOT_UPGRADE_STRATEGY (default: "OVERWRITE_ONLY"):
229 - **"OVERWRITE_ONLY":** Default firmware upgrade operation with overwrite.
230 - **"SWAP":** Activate swapping firmware upgrade operation.
231 - **"NO_SWAP":** Activate non-swapping firmware upgrade operation.
232 - **"RAM_LOADING":** Activate RAM loading firmware upgrade operation, where
233 latest image is copied to RAM and runs from there instead of being
234 executed in-place.
Tamas Ban7801ed42019-05-20 13:21:53 +0100235- MCUBOOT_SIGNATURE_TYPE (default: RSA-3072):
236 - **RSA-3072** Image is signed with RSA-3072 algorithm
237 - **RSA-2048** Image is signed with RSA-2048 algorithm
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200238
239Image versioning
240================
241An image version number is written to its header by one of the python scripts,
David Vincze8a2a4e22019-05-24 10:14:23 +0200242and this number is used by the bootloader when the non-swapping or RAM loading
243mode is enabled.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200244
245The version number of the image can manually be passed in through the command
246line in the cmake configuration step::
247
248 cmake -G"Unix Makefiles" -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG -DIMAGE_VERSION=1.2.3+4 ../
249
250Alternatively, the version number can be less specific (e.g 1, 1.2, or 1.2.3),
251where the missing numbers are automatically set to zero. The image version
252number argument is optional, and if it is left out, then the version numbers of
253the image(s) being built in the same directory will automatically change. In
254this case, the last component (the build number) automatically increments from
255the previous one: 0.0.0+1 -> 0.0.0+2, for as many times as the build is re-ran,
256**until a number is explicitly provided**. If automatic versioning is in place
257and then an image version number is provided for the first time, the new number
258will take precedence and be used instead. All subsequent image versions are
259then set to the last number that has been specified, and the build number would
260stop incrementing. Any new version numbers that are provided will overwrite
261the previous one: 0.0.0+1 -> 0.0.0+2. Note: To re-apply automatic image
262versioning, please start a clean build without specifying the image version
263number at all.
264
David Vincze060968d2019-05-23 01:13:14 +0200265Security counter
266================
267Each signed image contains a security counter in its manifest. It is used by the
268bootloader and its aim is to have an independent (from the image version)
269counter to ensure rollback protection by comparing the new image's security
270counter against the original (currently active) image's security counter during
271the image upgrade process. It is added to the manifest (to the TLV area that is
272appended to the end of the image) by one of the python scripts when signing the
273image. The value of the security counter is security critical data and it is in
274the integrity protected part of the image. The last valid security counter is
275always stored in a non-volatile and trusted component of the device and its
276value should always be increased if a security flaw was fixed in the current
277image version. The value of the security counter can be specified at build time
278in the cmake configuration step::
279
280 cmake -G"Unix Makefiles" -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG -DSECURITY_COUNTER=42 ../
281
282The security counter can be independent from the image version, but not
283necessarily. Alternatively, if it is not specified at build time with the
284``SECURITY_COUNTER`` option the python script will automatically generate it
285from the image version number (not including the build number) and this value
286will be added to the signed image.
287
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200288************************
289Testing firmware upgrade
290************************
291As downloading the new firmware image is out of scope for MCUBoot, the update
292process is started from a state where the original and the new image are already
293programmed to the appropriate memory slots. To generate the original and a new
294firmware package, TF-M is built twice with different build configurations.
295
David Vincze8a2a4e22019-05-24 10:14:23 +0200296Overwriting firmware upgrade
Tamas Bane7efdc62019-06-05 13:14:52 +0100297============================
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200298Run TF-M build twice with two different build configuration: default and
David Vincze8a2a4e22019-05-24 10:14:23 +0200299regression. Save the artifacts between builds, because second run can overwrite
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200300original binaries. Download default build to slot 0 and regression build to
301slot 1.
302
303Executing firmware upgrade on FVP_MPS2_AEMv8M
304---------------------------------------------
305.. code-block:: bash
306
307 <DS5_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \
308 --parameter fvp_mps2.platform_type=2 \
309 --parameter cpu0.baseline=0 \
310 --parameter cpu0.INITVTOR_S=0x10000000 \
311 --parameter cpu0.semihosting-enable=0 \
312 --parameter fvp_mps2.DISABLE_GATING=0 \
313 --parameter fvp_mps2.telnetterminal0.start_telnet=1 \
314 --parameter fvp_mps2.telnetterminal1.start_telnet=0 \
315 --parameter fvp_mps2.telnetterminal2.start_telnet=0 \
316 --parameter fvp_mps2.telnetterminal0.quiet=0 \
317 --parameter fvp_mps2.telnetterminal1.quiet=1 \
318 --parameter fvp_mps2.telnetterminal2.quiet=1 \
319 --application cpu0=<build_dir>/bl2/ext/mcuboot/mcuboot.axf \
320 --data cpu0=<default_build_dir>/install/outputs/fvp/tfm_s_ns_signed.bin@0x10080000 \
321 --data cpu0=<regresssion_build_dir>/install/outputs/fvp/tfm_s_ns_signed.bin@0x10180000
322
323Executing firmware upgrade on SSE 200 FPGA on MPS2 board
324--------------------------------------------------------
325
326::
327
328 TITLE: Versatile Express Images Configuration File
329 [IMAGES]
330 TOTALIMAGES: 3 ;Number of Images (Max: 32)
331 IMAGE0ADDRESS: 0x00000000
332 IMAGE0FILE: \Software\mcuboot.axf ; BL2 bootloader
333 IMAGE1ADDRESS: 0x10080000
David Vincze8a2a4e22019-05-24 10:14:23 +0200334 IMAGE1FILE: \Software\tfm_sig1.bin ; TF-M default test binary blob
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200335 IMAGE2ADDRESS: 0x10180000
336 IMAGE2FILE: \Software\tfm_sig2.bin ; TF-M regression test binary blob
337
David Vincze8a2a4e22019-05-24 10:14:23 +0200338The following message will be shown in case of successful firmware upgrade:
339
340::
341
342 [INF] Starting bootloader
343 [INF] Swap type: test
344 [INF] Image upgrade slot1 -> slot0
345 [INF] Erasing slot0
346 [INF] Copying slot 1 to slot 0: 0x100000 bytes
347 [INF] Bootloader chainload address offset: 0x80000
348 [INF] Jumping to the first image slot
349 [Sec Thread] Secure image initializing!
350
351 #### Execute test suites for the Secure area ####
352 Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
353 ...
354
355Swapping firmware upgrade
356=============================
357Follow the same instructions and platform related configurations as in case of
358overwriting build including these changes:
359
360- Set MCUBOOT\_SWAP compile time switch to true before build.
361
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200362The following message will be shown in case of successful firmware upgrade,
363``Swap type: test`` indicates that images were swapped:
364
365::
366
David Vincze8a2a4e22019-05-24 10:14:23 +0200367 [INF] Starting bootloader
368 [INF] Image 0: magic= good, copy_done=0x3, image_ok=0x3
369 [INF] Scratch: magic= bad, copy_done=0x0, image_ok=0x2
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200370 [INF] Boot source: slot 0
371 [INF] Swap type: test
372 [INF] Bootloader chainload address offset: 0x80000
373 [INF] Jumping to the first image slot
374 [Sec Thread] Secure image initializing!
375
David Vincze8a2a4e22019-05-24 10:14:23 +0200376 #### Execute test suites for the Secure area ####
377 Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
378 ...
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200379
380Non-swapping firmware upgrade
381=============================
David Vincze8a2a4e22019-05-24 10:14:23 +0200382Follow the same instructions as in case of overwriting build including these
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200383changes:
384
David Vincze8a2a4e22019-05-24 10:14:23 +0200385- Set the ``MCUBOOT_UPGRADE_STRATEGY`` compile time switch to "NO_SWAP"
386 before build.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200387- Increase the image version number between the two build run.
388
389Executing firmware upgrade on FVP_MPS2_AEMv8M
390---------------------------------------------
391
392.. code-block:: bash
393
394 <DS5_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \
395 --parameter fvp_mps2.platform_type=2 \
396 --parameter cpu0.baseline=0 \
397 --parameter cpu0.INITVTOR_S=0x10000000 \
398 --parameter cpu0.semihosting-enable=0 \
399 --parameter fvp_mps2.DISABLE_GATING=0 \
400 --parameter fvp_mps2.telnetterminal0.start_telnet=1 \
401 --parameter fvp_mps2.telnetterminal1.start_telnet=0 \
402 --parameter fvp_mps2.telnetterminal2.start_telnet=0 \
403 --parameter fvp_mps2.telnetterminal0.quiet=0 \
404 --parameter fvp_mps2.telnetterminal1.quiet=1 \
405 --parameter fvp_mps2.telnetterminal2.quiet=1 \
406 --application cpu0=<build_dir>/bl2/ext/mcuboot/mcuboot.axf \
Tamas Banbba85642019-06-06 09:31:59 +0100407 --data cpu0=<default_build_dir>/install/outputs/fvp/tfm_s_ns_signed.bin@0x10080000 \
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200408 --data cpu0=<regresssion_build_dir>/install/outputs/fvp/tfm_s_ns_signed_1.bin@0x10180000
409
410Executing firmware upgrade on SSE 200 FPGA on MPS2 board
411--------------------------------------------------------
412
413::
414
415 TITLE: Versatile Express Images Configuration File
416 [IMAGES]
417 TOTALIMAGES: 3 ;Number of Images (Max: 32)
418 IMAGE0ADDRESS: 0x00000000
419 IMAGE0FILE: \Software\mcuboot.axf ; BL2 bootloader
420 IMAGE1ADDRESS: 0x10080000
Tamas Banbba85642019-06-06 09:31:59 +0100421 IMAGE1FILE: \Software\tfm_sign.bin ; TF-M default test binary blob
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200422 IMAGE2ADDRESS: 0x10180000
423 IMAGE2FILE: \Software\tfm_sig1.bin ; TF-M regression test binary blob
424
425Executing firmware upgrade on Musca-B1 board
426--------------------------------------------
427After two images have been built, they can be concatenated to create the
428combined image using ``srec_cat``:
429
430- Linux::
David Vincze8a2a4e22019-05-24 10:14:23 +0200431
Tamas Banbba85642019-06-06 09:31:59 +0100432 srec_cat bl2/ext/mcuboot/mcuboot.bin -Binary -offset 0xA000000 tfm_sign.bin -Binary -offset 0xA020000 tfm_sign_1.bin -Binary -offset 0xA0E0000 -o tfm.hex -Intel
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200433
434- Windows::
David Vincze8a2a4e22019-05-24 10:14:23 +0200435
Tamas Banbba85642019-06-06 09:31:59 +0100436 srec_cat.exe bl2\ext\mcuboot\mcuboot.bin -Binary -offset 0xA000000 tfm_sign.bin -Binary -offset 0xA020000 tfm_sign_1.bin -Binary -offset 0xA0E0000 -o tfm.hex -Intel
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200437
438The following message will be shown in case of successful firmware upgrade,
439notice that image with higher version number (``version=1.2.3.5``) is executed:
440
441::
442
443 [INF] Starting bootloader
David Vincze8a2a4e22019-05-24 10:14:23 +0200444 [INF] Image 0: version=1.2.3.4, magic= good, image_ok=0x3
445 [INF] Image 1: version=1.2.3.5, magic= good, image_ok=0x3
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200446 [INF] Booting image from slot 1
David Vincze8a2a4e22019-05-24 10:14:23 +0200447 [INF] Bootloader chainload address offset: 0xa0000
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200448 [INF] Jumping to the first image slot
449 [Sec Thread] Secure image initializing!
450
David Vincze8a2a4e22019-05-24 10:14:23 +0200451 #### Execute test suites for the Secure area ####
452 Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
453 ...
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200454
Kevin Peng0a142112018-09-21 10:42:22 +0800455Executing firmware upgrade on CoreLink SSE-200 Subsystem for MPS3 (AN524)
456-------------------------------------------------------------------------
457
458::
459
460 TITLE: Arm MPS3 FPGA prototyping board Images Configuration File
461
462 [IMAGES]
463 TOTALIMAGES: 3 ;Number of Images (Max: 32)
464
465 IMAGE0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE
466 IMAGE0ADDRESS: 0x00000000
467 IMAGE0FILE: \SOFTWARE\mcuboot.bin ;BL2 bootloader
468 IMAGE1UPDATE: AUTO
469 IMAGE1ADDRESS: 0x00040000
470 IMAGE1FILE: \SOFTWARE\tfm_sig0.bin ;TF-M example application binary blob
471 IMAGE2UPDATE: AUTO
472 IMAGE2ADDRESS: 0x000C0000
473 IMAGE2FILE: \SOFTWARE\tfm_sig1.bin ;TF-M regression test binary blob
474
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200475RAM loading firmware upgrade
476============================
David Vincze8a2a4e22019-05-24 10:14:23 +0200477To enable RAM loading, please set ``MCUBOOT_UPGRADE_STRATEGY`` to "RAM_LOADING"
478(either in the configuration file or through the command line), and then specify
479a destination load address in RAM where the image can be copied to and executed
480from. The ``IMAGE_LOAD_ADDRESS`` macro must be specified in the target dependent
481files, for example with Musca-A, its ``flash_layout.h`` file in the ``platform``
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200482folder should include ``#define IMAGE_LOAD_ADDRESS #0x10020000``
483
David Vincze8a2a4e22019-05-24 10:14:23 +0200484Executing firmware upgrade on Musca-A board
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200485--------------------------------------------
486After two images have been built, they can be concatenated to create the
487combined image using ``srec_cat``:
488
David Vincze8a2a4e22019-05-24 10:14:23 +0200489- Linux::
490
491 srec_cat bl2/ext/mcuboot/mcuboot.bin -Binary -offset 0x200000 tfm_sign_old.bin -Binary -offset 0x220000 tfm_sign_new.bin -Binary -offset 0x320000 -o tfm.hex -Intel
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200492
493- Windows::
David Vincze8a2a4e22019-05-24 10:14:23 +0200494
495 srec_cat.exe bl2\ext\mcuboot\mcuboot.bin -Binary -offset 0x200000 tfm_sign_old.bin-Binary -offset 0x220000 tfm_sign_new.bin -Binary -offset 0x320000 -o tfm.hex -Intel
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200496
497The following message will be shown in case of successful firmware upgrade when,
498RAM loading is enabled, notice that image with higher version number
499(``version=0.0.0.2``) is executed:
500
501::
502
David Vincze8a2a4e22019-05-24 10:14:23 +0200503 [INF] Starting bootloader
504 [INF] Image 0: version=0.0.0.1, magic= good, image_ok=0x3
505 [INF] Image 1: version=0.0.0.2, magic= good, image_ok=0x3
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200506 [INF] Image has been copied from slot 1 in flash to SRAM address 0x10020000
507 [INF] Booting image from SRAM at address 0x10020000
508 [INF] Bootloader chainload address offset: 0x20000
509 [INF] Jumping to the first image slot
510 [Sec Thread] Secure image initializing!
511
512--------------
513
514*Copyright (c) 2018-2019, Arm Limited. All rights reserved.*