blob: 3c59119cb4f4abf04c4d0ff0df268cf6957fa1e6 [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>
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080016 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 Qin153f3df2022-11-17 15:51:02 +080020 cmake --build cmake_build/ -- install -j32
21
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080022.. 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 Qin153f3df2022-11-17 15:51:02 +080028Build instructions on the host
29------------------------------
30
31.. code-block:: bash
32
33 cd <TF-M tests base folder>/erpc/host_example
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080034 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 Qin153f3df2022-11-17 15:51:02 +080036 cmake --build build/
37
Jason Guo4625c232023-07-11 10:21:49 +080038.. 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 Zhangcc99dc72023-05-05 10:35:11 +080042Run instructions
43----------------
Summer Qin153f3df2022-11-17 15:51:02 +080044
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080045- Flash the image to the device and boot it up.
46- Start the host example
Summer Qin153f3df2022-11-17 15:51:02 +080047
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080048 .. code-block:: bash
49
50 cd <TF-M tests base folder>/erpc/host_example
51 ./build/erpc_main
Summer Qin153f3df2022-11-17 15:51:02 +080052
Jason Guo4625c232023-07-11 10:21:49 +080053 .. 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 Qin153f3df2022-11-17 15:51:02 +080058Example: TCP Transportation on AN521 FVP
59========================================
60
61Build instructions on the target
62--------------------------------
63
64.. code-block:: bash
65
66 cd <TF-M base folder>
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080067 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 Qin153f3df2022-11-17 15:51:02 +080069 cmake --build cmake_build/ -- install -j32
70
71Build instructions on the host
72------------------------------
73
74.. code-block:: bash
75
76 cd <TF-M tests base folder>/erpc/host_example
Xinyu Zhangcc99dc72023-05-05 10:35:11 +080077 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 Qin153f3df2022-11-17 15:51:02 +080079 cmake --build build/
80
Jason Guo4625c232023-07-11 10:21:49 +080081.. 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 Zhangcc99dc72023-05-05 10:35:11 +080086Run instructions
87----------------
Summer Qin153f3df2022-11-17 15:51:02 +080088
89Start 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 Zhangcc99dc72023-05-05 10:35:11 +0800114Start the host example
115
Summer Qin153f3df2022-11-17 15:51:02 +0800116.. code-block:: bash
117
118 cd <TF-M tests base folder>/erpc/host_example
119 ./build/erpc_main
120
Jason Guo4625c232023-07-11 10:21:49 +0800121.. 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 Qin153f3df2022-11-17 15:51:02 +0800126--------------
127
128*Copyright (c) 2023, Arm Limited. All rights reserved.*