Corstone SSE-310 with Ethos-U55/U65 Example Subsystem for Arm Virtual Hardware, and for MPS3 (AN555)
Introduction
Corstone-310 (formerly Corstone-Polaris) is an Arm reference subsystem for secure System on Chips containing an Armv8.1-M Cortex-M85 processor and an Ethos-U55/U65 neural network processor. It is an MPS3 based platform with the usual MPS3 peripherals.
This platform port supports all TF-M regression tests (Secure and Non-secure) with Isolation Level 1 and 2.
Note
This platform support does not provide software for Ethos-U55/U65 IP, only contains base address and interrupt number for it.
Note
For Armclang compiler v6.18 or later version is required.
Building TF-M
Follow the instructions in Building instructions.
For Corstone-310 Ethos-U55/U65 Arm Virtual Hardware use the following platform name:
-DTFM_PLATFORM=arm/mps3/corstone310/fvp
Note
The built binaries can be run on the Corstone-310 Arm Virtual Hardware (VHT_Corstone_SSE-310). At least VHT version 11.17 is required.
For AN555 use the following platform name:
-DTFM_PLATFORM=arm/mps3/corstone310/an555
Note
Provisioning bundles can be generated with the -DPLATFORM_DEFAULT_PROVISIONING=OFF
flag. The provisioning bundle binary will be generated and it’s going to contain the
provisioning code and provisioning values.
Note
If -DPLATFORM_DEFAULT_PROVISIONING=OFF
and -DTFM_DUMMY_PROVISIONING=OFF
are set
then unique values can be used for provisioning. The ${MCUBOOT_KEY_S} and ${MCUBOOT_KEY_NS}
will be used for signing and provisioning so any unique private signing key can be used.
If -DMCUBOOT_GENERATE_SIGNING_KEYPAIR=ON
is set then a new mcuboot signing public and private
keypair is going to be generated and it’s going to be used to sign the S and NS binaries.
The hash of the public key is going to be written into the provisioning_data.c
automatically.
The other keys and seeds can be changed by passing the new values to the build command,
otherwise the default values going to be used:
tf-m/platform/ext/target/arm/mps3/an552/provisioning/provisioning_config.cmake
Optionally it’s possible to pass a new config file with the -DPROVISIONING_KEYS_CONFIG
flag.
The new generated keypair can be found in the <build dir>/bin
folder or in the
<install directory>/image_signing/keys
after installation.
The generated provisioning_data.c file can be found at
<build directory>/platform/target/provisioning/provisioning_data.c
Note
The provisioning bundle generation depends on pyelftools that’s have to be installed:
pip3 install pyelftools
To run the example code on Corstone-310 Ethos-U55/U65 Arm Virtual Hardware
To utilize the Arm Virtual Hardware (AVH), you will need to create an AWS Account if you don’t already have one.
Launching the instance in EC2 (AWS on getting started) 1. Go to EC2 in the AWS Web Console. 2. Select Launch Instances which will take you to a wizard for launching the instance.
Choose an Amazon Machine Image (AMI) In the Search box, type Arm Virtual Hardware then find the item called “Arm Virtual Hardware” that is by Arm, and press Select for that item. This will raise a subscription page/pop-up titled, Arm Virtual Hardware. You will note that the subscription is free from Arm, but AWS does charge for the costs of the instances themselves according to the pricing chart provided.
You must select Continue if you want to move forward.
Choose an Instance Type - Select one of the instance types from the list. Keep in mind that there are charges that accrue while the instance is running. From here you may select Review and Launch to move directly to the launch page or select Next: Configure Instance Details if you need to set any custom settings for this instance.
Once you complete the wizard by initiating the instance launch you will see a page that allows you to navigate directly to the new instance. You may click this link or go back to your list of instances and find the instance through that method.
Whichever way you choose find your new instance and select its instance ID to open the page to manage the instance.
- Connecting to the instance:
Select Connect to open an SSH terminal session to the instance in your browser.
Ensure the User name field is set to ubuntu.
Select the Connect button to open the session. This will put you in a browser window where you will have an SSH terminal window ready for your input.
The TF-M can be cloned and built in the instance after connecting. To run the built binaries:
Execute the following command to start VHT:
$ VHT_Corstone_SSE-310 -a cpu0*="<path-to-build-directory>/bl2.axf" --data "<path-to-build-directory>/tfm_s_ns_signed.bin"@0x38000000
The serial port’s output can be redirected to a file with:
$ VHT_Corstone_SSE-310 -a cpu0*="<path-to-build-directory>/bl2.axf" --data "<path-to-build-directory>/tfm_s_ns_signed.bin"@0x38000000 -C mps3_board.uart0.unbuffered_output=1 -C mps3_board.uart0.out_file="output.log"
The output should contain the following messages:
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. [INF] Starting bootloader [INF] Beginning BL2 provisioning [INF] Swap type: none [INF] Swap type: none [INF] Bootloader chainload address offset: 0x40000 [INF] Jumping to the first image slot [INF] Beginning TF-M provisioning [Sec Thread] Secure image initializing! TF-M isolation level is:0x00000001 Booting TF-M v1.6.0 Creating an empty ITS flash layout. Creating an empty PS flash layout. Non-Secure system starting...
Note
Some of the messages above are only visible when CMAKE_BUILD_TYPE
is set
to Debug
.
Note
If -DPLATFORM_DEFAULT_PROVISIONING=OFF
is set then the provisioning bundle has to
be placed on the 0x10022000
address with:
$ VHT_Corstone_SSE-310 -a cpu0*="<path-to-build-directory>/bl2.axf" --data "<path-to-build-directory>/tfm_s_ns_signed.bin"@0x38000000 -C mps3_board.uart0.unbuffered_output=1 -C mps3_board.uart0.out_file="output.log" --data "encrypted_provisioning_bundle.bin"@0x10022000
To run the example code on AN555
FPGA image is available for download from here
If the link above is not working just go to Arm PDH and search for AN555.
To run BL2 bootloader, TF-M example application and tests in the MPS3 board,
it is required to have AN555 image in the MPS3 board SD card. The image should
be located in <MPS3 device name>/MB/HBI<BoardNumberBoardrevision>/AN555
The MPS3 board tested is HBI0309C.
Execute the following command to create the tfm.bin binary which fills the entire available space on the MPS3 onboard QSPI. This way the whole flash content (PS, ITS, OTP, NV counters) is in a known state. (If anything left in the QSPI, this binary will overwrite it.) Also, MPS3 can only handle SFN 8.3 format, so the binary name must be shortened.:
$ cd <build dir>/bin $ cp tfm_s_ns_signed.bin tfm.bin $ truncate -s 8M tfm.bin
Copy
bl2.bin
andtfm.bin
files from build dir to<MPS3 device name>/SOFTWARE/
Open
<MPS3 device name>/MB/HBI0309C/AN555/images.txt
Update the
images.txt
file as follows:[IMAGES] TOTALIMAGES: 2 IMAGE0ADDRESS: 0x01_00_1100_0000 IMAGE0UPDATE: RAM IMAGE0FILE: \SOFTWARE\bl2.bin IMAGE1ADDRESS: 0x01_00_0000_0000 IMAGE1UPDATE: FORCEQSPI IMAGE1FILE: \SOFTWARE\tfm.bin
Close
<MPS3 device name>/MB/HBI0309C/AN555/images.txt
Unmount/eject the
<MPS3 device name>
unitReset the board to execute the TF-M example application
After completing the procedure you should be able to see similar messages to this on the serial port (baud 115200 8n1):
[INF] Starting bootloader [INF] Beginning BL2 provisioning [WRN] TFM_DUMMY_PROVISIONING is not suitable for production! This device is NOT SECURE [INF] Swap type: none [INF] Swap type: none [INF] Bootloader chainload address offset: 0x0 [INF] Jumping to the first image slot [INF] Beginning TF-M provisioning [WRN] TFM_DUMMY_PROVISIONING is not suitable for production! This device is NOT SECURE [Sec Thread] Secure image initializing! TF-M isolation level is: 0x00000002 Booting TF-M <TF-M version and git hash> Creating an empty ITS flash layout. Creating an empty PS flash layout. [INF][Crypto] Provisioning entropy seed... complete. Non-Secure system starting...
Note
Some of the messages above are only visible when CMAKE_BUILD_TYPE
is set
to Debug
.
Note
If -DPLATFORM_DEFAULT_PROVISIONING=OFF
is set then the provisioning bundle has to
be placed on the 0x10022400
address.
Copyright (c) 2021-2023, Arm Limited. All rights reserved.