blob: 3e84e6730167e50f981a024fa7659b4125437c20 [file] [log] [blame]
Summer Qin153f3df2022-11-17 15:51:02 +08001*********
2eRPC Host
3*********
4
Xinyu Zhangcc99dc72023-05-05 10:35:11 +08005This host example is only tested on Linux machine with Musca-S1 and AN521 FVP.
Summer Qin153f3df2022-11-17 15:51:02 +08006
Xinyu Zhangcc99dc72023-05-05 10:35:11 +08007Example: UART Transportation on Musca-S1
Summer Qin153f3df2022-11-17 15:51:02 +08008========================================
9
10Build instructions on the target
11--------------------------------
12
13.. code-block:: bash
14
15 cd <TF-M base folder>
Kevin Peng4b9bbec2023-07-21 11:32:55 +080016
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080017 cmake -G"Unix Makefiles" -S . -B cmake_build -DTFM_PLATFORM=musca_s1 \
Kevin Peng4b9bbec2023-07-21 11:32:55 +080018 -DCONFIG_TFM_ERPC_TEST_FRAMEWORK=ON \
19 -DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON \
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080020 -DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_SILENCE -DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_SILENCE \
21 -DMCUBOOT_LOG_LEVEL=OFF ../
Kevin Peng4b9bbec2023-07-21 11:32:55 +080022
Summer Qin153f3df2022-11-17 15:51:02 +080023 cmake --build cmake_build/ -- install -j32
24
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080025.. Note::
26 All the logs must be disabled to avoid interferences between logs and eRPC transportation as
27 they share the same UART device.
28 Otherwise, the RPC test framework may not work.
29 This might only happen on platforms using the same UART devices.
30
Summer Qin153f3df2022-11-17 15:51:02 +080031Build instructions on the host
32------------------------------
33
34.. code-block:: bash
35
36 cd <TF-M tests base folder>/erpc/host_example
Kevin Peng4b9bbec2023-07-21 11:32:55 +080037
38 cmake -S . -B build -G "Unix Makefiles" \
39 -DTFM_INSTALL_PATH=<TFM_build_folder>/install \
40 -DERPC_REPO_PATH=<TFM_build_folder>/lib/ext/erpc-src \
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080041 -DERPC_TRANSPORT=UART -DPORT_NAME="/dev/ttyACM0"
Kevin Peng4b9bbec2023-07-21 11:32:55 +080042
Summer Qin153f3df2022-11-17 15:51:02 +080043 cmake --build build/
44
Jason Guo4625c232023-07-11 10:21:49 +080045.. Note::
46 The ``ERPC_TRANSPORT`` and ``PORT_NAME`` can be omitted and setting the transportation info
47 in command line is also supported. Follow `Run instructions`_ on how to use the command line.
48
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080049Run instructions
50----------------
Summer Qin153f3df2022-11-17 15:51:02 +080051
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080052- Flash the image to the device and boot it up.
53- Start the host example
Summer Qin153f3df2022-11-17 15:51:02 +080054
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080055 .. code-block:: bash
56
57 cd <TF-M tests base folder>/erpc/host_example
58 ./build/erpc_main
Summer Qin153f3df2022-11-17 15:51:02 +080059
Jason Guo4625c232023-07-11 10:21:49 +080060 .. Note::
61 If ``ERPC_TRANSPORT`` and ``PORT_NAME`` are not set, then they should be set as arguments of
62 ``erpc_main``. Execute the following command to run eRPC program:
63 ./build/erpc_main --UART /dev/ttyACM0
64
Summer Qin153f3df2022-11-17 15:51:02 +080065Example: TCP Transportation on AN521 FVP
66========================================
67
68Build instructions on the target
69--------------------------------
70
71.. code-block:: bash
72
73 cd <TF-M base folder>
Kevin Peng4b9bbec2023-07-21 11:32:55 +080074
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080075 cmake -G"Unix Makefiles" -S . -B cmake_build -DTFM_PLATFORM=an521 \
Kevin Peng4b9bbec2023-07-21 11:32:55 +080076 -DCONFIG_TFM_ERPC_TEST_FRAMEWORK=ON \
77 -DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON ../
78
Summer Qin153f3df2022-11-17 15:51:02 +080079 cmake --build cmake_build/ -- install -j32
80
81Build instructions on the host
82------------------------------
83
84.. code-block:: bash
85
86 cd <TF-M tests base folder>/erpc/host_example
Kevin Peng4b9bbec2023-07-21 11:32:55 +080087
88 cmake -S . -B build -G "Unix Makefiles" \
89 -DTFM_INSTALL_PATH=<TFM_build_folder>/install \
90 -DERPC_REPO_PATH=<TFM_build_folder>/lib/ext/erpc-src \
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080091 -DERPC_TRANSPORT=TCP -DERPC_HOST="0.0.0.0" -DERPC_PORT=5001
Kevin Peng4b9bbec2023-07-21 11:32:55 +080092
Summer Qin153f3df2022-11-17 15:51:02 +080093 cmake --build build/
94
Jason Guo4625c232023-07-11 10:21:49 +080095.. Note::
96 The ``ERPC_TRANSPORT``, ``ERPC_HOST`` and ``ERPC_PORT`` can be omitted and setting the
97 transportation info in command line is also supported. Follow `Run instructions`_ on
98 how to use the command line.
99
Xinyu Zhangcc99dc72023-05-05 10:35:11 +0800100Run instructions
101----------------
Summer Qin153f3df2022-11-17 15:51:02 +0800102
103Start the AN521 FVP:
104
105.. code-block:: bash
106
107 <DS_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \
108 --parameter fvp_mps2.platform_type=2 \
109 --parameter cpu0.baseline=0 \
110 --parameter cpu0.INITVTOR_S=0x10000000 \
111 --parameter cpu0.semihosting-enable=0 \
112 --parameter fvp_mps2.DISABLE_GATING=0 \
113 --parameter fvp_mps2.telnetterminal0.start_telnet=1 \
114 --parameter fvp_mps2.telnetterminal1.start_telnet=0 \
115 --parameter fvp_mps2.telnetterminal2.start_telnet=0 \
116 --parameter fvp_mps2.telnetterminal0.quiet=0 \
117 --parameter fvp_mps2.telnetterminal1.quiet=1 \
118 --parameter fvp_mps2.telnetterminal2.quiet=1 \
119 --parameter fvp_mps2.UART0.out_file=/dev/stdout \
120 --parameter fvp_mps2.UART0.unbuffered_output=1 \
121 --parameter fvp_mps2.telnetterminal1.mode=raw \
122 --parameter fvp_mps2.UART1.unbuffered_output=1 \
123 --parameter fvp_mps2.mps2_visualisation.disable-visualisation=1 \
124 --application cpu0=<APPLICATION> \
125 --data cpu0=<DATA>@0x10080000 \
126 -M 1
127
Xinyu Zhangcc99dc72023-05-05 10:35:11 +0800128Start the host example
129
Summer Qin153f3df2022-11-17 15:51:02 +0800130.. code-block:: bash
131
132 cd <TF-M tests base folder>/erpc/host_example
133 ./build/erpc_main
134
Jason Guo4625c232023-07-11 10:21:49 +0800135.. Note::
136 If ``ERPC_TRANSPORT``, ``ERPC_HOST`` and ``ERPC_PORT`` are not set, then they should be set as
137 arguments of ``erpc_main``. Execute the following command to run eRPC program:
138 ./build/erpc_main --TCP 0.0.0.0 5001
139
Summer Qin153f3df2022-11-17 15:51:02 +0800140--------------
141
142*Copyright (c) 2023, Arm Limited. All rights reserved.*