README.rst
1.. zephyr:code-sample:: mbox_data
2 :name: MBOX Data
3 :relevant-api: mbox_interface
4
5 Perform inter-processor mailbox communication using the MBOX API with data.
6
7Overview
8********
9
10This sample demonstrates how to use the :ref:`MBOX API <mbox_api>` in data transfer mode.
11It can be used only with mbox driver which supports data transfer mode.
12
13Sample will ping-pong up to 4 bytes of data between two cores via two mbox channels.
14After each core receives data, it increments it by one and sends it back to other core.
15
16Building and Running
17********************
18
19The sample can be built and executed on boards supporting MBOX with data transfer mode.
20
21Building the application for mimxrt1160_evk_cm7
22===============================================
23
24.. zephyr-app-commands::
25 :zephyr-app: samples/drivers/mbox_data/
26 :board: mimxrt1160_evk_cm7
27 :goals: debug
28 :west-args: --sysbuild
29
30Building the application for mimxrt1170_evk_cm7
31===============================================
32
33.. zephyr-app-commands::
34 :zephyr-app: samples/drivers/mbox_data/
35 :board: mimxrt1170_evk_cm7
36 :goals: debug
37 :west-args: --sysbuild
38
39Building the application for mimxrt1170_evkb_cm7
40================================================
41
42.. zephyr-app-commands::
43 :zephyr-app: samples/drivers/mbox_data/
44 :board: mimxrt1170_evkb_cm7
45 :goals: debug
46 :west-args: --sysbuild
47
48Building the application for lpcxpresso55s69_cpu1
49=================================================
50
51.. zephyr-app-commands::
52 :zephyr-app: samples/drivers/mbox_data/
53 :board: lpcxpresso55s69_cpu1
54 :goals: debug
55 :west-args: --sysbuild
56
57Building the application for frdm_mcxn947/mcxn947/cpu0
58======================================================
59
60.. zephyr-app-commands::
61 :zephyr-app: samples/drivers/mbox_data/
62 :board: frdm_mcxn947/mcxn947/cpu0
63 :goals: debug
64 :west-args: --sysbuild
65
66Sample Output
67=============
68
69Open a serial terminal (minicom, putty, etc.) and connect the board with the
70following settings:
71
72- Speed: 115200
73- Data: 8 bits
74- Parity: None
75- Stop bits: 1
76
77Reset the board and the following message will appear on the corresponding
78serial port, one is the main core another is the remote core:
79
80.. code-block:: console
81
82 *** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 ***
83 mbox_data Client demo started
84 Client send (on channel 3) value: 0
85 Client received (on channel 2) value: 1
86 Client send (on channel 3) value: 2
87 Client received (on channel 2) value: 3
88 Client send (on channel 3) value: 4
89 ...
90 Client received (on channel 2) value: 95
91 Client send (on channel 3) value: 96
92 Client received (on channel 2) value: 97
93 Client send (on channel 3) value: 98
94 Client received (on channel 2) value: 99
95 mbox_data Client demo ended
96
97
98.. code-block:: console
99
100 *** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 ***
101 mbox_data Server demo started
102 Server receive (on channel 3) value: 0
103 Server send (on channel 2) value: 1
104 Server receive (on channel 3) value: 2
105 Server send (on channel 2) value: 3
106 Server receive (on channel 3) value: 4
107 ...
108 Server send (on channel 2) value: 95
109 Server receive (on channel 3) value: 96
110 Server send (on channel 2) value: 97
111 Server receive (on channel 3) value: 98
112 Server send (on channel 2) value: 99
113 mbox_data Server demo ended.
114