Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tf-m provisioning support to blinky example #10

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Projects/blinky/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ endif()
# Extra arguments for TF-M and ML
set(TFM_CMAKE_ARGS
-DPROJECT_CONFIG_HEADER_FILE=${PRJ_DIR}/Config/tfm-config/project_config.h
-DPLATFORM_DEFAULT_PROVISIONING=OFF
-DTFM_DUMMY_PROVISIONING=OFF
-DCONFIG_TFM_ENABLE_CP10CP11=ON
-DTFM_EXCEPTION_INFO_DUMP=ON
-DNS=ON;
Expand Down
40 changes: 24 additions & 16 deletions Tools/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,20 @@ do
esac
done


case "$1" in
blinky)
EXAMPLE="$1"
;;
aws-iot-example)
EXAMPLE="$1"
;;
*)
echo "Usage: $0 <blinky,aws-iot-example>" >&2
exit 1
;;
esac

case "$TARGET" in
corstone300 )
FVP_BIN="VHT_Corstone_SSE-300_Ethos-U55"
FVP_S_IMAGE_LOAD_ADDRESS=0x11000000
FVP_NS_IMAGE_LOAD_ADDRESS=0x01060000
FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x10022000
FVP_NS_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x210FF000
;;
corstone310 )
FVP_BIN="VHT_Corstone_SSE-310"
FVP_S_IMAGE_LOAD_ADDRESS=0x38000000
FVP_NS_IMAGE_LOAD_ADDRESS=0x28080000
FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x11022000
FVP_NS_PROVISIONING_BUNDLE_LOAD_ADDRESS=0x213FF000
;;
*)
echo "Invalid target <Ccorstone300|corstone310>"
Expand All @@ -84,8 +78,22 @@ case "$TARGET" in
;;
esac

set -x
case "$1" in
blinky)
EXAMPLE="$1"
FVP_IMAGE_OPTIONS="cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@$FVP_S_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Projects/$1/$1_signed.bin"@$FVP_NS_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Middleware/ARM/TF-M/tf-m-build-prefix/src/tf-m-build-build/install/outputs/encrypted_provisioning_bundle.bin"@$FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS"
;;
aws-iot-example)
EXAMPLE="$1"
FVP_IMAGE_OPTIONS="cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@$FVP_S_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Projects/$1/$1_signed.bin"@$FVP_NS_IMAGE_LOAD_ADDRESS --data "$BUILD_PATH/Projects/$EXAMPLE/provisioning_data/provisioning_data.bin"@$FVP_NS_PROVISIONING_BUNDLE_LOAD_ADDRESS --data "$BUILD_PATH/Middleware/ARM/TF-M/tf-m-build-prefix/src/tf-m-build-build/install/outputs/encrypted_provisioning_bundle.bin"@$FVP_S_PROVISIONING_BUNDLE_LOAD_ADDRESS"
;;
*)
echo "Usage: $0 <blinky,aws-iot-example>" >&2
exit 1
;;
esac

OPTIONS="-C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.smsc_91c111.enabled=1 -C mps3_board.hostbridge.userNetworking=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file="-" -C mps3_board.uart0.unbuffered_output=1 --stat -C mps3_board.DISABLE_GATING=1"

$FVP_BIN $OPTIONS -a cpu0*="$BUILD_PATH/bootloader/bl2.axf" --data "$BUILD_PATH/secure_partition/tfm_s_signed.bin"@0x11000000 --data "$BUILD_PATH/Projects/$1/$1_signed.bin"@0x01060000 --data "$BUILD_PATH/Projects/aws-iot-example/provisioning_data/provisioning_data.bin"@0x210FF000 --data "$BUILD_PATH/Middleware/ARM/TF-M/tf-m-build-prefix/src/tf-m-build-build/install/outputs/encrypted_provisioning_bundle.bin"@0x10022000
# Start the FVP
$FVP_BIN $OPTIONS -a $FVP_IMAGE_OPTIONS
Loading