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 57Sample Output 58============= 59 60Open a serial terminal (minicom, putty, etc.) and connect the board with the 61following settings: 62 63- Speed: 115200 64- Data: 8 bits 65- Parity: None 66- Stop bits: 1 67 68Reset the board and the following message will appear on the corresponding 69serial port, one is the main core another is the remote core: 70 71.. code-block:: console 72 73 *** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 *** 74 mbox_data Client demo started 75 Client send (on channel 3) value: 0 76 Client received (on channel 2) value: 1 77 Client send (on channel 3) value: 2 78 Client received (on channel 2) value: 3 79 Client send (on channel 3) value: 4 80 ... 81 Client received (on channel 2) value: 95 82 Client send (on channel 3) value: 96 83 Client received (on channel 2) value: 97 84 Client send (on channel 3) value: 98 85 Client received (on channel 2) value: 99 86 mbox_data Client demo ended 87 88 89.. code-block:: console 90 91 *** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 *** 92 mbox_data Server demo started 93 Server receive (on channel 3) value: 0 94 Server send (on channel 2) value: 1 95 Server receive (on channel 3) value: 2 96 Server send (on channel 2) value: 3 97 Server receive (on channel 3) value: 4 98 ... 99 Server send (on channel 2) value: 95 100 Server receive (on channel 3) value: 96 101 Server send (on channel 2) value: 97 102 Server receive (on channel 3) value: 98 103 Server send (on channel 2) value: 99 104 mbox_data Server demo ended. 105