Galanakis, Minos | 41f8597 | 2019-09-30 15:56:40 +0100 | [diff] [blame] | 1 | ########## |
| 2 | User guide |
| 3 | ########## |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 4 | How to compile and run TF-M and example test application for CoreLink |
| 5 | SSE-200 subsystem on the MPS2 board and on the Fast Model(FVP). |
| 6 | |
| 7 | Follow :doc:`build instruction <tfm_build_instruction>` to build the binaries. |
| 8 | Follow :doc:`secure boot <tfm_secure_boot>` to build the binaries with or |
| 9 | without BL2 bootloader. |
| 10 | |
| 11 | **************************************************************** |
| 12 | Execute TF-M example and regression tests on MPS2 boards and FVP |
| 13 | **************************************************************** |
| 14 | The BL2 bootloader and TF-M example application and tests run correctly on |
| 15 | SMM-SSE-200 for MPS2 (AN521) and on the Fixed Virtual Platform model |
| 16 | FVP_MPS2_AEMv8M version 11.2.23. |
| 17 | |
| 18 | To run the example code on FVP_MPS2_AEMv8M |
| 19 | ========================================== |
| 20 | Using FVP_MPS2_AEMv8M provided by DS-5 v5.27.1. |
| 21 | |
| 22 | .. Note:: |
| 23 | FVP reference guide can be found |
| 24 | `here <https://developer.arm.com/docs/100966/latest>`__ |
| 25 | |
| 26 | Example application and regression tests without BL2 bootloader |
| 27 | --------------------------------------------------------------- |
| 28 | Add ``tfm_s.axf`` and ``tfm_ns.axf`` to symbol files in Debug Configuration |
| 29 | menu. |
| 30 | |
| 31 | .. code-block:: bash |
| 32 | |
| 33 | <DS5_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \ |
| 34 | --parameter fvp_mps2.platform_type=2 \ |
| 35 | --parameter cpu0.baseline=0 \ |
| 36 | --parameter cpu0.INITVTOR_S=0x10000000 \ |
| 37 | --parameter cpu0.semihosting-enable=0 \ |
| 38 | --parameter fvp_mps2.DISABLE_GATING=0 \ |
| 39 | --parameter fvp_mps2.telnetterminal0.start_telnet=1 \ |
| 40 | --parameter fvp_mps2.telnetterminal1.start_telnet=0 \ |
| 41 | --parameter fvp_mps2.telnetterminal2.start_telnet=0 \ |
| 42 | --parameter fvp_mps2.telnetterminal0.quiet=0 \ |
| 43 | --parameter fvp_mps2.telnetterminal1.quiet=1 \ |
| 44 | --parameter fvp_mps2.telnetterminal2.quiet=1 \ |
| 45 | --application cpu0=<build_dir>/install/outputs/fvp/tfm_s.axf \ |
| 46 | --data cpu0=<build_dir>/install/outputs/fvp/tfm_ns.bin@0x00100000 |
| 47 | |
| 48 | Example application and regression tests with BL2 bootloader |
| 49 | ------------------------------------------------------------ |
| 50 | To test TF-M with bootloader, one must apply the following changes: |
| 51 | |
| 52 | - Add ``mcuboot.axf`` to symbol files in DS-5 in Debug Configuration |
| 53 | menu. |
| 54 | - Replace the last two lines of the previous command with this: |
| 55 | |
| 56 | .. code-block:: bash |
| 57 | |
| 58 | --application cpu0=<build_dir>/install/outputs/fvp/mcuboot.axf \ |
| 59 | --data cpu0=<build_dir>/install/outputs/fvp/tfm_s_ns_signed.bin@0x10080000 |
| 60 | |
| 61 | Test software upgrade with BL2 bootloader |
| 62 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 63 | BL2 bootloader is mandatory to test software update. Furthermore two TF-M blob |
| 64 | must be built. Outputs of example application and regression test can be used to |
David Vincze | 8bdfc2d | 2019-03-18 15:49:23 +0100 | [diff] [blame] | 65 | test it. Load output of example application to the primary slot (0x10080000) and |
| 66 | output of regression test to the secondary slot (0x10180000). Add the following |
| 67 | line to the end of the previous chapter: |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 68 | |
| 69 | .. code-block:: bash |
| 70 | |
| 71 | --data cpu0=<build_dir>/install/outputs/fvp/tfm_s_ns_signed.bin@0x10180000 |
| 72 | |
| 73 | To run the example code on SSE 200 FPGA on MPS2 board |
| 74 | ===================================================== |
| 75 | FPGA image is available to download |
| 76 | `here <https://developer.arm.com/products/system-design/development-boards/cortex-m-prototyping-systems/mps2>`__ |
| 77 | |
| 78 | To run BL2 bootloader and TF-M example application and tests in the MPS2 board, |
| 79 | it is required to have SMM-SSE-200 for MPS2 (AN521) image in the MPS2 board SD |
| 80 | card. The image should be located in |
| 81 | ``<MPS2 device name>/MB/HBI0263<board revision letter>/AN521`` |
| 82 | |
| 83 | The MPS2 board tested is HBI0263C referred also as MPS2+. |
| 84 | |
| 85 | .. Warning:: |
| 86 | |
| 87 | If you change the exe names, MPS2 expects file names in 8.3 format. |
| 88 | |
| 89 | Example application |
| 90 | ------------------- |
| 91 | #. Copy ``mcuboot.bin`` and ``tfm_sign.bin`` files from |
| 92 | ``<build_dir>/install/outputs/AN521/`` to |
| 93 | ``<MPS2 device name>/SOFTWARE/`` |
| 94 | #. Open ``<MPS2 device name>/MB/HBI0263C/AN521/images.txt`` |
| 95 | #. Update the ``AN521/images.txt`` file as follows:: |
| 96 | |
| 97 | TITLE: Versatile Express Images Configuration File |
| 98 | [IMAGES] |
| 99 | TOTALIMAGES: 2 ;Number of Images (Max: 32) |
| 100 | IMAGE0ADDRESS: 0x10000000 |
| 101 | IMAGE0FILE: \Software\mcuboot.bin ; BL2 bootloader |
| 102 | IMAGE1ADDRESS: 0x10080000 |
| 103 | IMAGE1FILE: \Software\tfm_sign.bin ; TF-M example application binary blob |
| 104 | |
| 105 | #. Close ``<MPS2 device name>/MB/HBI0263C/AN521/images.txt`` |
| 106 | #. Unmount/eject the ``<MPS2 device name>`` unit |
| 107 | #. Reset the board to execute the TF-M example application |
| 108 | #. After completing the procedure you should be able to visualize on the serial |
| 109 | port (baud 115200 8n1) the following messages:: |
| 110 | |
| 111 | [INF] Starting bootloader |
| 112 | [INF] Image 0: magic=good, copy_done=0xff, image_ok=0xff |
| 113 | [INF] Scratch: magic=bad, copy_done=0x5, image_ok=0xcf |
David Vincze | 8bdfc2d | 2019-03-18 15:49:23 +0100 | [diff] [blame] | 114 | [INF] Boot source: primary slot |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 115 | [INF] Swap type: none |
| 116 | [INF] Bootloader chainload address offset: 0x80000 |
| 117 | [INF] Jumping to the first image slot |
| 118 | [Sec Thread] Secure image initializing! |
| 119 | |
| 120 | Regression tests |
| 121 | ---------------- |
| 122 | After completing the procedure you should be able to visualize on the serial |
| 123 | port (baud 115200 8n1) the following messages:: |
| 124 | |
| 125 | [INF] Starting bootloader |
| 126 | [INF] Image 0: magic=good, copy_done=0xff, image_ok=0xff |
| 127 | [INF] Scratch: magic=bad, copy_done=0x5, image_ok=0xcf |
David Vincze | 8bdfc2d | 2019-03-18 15:49:23 +0100 | [diff] [blame] | 128 | [INF] Boot source: primary slot |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 129 | [INF] Swap type: none |
| 130 | [INF] Bootloader chainload address offset: 0x80000 |
| 131 | [INF] Jumping to the first image slot |
| 132 | [Sec Thread] Secure image initializing! |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 133 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 134 | #### Execute test suites for the protected storage service #### |
| 135 | Running Test Suite PS secure interface tests (TFM_PS_TEST_2XXX)... |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 136 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 137 | > Executing 'TFM_PS_TEST_2001' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 138 | Description: 'Create interface' |
| 139 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 140 | > Executing 'TFM_PS_TEST_2002' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 141 | Description: 'Get handle interface (DEPRECATED)' |
| 142 | This test is DEPRECATED and the test execution was SKIPPED |
| 143 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 144 | > Executing 'TFM_PS_TEST_2003' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 145 | Description: 'Get handle with null handle pointer (DEPRECATED)' |
| 146 | This test is DEPRECATED and the test execution was SKIPPED |
| 147 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 148 | > Executing 'TFM_PS_TEST_2004' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 149 | Description: 'Write interface' |
| 150 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 151 | > Executing 'TFM_PS_TEST_2005' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 152 | Description: 'Read interface' |
| 153 | .... |
| 154 | |
| 155 | .. Note:: |
| 156 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 157 | PS reliability tests take a few minutes to run on the MPS2. |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 158 | |
| 159 | Example application without BL2 bootloader |
| 160 | ------------------------------------------ |
| 161 | #. Copy ``tfm_s.bin`` and ``tfm_ns.bin`` files from |
| 162 | ``<build_dir>/install/outputs/AN521/`` to |
| 163 | ``<MPS2 device name>/SOFTWARE/`` |
| 164 | #. Open ``<MPS2 device name>/MB/HBI0263C/AN521/images.txt`` |
| 165 | #. Update the ``AN521/images.txt`` file as follows:: |
| 166 | |
| 167 | TITLE: Versatile Express Images Configuration File |
| 168 | [IMAGES] |
| 169 | TOTALIMAGES: 2 ;Number of Images (Max: 32) |
| 170 | IMAGE0ADDRESS: 0x10000000 |
| 171 | IMAGE0FILE: \Software\tfm_s.bin ; Secure code |
| 172 | IMAGE1ADDRESS: 0x00100000 |
| 173 | IMAGE1FILE: \Software\tfm_ns.bin ; Non-secure code |
| 174 | |
| 175 | #. Close ``<MPS2 device name>/MB/HBI0263C/AN521/images.txt`` |
| 176 | #. Unmount/eject the ``<MPS2 device name>`` unit |
| 177 | #. Reset the board to execute the TF-M example application |
| 178 | #. After completing the procedure you should be able to visualize on the serial |
| 179 | port (baud 115200 8n1) the following messages:: |
| 180 | |
| 181 | [Sec Thread] Secure image initializing! |
| 182 | |
| 183 | Regression tests without BL2 bootloader |
| 184 | --------------------------------------- |
| 185 | After completing the procedure you should be able to visualize on the serial |
| 186 | port (baud 115200 8n1) the following messages:: |
| 187 | |
| 188 | [Sec Thread] Secure image initializing! |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 189 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 190 | #### Execute test suites for the protected storage service #### |
| 191 | Running Test Suite PS secure interface tests (TFM_PS_TEST_2XXX)... |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 192 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 193 | > Executing 'TFM_PS_TEST_2001' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 194 | Description: 'Create interface' |
| 195 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 196 | > Executing 'TFM_PS_TEST_2002' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 197 | Description: 'Get handle interface (DEPRECATED)' |
| 198 | This test is DEPRECATED and the test execution was SKIPPED |
| 199 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 200 | > Executing 'TFM_PS_TEST_2003' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 201 | Description: 'Get handle with null handle pointer (DEPRECATED)' |
| 202 | This test is DEPRECATED and the test execution was SKIPPED |
| 203 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 204 | > Executing 'TFM_PS_TEST_2004' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 205 | Description: 'Write interface' |
| 206 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 207 | > Executing 'TFM_PS_TEST_2005' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 208 | Description: 'Read interface' |
| 209 | .... |
| 210 | |
| 211 | ******************************************************************* |
| 212 | Execute TF-M example and regression tests on Musca test chip boards |
| 213 | ******************************************************************* |
| 214 | .. Note:: |
| 215 | |
| 216 | Before executing any images on Musca-B1 board, please check the |
| 217 | :doc:`target platform readme </platform/ext/target/musca_b1/readme>` |
| 218 | to have the correct setup. |
| 219 | |
| 220 | Example application with BL2 bootloader |
| 221 | ======================================= |
| 222 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 223 | #. Create a unified hex file comprising of both ``mcuboot.bin`` and |
| 224 | ``tfm_sign.bin``. |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 225 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 226 | - For Musca-A |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 227 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 228 | - Windows:: |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 229 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 230 | srec_cat.exe install\outputs\MUSCA_A\mcuboot.bin -Binary -offset 0x200000 install\outputs\MUSCA_A\tfm_sign.bin -Binary -offset 0x220000 -o tfm.hex -Intel |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 231 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 232 | - Linux:: |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 233 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 234 | srec_cat install/outputs/MUSCA_A/mcuboot.bin -Binary -offset 0x200000 install/outputs/MUSCA_A/tfm_sign.bin -Binary -offset 0x220000 -o tfm.hex -Intel |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 235 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 236 | - For Musca-B1 |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 237 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 238 | - Windows:: |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 239 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 240 | srec_cat.exe install\outputs\MUSCA_B1\mcuboot.bin -Binary -offset 0xA000000 install\outputs\MUSCA_B1\tfm_sign.bin -Binary -offset 0xA020000 -o tfm.hex -Intel |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 241 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 242 | - Linux:: |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 243 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 244 | srec_cat install/outputs/MUSCA_B1/mcuboot.bin -Binary -offset 0xA000000 install/outputs/MUSCA_B1/tfm_sign.bin -Binary -offset 0xA020000 -o tfm.hex -Intel |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 245 | |
Marton Berke | 8aae06f | 2019-11-25 16:46:12 +0100 | [diff] [blame] | 246 | - For Musca-S1 |
| 247 | |
| 248 | - Windows:: |
| 249 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 250 | srec_cat.exe install\outputs\MUSCA_S1\mcuboot.bin -Binary -offset 0xA000000 install\outputs\MUSCA_S1\tfm_sign.bin -Binary -offset 0xA020000 -o tfm.hex -Intel |
Marton Berke | 8aae06f | 2019-11-25 16:46:12 +0100 | [diff] [blame] | 251 | |
| 252 | - Linux:: |
| 253 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 254 | srec_cat install/outputs/MUSCA_S1/mcuboot.bin -Binary -offset 0xA000000 install/outputs/MUSCA_S1/tfm_sign.bin -Binary -offset 0xA020000 -o tfm.hex -Intel |
Marton Berke | 8aae06f | 2019-11-25 16:46:12 +0100 | [diff] [blame] | 255 | |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 256 | #. Power up the Musca board by connecting it to a computer with a USB lead. |
| 257 | Press the ``PBON`` button if the green ``ON`` LED does not immediately turn |
| 258 | on. The board should appear as a USB drive. |
| 259 | #. Copy ``tfm.hex`` to the USB drive. The orange ``PWR`` LED should start |
| 260 | blinking. |
| 261 | #. Once the ``PWR`` LED stops blinking, power cycle or reset the board to boot |
| 262 | from the new image. |
| 263 | #. After completing the procedure you should see the following messages on the |
| 264 | DAPLink UART (baud 115200 8n1):: |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 265 | |
| 266 | [INF] Starting bootloader |
| 267 | [INF] Image 0: magic=good, copy_done=0xff, image_ok=0xff |
| 268 | [INF] Scratch: magic=bad, copy_done=0x5, image_ok=0xd9 |
David Vincze | 8bdfc2d | 2019-03-18 15:49:23 +0100 | [diff] [blame] | 269 | [INF] Boot source: primary slot |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 270 | [INF] Swap type: none |
| 271 | [INF] Bootloader chainload address offset: 0x20000 |
| 272 | [INF] Jumping to the first image slot |
| 273 | [Sec Thread] Secure image initializing! |
| 274 | |
| 275 | Regression tests with BL2 bootloader |
| 276 | ==================================== |
| 277 | After completing the procedure you should see the following messages on the |
Jamie Fox | b5215c3 | 2019-06-05 17:39:39 +0100 | [diff] [blame] | 278 | DAPLink UART (baud 115200 8n1):: |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 279 | |
| 280 | [INF] Starting bootloader |
| 281 | [INF] Image 0: magic=good, copy_done=0xff, image_ok=0xff |
| 282 | [INF] Scratch: magic=bad, copy_done=0x5, image_ok=0x9 |
David Vincze | 8bdfc2d | 2019-03-18 15:49:23 +0100 | [diff] [blame] | 283 | [INF] Boot source: primary slot |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 284 | [INF] Swap type: none |
| 285 | [INF] Bootloader chainload address offset: 0x20000 |
| 286 | [INF] Jumping to the first image slot |
| 287 | [Sec Thread] Secure image initializing! |
Jamie Fox | b8a9270 | 2019-06-05 17:19:31 +0100 | [diff] [blame] | 288 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 289 | #### Execute test suites for the protected storage service #### |
| 290 | Running Test Suite PS secure interface tests (TFM_PS_TEST_2XXX)... |
| 291 | > Executing 'TFM_PS_TEST_2001' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 292 | Description: 'Create interface' |
| 293 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 294 | > Executing 'TFM_PS_TEST_2002' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 295 | Description: 'Get handle interface (DEPRECATED)' |
| 296 | This test is DEPRECATED and the test execution was SKIPPED |
| 297 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 298 | > Executing 'TFM_PS_TEST_2003' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 299 | Description: 'Get handle with null handle pointer (DEPRECATED)' |
| 300 | This test is DEPRECATED and the test execution was SKIPPED |
| 301 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 302 | > Executing 'TFM_PS_TEST_2004' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 303 | Description: 'Get attributes interface' |
| 304 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 305 | > Executing 'TFM_PS_TEST_2005' |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 306 | Description: 'Get attributes with null attributes struct pointer' |
| 307 | .... |
| 308 | |
| 309 | Example application or regression tests on Musca-B1 without BL2 bootloader |
| 310 | ========================================================================== |
| 311 | |
| 312 | Follow the above procedures, but create a unified hex file out of ``tfm_s.bin`` |
| 313 | and ``tfm_ns.bin``: |
| 314 | |
| 315 | - Windows:: |
| 316 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 317 | srec_cat.exe install\outputs\MUSCA_B1\tfm_s.bin -Binary -offset 0xA000000 install\outputs\MUSCA_B1\tfm_ns.bin -Binary -offset 0xA060000 -o tfm.hex -Intel |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 318 | |
| 319 | - Linux:: |
| 320 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 321 | srec_cat install/outputs/MUSCA_B1/tfm_s.bin -Binary -offset 0xA000000 install/outputs/MUSCA_B1/tfm_ns.bin -Binary -offset 0xA060000 -o tfm.hex -Intel |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 322 | |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 323 | ******************************************************** |
| 324 | Execute TF-M example and regression tests on MPS3 boards |
| 325 | ******************************************************** |
| 326 | |
| 327 | To run the example code on CoreLink SSE-200 Subsystem for MPS3 (AN524) |
| 328 | ====================================================================== |
| 329 | FPGA image is available to download `here <https://www.arm.com/products/development-tools/development-boards/mps3>`__ |
| 330 | |
| 331 | To run BL2 bootloader and TF-M example application and tests in the MPS3 board, |
| 332 | it is required to have SMM-SSE-200 for MPS3 (AN524) image in the MPS3 board |
| 333 | SD card. The image should be located in |
| 334 | ``<MPS3 device name>/MB/HBI<BoardNumberBoardrevision>/AN524`` |
| 335 | |
| 336 | And the current boot memory for AN524 is QSPI flash, so you need to set the |
| 337 | correct REMAP option in |
| 338 | ``<MPS3 device name>/MB/HBI<BoardNumberBoardrevision>/AN524/an524_v1.txt`` |
| 339 | |
| 340 | :: |
| 341 | |
| 342 | REMAP: QSPI ;REMAP boot device BRAM/QSPI. Must match REMAPVAL below. |
| 343 | REMAPVAL: 1 ;REMAP register value e.g. 0-BRAM. 1-QSPI |
| 344 | |
| 345 | The MPS3 board tested is HBI0309B. |
| 346 | |
| 347 | .. Note:: |
| 348 | If you change the exe names, MPS3 expects file names in 8.3 format. |
| 349 | |
| 350 | Example application |
| 351 | ------------------- |
| 352 | #. Copy ``mcuboot.bin`` and ``tfm_sign.bin`` files from |
| 353 | build dir to ``<MPS3 device name>/SOFTWARE/`` |
| 354 | #. Open ``<MPS3 device name>/MB/HBI0309B/AN524/images.txt`` |
| 355 | #. Update the ``images.txt`` file as follows:: |
| 356 | |
| 357 | TITLE: Arm MPS3 FPGA prototyping board Images Configuration File |
| 358 | |
| 359 | [IMAGES] |
| 360 | TOTALIMAGES: 2 ;Number of Images (Max: 32) |
| 361 | |
| 362 | IMAGE0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE |
| 363 | IMAGE0ADDRESS: 0x00000000 ;Please select the required executable program |
| 364 | IMAGE0FILE: \SOFTWARE\mcuboot.bin |
| 365 | IMAGE1UPDATE: AUTO |
| 366 | IMAGE1ADDRESS: 0x00040000 |
| 367 | IMAGE1FILE: \SOFTWARE\tfm_sign.bin |
| 368 | |
| 369 | #. Close ``<MPS3 device name>/MB/HBI0309B/AN524/images.txt`` |
| 370 | #. Unmount/eject the ``<MPS3 device name>`` unit |
| 371 | #. Reset the board to execute the TF-M example application |
| 372 | #. After completing the procedure you should be able to visualize on the serial |
| 373 | port (baud 115200 8n1) the following messages:: |
| 374 | |
| 375 | [INF] Starting bootloader |
| 376 | [INF] Image 0: magic= good, copy_done=0xff, image_ok=0xff |
| 377 | [INF] Scratch: magic=unset, copy_done=0x43, image_ok=0xff |
| 378 | [INF] Boot source: slot 0 |
| 379 | [INF] Swap type: none |
| 380 | [INF] Bootloader chainload address offset: 0x40000 |
| 381 | [INF] Jumping to the first image slot |
| 382 | [Sec Thread] Secure image initializing! |
| 383 | |
| 384 | Regression tests |
| 385 | ---------------- |
| 386 | After completing the procedure you should be able to visualize on the serial |
| 387 | port (baud 115200 8n1) the following messages:: |
| 388 | |
| 389 | [INF] Starting bootloader |
| 390 | [INF] Image 0: magic= good, copy_done=0xff, image_ok=0xff |
| 391 | [INF] Scratch: magic=unset, copy_done=0x9, image_ok=0xff |
| 392 | [INF] Boot source: slot 0 |
| 393 | [INF] Swap type: none |
| 394 | [INF] Bootloader chainload address offset: 0x40000 |
| 395 | [INF] Jumping to the first image slot |
| 396 | [Sec Thread] Secure image initializing! |
| 397 | |
| 398 | #### Execute test suites for the Secure area #### |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 399 | Running Test Suite PSA protected storage S interface tests (TFM_PS_TEST_2XXX)... |
| 400 | > Executing 'TFM_PS_TEST_2001' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 401 | Description: 'Set interface' |
| 402 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 403 | > Executing 'TFM_PS_TEST_2002' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 404 | Description: 'Set interface with create flags' |
| 405 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 406 | > Executing 'TFM_PS_TEST_2003' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 407 | Description: 'Set interface with NULL data pointer' |
| 408 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 409 | > Executing 'TFM_PS_TEST_2004' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 410 | Description: 'Set interface with invalid data length' |
| 411 | TEST PASSED! |
| 412 | .... |
| 413 | |
| 414 | .. Note:: |
| 415 | Some of the attestation tests take a few minutes to run on the MPS3. |
| 416 | |
| 417 | Example application without BL2 bootloader |
| 418 | ------------------------------------------ |
| 419 | #. Copy ``tfm_s.bin`` and ``tfm_ns.bin`` files from |
| 420 | build dir to ``<MPS3 device name>/SOFTWARE/`` |
| 421 | #. Open ``<MPS3 device name>/MB/HBI0309B/AN524/images.txt`` |
| 422 | #. Update the ``images.txt`` file as follows:: |
| 423 | |
| 424 | TITLE: Arm MPS3 FPGA prototyping board Images Configuration File |
| 425 | |
| 426 | [IMAGES] |
| 427 | TOTALIMAGES: 2 ;Number of Images (Max: 32) |
| 428 | |
| 429 | IMAGE0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE |
| 430 | IMAGE0ADDRESS: 0x00000000 ;Please select the required executable program |
| 431 | IMAGE0FILE: \SOFTWARE\tfm_s.bin |
| 432 | IMAGE1UPDATE: AUTO |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 433 | IMAGE1ADDRESS: 0x000C0000 |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 434 | IMAGE1FILE: \SOFTWARE\tfm_ns.bin |
| 435 | |
| 436 | #. Close ``<MPS3 device name>/MB/HBI0309B/AN521/images.txt`` |
| 437 | #. Unmount/eject the ``<MPS3 device name>`` unit |
| 438 | #. Reset the board to execute the TF-M example application |
| 439 | #. After completing the procedure you should be able to visualize on the serial |
| 440 | port (baud 115200 8n1) the following messages:: |
| 441 | |
| 442 | [Sec Thread] Secure image initializing! |
| 443 | |
| 444 | Regression tests without BL2 bootloader |
| 445 | --------------------------------------- |
| 446 | After completing the procedure you should be able to visualize on the serial |
| 447 | port (baud 115200 8n1) the following messages:: |
| 448 | |
| 449 | [Sec Thread] Secure image initializing! |
| 450 | |
| 451 | #### Execute test suites for the Secure area #### |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 452 | Running Test Suite PSA protected storage S interface tests (TFM_PS_TEST_2XXX)... |
| 453 | > Executing 'TFM_PS_TEST_2001' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 454 | Description: 'Set interface' |
| 455 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 456 | > Executing 'TFM_PS_TEST_2002' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 457 | Description: 'Set interface with create flags' |
| 458 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 459 | > Executing 'TFM_PS_TEST_2003' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 460 | Description: 'Set interface with NULL data pointer' |
| 461 | TEST PASSED! |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame^] | 462 | > Executing 'TFM_PS_TEST_2004' |
Kevin Peng | 0a14211 | 2018-09-21 10:42:22 +0800 | [diff] [blame] | 463 | Description: 'Set interface with invalid data length' |
| 464 | TEST PASSED! |
| 465 | .... |
| 466 | |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 467 | Firmware upgrade and image validation with BL2 bootloader |
| 468 | ========================================================= |
| 469 | High level operation of BL2 bootloader and instructions for testing firmware |
| 470 | upgrade is described in :doc:`secure boot <tfm_secure_boot>`. |
| 471 | |
| 472 | -------------- |
| 473 | |
Mingyang Sun | d3db85d | 2020-03-20 16:23:53 +0800 | [diff] [blame] | 474 | *Copyright (c) 2017-2020, Arm Limited. All rights reserved.* |