blob: 63aa633d827ba5e644934036e32e7fd73bce330b [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
Kevin Peng97185812023-11-15 15:34:48 +080015 # Build TF-M
Kevin Peng4b9bbec2023-07-21 11:32:55 +080016
Kevin Peng97185812023-11-15 15:34:48 +080017 cmake -G"Unix Makefiles" -S <path_to_tf-m> -B build_spe -DTFM_PLATFORM=musca_s1 \
Kevin Peng4b9bbec2023-07-21 11:32:55 +080018 -DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON \
Jackson Cooper-Drivere7c8f8e2025-03-04 10:28:59 +000019 -DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_SILENCE -DTFM_PARTITION_LOG_LEVEL=LOG_LEVEL_NONE \
Kevin Peng97185812023-11-15 15:34:48 +080020 -DMCUBOOT_LOG_LEVEL=OFF
Kevin Peng4b9bbec2023-07-21 11:32:55 +080021
Kevin Peng97185812023-11-15 15:34:48 +080022 cmake --build build_spe -- install -j
23
24 # Build NS eRPC server
25
26 cmake -G"Unix Makefiles" -S <path_to_tf-m-tests>/erpc/server/app -B build_nspe \
27 -DCONFIG_SPE_PATH=<absolute_path_to_build_spe>/api_ns
28
29 cmake --build build_nspe -j
30
31 # Create the final image
32
33 srec_cat build_spe/bin/bl2.bin -Binary -offset 0xA000000 build_nspe/tfm_s_ns_signed.bin \
34 -Binary -offset 0xA020000 -o build_nspe/tfm.hex -Intel
Summer Qin153f3df2022-11-17 15:51:02 +080035
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080036.. Note::
37 All the logs must be disabled to avoid interferences between logs and eRPC transportation as
38 they share the same UART device.
39 Otherwise, the RPC test framework may not work.
40 This might only happen on platforms using the same UART devices.
41
Summer Qin153f3df2022-11-17 15:51:02 +080042Build instructions on the host
43------------------------------
44
45.. code-block:: bash
46
47 cd <TF-M tests base folder>/erpc/host_example
Kevin Peng4b9bbec2023-07-21 11:32:55 +080048
49 cmake -S . -B build -G "Unix Makefiles" \
Kevin Peng97185812023-11-15 15:34:48 +080050 -DCONFIG_SPE_PATH=<absolute_path_to_build_spe>/api_ns \
Kevin Peng4b9bbec2023-07-21 11:32:55 +080051 -DERPC_REPO_PATH=<TFM_build_folder>/lib/ext/erpc-src \
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080052 -DERPC_TRANSPORT=UART -DPORT_NAME="/dev/ttyACM0"
Kevin Peng4b9bbec2023-07-21 11:32:55 +080053
Summer Qin153f3df2022-11-17 15:51:02 +080054 cmake --build build/
55
Jason Guo4625c232023-07-11 10:21:49 +080056.. Note::
57 The ``ERPC_TRANSPORT`` and ``PORT_NAME`` can be omitted and setting the transportation info
58 in command line is also supported. Follow `Run instructions`_ on how to use the command line.
59
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080060Run instructions
61----------------
Summer Qin153f3df2022-11-17 15:51:02 +080062
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080063- Flash the image to the device and boot it up.
64- Start the host example
Summer Qin153f3df2022-11-17 15:51:02 +080065
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080066 .. code-block:: bash
67
68 cd <TF-M tests base folder>/erpc/host_example
69 ./build/erpc_main
Summer Qin153f3df2022-11-17 15:51:02 +080070
Jason Guo4625c232023-07-11 10:21:49 +080071 .. Note::
72 If ``ERPC_TRANSPORT`` and ``PORT_NAME`` are not set, then they should be set as arguments of
73 ``erpc_main``. Execute the following command to run eRPC program:
74 ./build/erpc_main --UART /dev/ttyACM0
75
Summer Qin153f3df2022-11-17 15:51:02 +080076Example: TCP Transportation on AN521 FVP
77========================================
78
79Build instructions on the target
80--------------------------------
81
82.. code-block:: bash
83
Kevin Peng97185812023-11-15 15:34:48 +080084 # Build TF-M
Kevin Peng4b9bbec2023-07-21 11:32:55 +080085
Kevin Peng97185812023-11-15 15:34:48 +080086 cmake -G"Unix Makefiles" -S <path_to_tf-m> -B build_spe -DTFM_PLATFORM=an521 \
87 -DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON
Kevin Peng4b9bbec2023-07-21 11:32:55 +080088
Kevin Peng97185812023-11-15 15:34:48 +080089 cmake --build build_spe -- install -j
90
91 # Build NS eRPC server
92
93 cmake -G"Unix Makefiles" -S <path_to_tf-m-tests>/erpc/server/app -B build_nspe \
94 -DCONFIG_SPE_PATH=<absolute_path_to_build_spe>/api_ns
95
96 cmake --build build_nspe -j
Summer Qin153f3df2022-11-17 15:51:02 +080097
98Build instructions on the host
99------------------------------
100
101.. code-block:: bash
102
103 cd <TF-M tests base folder>/erpc/host_example
Kevin Peng4b9bbec2023-07-21 11:32:55 +0800104
105 cmake -S . -B build -G "Unix Makefiles" \
Kevin Peng97185812023-11-15 15:34:48 +0800106 -DCONFIG_SPE_PATH=<absolute_path_to_build_spe>/api_ns \
107 -DERPC_REPO_PATH=<absolute_path_to_build_nspe>/lib/ext/erpc-src \
Xinyu Zhangcc99dc72023-05-05 10:35:11 +0800108 -DERPC_TRANSPORT=TCP -DERPC_HOST="0.0.0.0" -DERPC_PORT=5001
Kevin Peng4b9bbec2023-07-21 11:32:55 +0800109
Summer Qin153f3df2022-11-17 15:51:02 +0800110 cmake --build build/
111
Jason Guo4625c232023-07-11 10:21:49 +0800112.. Note::
113 The ``ERPC_TRANSPORT``, ``ERPC_HOST`` and ``ERPC_PORT`` can be omitted and setting the
Kevin Peng97185812023-11-15 15:34:48 +0800114 transportation info in command line when running the app is also supported.
115 Follow `Run instructions`_ on how to use the command line.
Jason Guo4625c232023-07-11 10:21:49 +0800116
Xinyu Zhangcc99dc72023-05-05 10:35:11 +0800117Run instructions
118----------------
Summer Qin153f3df2022-11-17 15:51:02 +0800119
120Start the AN521 FVP:
121
122.. code-block:: bash
123
124 <DS_PATH>/sw/models/bin/FVP_MPS2_AEMv8M \
125 --parameter fvp_mps2.platform_type=2 \
126 --parameter cpu0.baseline=0 \
127 --parameter cpu0.INITVTOR_S=0x10000000 \
128 --parameter cpu0.semihosting-enable=0 \
129 --parameter fvp_mps2.DISABLE_GATING=0 \
130 --parameter fvp_mps2.telnetterminal0.start_telnet=1 \
131 --parameter fvp_mps2.telnetterminal1.start_telnet=0 \
132 --parameter fvp_mps2.telnetterminal2.start_telnet=0 \
133 --parameter fvp_mps2.telnetterminal0.quiet=0 \
134 --parameter fvp_mps2.telnetterminal1.quiet=1 \
135 --parameter fvp_mps2.telnetterminal2.quiet=1 \
136 --parameter fvp_mps2.UART0.out_file=/dev/stdout \
137 --parameter fvp_mps2.UART0.unbuffered_output=1 \
138 --parameter fvp_mps2.telnetterminal1.mode=raw \
139 --parameter fvp_mps2.UART1.unbuffered_output=1 \
140 --parameter fvp_mps2.mps2_visualisation.disable-visualisation=1 \
141 --application cpu0=<APPLICATION> \
142 --data cpu0=<DATA>@0x10080000 \
143 -M 1
144
Xinyu Zhangcc99dc72023-05-05 10:35:11 +0800145Start the host example
146
Summer Qin153f3df2022-11-17 15:51:02 +0800147.. code-block:: bash
148
149 cd <TF-M tests base folder>/erpc/host_example
150 ./build/erpc_main
151
Jason Guo4625c232023-07-11 10:21:49 +0800152.. Note::
153 If ``ERPC_TRANSPORT``, ``ERPC_HOST`` and ``ERPC_PORT`` are not set, then they should be set as
154 arguments of ``erpc_main``. Execute the following command to run eRPC program:
155 ./build/erpc_main --TCP 0.0.0.0 5001
156
Summer Qin153f3df2022-11-17 15:51:02 +0800157--------------
158
159*Copyright (c) 2023, Arm Limited. All rights reserved.*