Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 1 | ********* |
| 2 | eRPC Host |
| 3 | ********* |
| 4 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 5 | This host example is only tested on Linux machine with Musca-S1 and AN521 FVP. |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 6 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 7 | Example: UART Transportation on Musca-S1 |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 8 | ======================================== |
| 9 | |
| 10 | Build instructions on the target |
| 11 | -------------------------------- |
| 12 | |
| 13 | .. code-block:: bash |
| 14 | |
| 15 | cd <TF-M base folder> |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 16 | cmake -G"Unix Makefiles" -S . -B cmake_build -DTFM_PLATFORM=musca_s1 \ |
| 17 | -DCONFIG_TFM_ERPC_TEST_FRAMEWORK=ON -DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON \ |
| 18 | -DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_SILENCE -DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_SILENCE \ |
| 19 | -DMCUBOOT_LOG_LEVEL=OFF ../ |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 20 | cmake --build cmake_build/ -- install -j32 |
| 21 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 22 | .. Note:: |
| 23 | All the logs must be disabled to avoid interferences between logs and eRPC transportation as |
| 24 | they share the same UART device. |
| 25 | Otherwise, the RPC test framework may not work. |
| 26 | This might only happen on platforms using the same UART devices. |
| 27 | |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 28 | Build instructions on the host |
| 29 | ------------------------------ |
| 30 | |
| 31 | .. code-block:: bash |
| 32 | |
| 33 | cd <TF-M tests base folder>/erpc/host_example |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 34 | cmake -S . -B build -G "Unix Makefiles" -DTFM_INSTALL_PATH=<TF-M install folder> -DERPC_REPO_PATH=<eRPC base folder> \ |
| 35 | -DERPC_TRANSPORT=UART -DPORT_NAME="/dev/ttyACM0" |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 36 | cmake --build build/ |
| 37 | |
Jason Guo | 4625c23 | 2023-07-11 10:21:49 +0800 | [diff] [blame^] | 38 | .. Note:: |
| 39 | The ``ERPC_TRANSPORT`` and ``PORT_NAME`` can be omitted and setting the transportation info |
| 40 | in command line is also supported. Follow `Run instructions`_ on how to use the command line. |
| 41 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 42 | Run instructions |
| 43 | ---------------- |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 44 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 45 | - Flash the image to the device and boot it up. |
| 46 | - Start the host example |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 47 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 48 | .. code-block:: bash |
| 49 | |
| 50 | cd <TF-M tests base folder>/erpc/host_example |
| 51 | ./build/erpc_main |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 52 | |
Jason Guo | 4625c23 | 2023-07-11 10:21:49 +0800 | [diff] [blame^] | 53 | .. Note:: |
| 54 | If ``ERPC_TRANSPORT`` and ``PORT_NAME`` are not set, then they should be set as arguments of |
| 55 | ``erpc_main``. Execute the following command to run eRPC program: |
| 56 | ./build/erpc_main --UART /dev/ttyACM0 |
| 57 | |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 58 | Example: TCP Transportation on AN521 FVP |
| 59 | ======================================== |
| 60 | |
| 61 | Build instructions on the target |
| 62 | -------------------------------- |
| 63 | |
| 64 | .. code-block:: bash |
| 65 | |
| 66 | cd <TF-M base folder> |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 67 | cmake -G"Unix Makefiles" -S . -B cmake_build -DTFM_PLATFORM=an521 \ |
| 68 | -DCONFIG_TFM_ERPC_TEST_FRAMEWORK=ON -DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON ../ |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 69 | cmake --build cmake_build/ -- install -j32 |
| 70 | |
| 71 | Build instructions on the host |
| 72 | ------------------------------ |
| 73 | |
| 74 | .. code-block:: bash |
| 75 | |
| 76 | cd <TF-M tests base folder>/erpc/host_example |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 77 | cmake -S . -B build -G "Unix Makefiles" -DTFM_INSTALL_PATH=<TF-M install folder> -DERPC_REPO_PATH=<eRPC base folder> \ |
| 78 | -DERPC_TRANSPORT=TCP -DERPC_HOST="0.0.0.0" -DERPC_PORT=5001 |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 79 | cmake --build build/ |
| 80 | |
Jason Guo | 4625c23 | 2023-07-11 10:21:49 +0800 | [diff] [blame^] | 81 | .. Note:: |
| 82 | The ``ERPC_TRANSPORT``, ``ERPC_HOST`` and ``ERPC_PORT`` can be omitted and setting the |
| 83 | transportation info in command line is also supported. Follow `Run instructions`_ on |
| 84 | how to use the command line. |
| 85 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 86 | Run instructions |
| 87 | ---------------- |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 88 | |
| 89 | Start the AN521 FVP: |
| 90 | |
| 91 | .. code-block:: bash |
| 92 | |
| 93 | <DS_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \ |
| 94 | --parameter fvp_mps2.platform_type=2 \ |
| 95 | --parameter cpu0.baseline=0 \ |
| 96 | --parameter cpu0.INITVTOR_S=0x10000000 \ |
| 97 | --parameter cpu0.semihosting-enable=0 \ |
| 98 | --parameter fvp_mps2.DISABLE_GATING=0 \ |
| 99 | --parameter fvp_mps2.telnetterminal0.start_telnet=1 \ |
| 100 | --parameter fvp_mps2.telnetterminal1.start_telnet=0 \ |
| 101 | --parameter fvp_mps2.telnetterminal2.start_telnet=0 \ |
| 102 | --parameter fvp_mps2.telnetterminal0.quiet=0 \ |
| 103 | --parameter fvp_mps2.telnetterminal1.quiet=1 \ |
| 104 | --parameter fvp_mps2.telnetterminal2.quiet=1 \ |
| 105 | --parameter fvp_mps2.UART0.out_file=/dev/stdout \ |
| 106 | --parameter fvp_mps2.UART0.unbuffered_output=1 \ |
| 107 | --parameter fvp_mps2.telnetterminal1.mode=raw \ |
| 108 | --parameter fvp_mps2.UART1.unbuffered_output=1 \ |
| 109 | --parameter fvp_mps2.mps2_visualisation.disable-visualisation=1 \ |
| 110 | --application cpu0=<APPLICATION> \ |
| 111 | --data cpu0=<DATA>@0x10080000 \ |
| 112 | -M 1 |
| 113 | |
Xinyu Zhang | cc99dc7 | 2023-05-05 10:35:11 +0800 | [diff] [blame] | 114 | Start the host example |
| 115 | |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 116 | .. code-block:: bash |
| 117 | |
| 118 | cd <TF-M tests base folder>/erpc/host_example |
| 119 | ./build/erpc_main |
| 120 | |
Jason Guo | 4625c23 | 2023-07-11 10:21:49 +0800 | [diff] [blame^] | 121 | .. Note:: |
| 122 | If ``ERPC_TRANSPORT``, ``ERPC_HOST`` and ``ERPC_PORT`` are not set, then they should be set as |
| 123 | arguments of ``erpc_main``. Execute the following command to run eRPC program: |
| 124 | ./build/erpc_main --TCP 0.0.0.0 5001 |
| 125 | |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 126 | -------------- |
| 127 | |
| 128 | *Copyright (c) 2023, Arm Limited. All rights reserved.* |