1.. zephyr:code-sample:: openamp-rsc-table
2   :name: OpenAMP using resource table
3   :relevant-api: ipm_interface
4
5   Send messages between two cores using OpenAMP and a resource table.
6
7Overview
8********
9
10This application demonstrates how to use OpenAMP with Zephyr based on a resource
11table. It is designed to respond to the:
12
13* `Linux rpmsg client sample <https://elixir.bootlin.com/linux/latest/source/samples/rpmsg/rpmsg_client_sample.c>`_
14* `Linux rpmsg tty driver <https://elixir.bootlin.com/linux/latest/source/drivers/tty/rpmsg_tty.c>`_
15
16This sample implementation is compatible with platforms that embed
17a Linux kernel OS on the main processor and a Zephyr application on
18the co-processor.
19
20Building the application
21*************************
22
23Zephyr
24-------
25
26.. zephyr-app-commands::
27   :zephyr-app: samples/subsys/ipc/openamp_rsc_table
28   :goals: test
29
30Linux
31------
32
33Enable SAMPLE_RPMSG_CLIENT configuration to build and install
34the rpmsg_client_sample.ko module on the target.
35
36Running the sample
37*******************
38
39Zephyr console
40---------------
41
42Open a serial terminal (minicom, putty, etc.) and connect the board with the
43following settings:
44
45- Speed: 115200
46- Data: 8 bits
47- Parity: None
48- Stop bits: 1
49
50Reset the board.
51
52Linux console
53---------------
54
55Open a Linux shell (minicom, ssh, etc.) and insert a module into the Linux Kernel
56
57.. code-block:: console
58
59   root@linuxshell: insmod rpmsg_client_sample.ko
60
61Result on Zephyr console on boot
62--------------------------------
63
64The following message will appear on the corresponding Zephyr console:
65
66.. code-block:: console
67
68   ***** Booting Zephyr OS v#.##.#-####-g########## *****
69   Starting application thread!
70
71   OpenAMP demo started
72   Remote core received message 1: hello world!
73   Remote core received message 2: hello world!
74   Remote core received message 3: hello world!
75   ...
76   Remote core received message 100: hello world!
77   OpenAMP demo ended.
78
79
80rpmsg TTY demo on Linux console
81-------------------------------
82
83On the Linux console send a message to Zephyr which answers with the "TTY <add>" prefix.
84<addr> corresponds to the Zephyr rpmsg-tty endpoint address:
85
86.. code-block:: console
87
88   $> cat /dev/ttyRPMSG0 &
89   $> echo "Hello Zephyr" >/dev/ttyRPMSG0
90   TTY 0x0401: Hello Zephyr
91