samples/drivers/mbox_data/README.html · samples/drivers/mbox_data/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Drivers · Mailbox

MBOX Data

최대 4byte 값을 channel 3과 2로 왕복하며 0부터 99까지 증가시킵니다.

Official pathsamples/drivers/mbox_data/README.html
Source filesamples/drivers/mbox_data/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

네 board의 sysbuild·debug 명령과 client/server 전체 출력을 보존합니다.

Data

최대 4 bytes

TX/RX

Channel 3 / 2

Range

0~99

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 0590B11E56F5954EE3200F9C49A019F807CC13A17EA4F0F5CB4380319E2343AB
.. zephyr:code-sample:: mbox_data
   :name: MBOX Data
   :relevant-api: mbox_interface

   Perform inter-processor mailbox communication using the MBOX API with data.

Overview
********

This sample demonstrates how to use the :ref:`MBOX API <mbox_api>` in data transfer mode.
It can be used only with mbox driver which supports data transfer mode.

Sample will ping-pong up to 4 bytes of data between two cores via two mbox channels.
After each core receives data, it increments it by one and sends it back to other core.

Building and Running
********************

The sample can be built and executed on boards supporting MBOX with data transfer mode.

Building the application for mimxrt1160_evk_cm7
===============================================

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/mbox_data/
   :board: mimxrt1160_evk_cm7
   :goals: debug
   :west-args: --sysbuild

Building the application for mimxrt1170_evk_cm7
===============================================

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/mbox_data/
   :board: mimxrt1170_evk_cm7
   :goals: debug
   :west-args: --sysbuild

Building the application for mimxrt1170_evkb_cm7
================================================

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/mbox_data/
   :board: mimxrt1170_evkb_cm7
   :goals: debug
   :west-args: --sysbuild

Building the application for lpcxpresso55s69_cpu1
=================================================

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/mbox_data/
   :board: lpcxpresso55s69_cpu1
   :goals: debug
   :west-args: --sysbuild

Sample Output
=============

Open a serial terminal (minicom, putty, etc.) and connect the board with the
following settings:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

Reset the board and the following message will appear on the corresponding
serial port, one is the main core another is the remote core:

.. code-block:: console

   *** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 ***
   mbox_data Client demo started
   Client send (on channel 3) value: 0
   Client received (on channel 2) value: 1
   Client send (on channel 3) value: 2
   Client received (on channel 2) value: 3
   Client send (on channel 3) value: 4
   ...
   Client received (on channel 2) value: 95
   Client send (on channel 3) value: 96
   Client received (on channel 2) value: 97
   Client send (on channel 3) value: 98
   Client received (on channel 2) value: 99
   mbox_data Client demo ended


.. code-block:: console

   *** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 ***
   mbox_data Server demo started
   Server receive (on channel 3) value: 0
   Server send (on channel 2) value: 1
   Server receive (on channel 3) value: 2
   Server send (on channel 2) value: 3
   Server receive (on channel 3) value: 4
   ...
   Server send (on channel 2) value: 95
   Server receive (on channel 3) value: 96
   Server send (on channel 2) value: 97
   Server receive (on channel 3) value: 98
   Server send (on channel 2) value: 99
   mbox_data Server demo ended.

Part 3

한국어 전문 번역

개요

이 sample은 data transfer mode에서 MBOX API를 사용하는 방법을 보여줍니다. Data transfer mode를 지원하는 mbox driver에서만 사용할 수 있습니다.

Sample은 mbox channel 두 개를 통해 두 core 사이에서 최대 4byte data를 ping-pong합니다. 각 core는 data를 수신할 때마다 값을 1 증가시킨 뒤 다른 core로 돌려보냅니다.

Build와 실행

Data transfer mode의 MBOX를 지원하는 board에서 sample을 build하고 실행할 수 있습니다.

mimxrt1160_evk_cm7용 application build

# From the root of the zephyr repository
west build -b mimxrt1160_evk_cm7 --sysbuild samples/drivers/mbox_data/
west debug

mimxrt1170_evk_cm7용 application build

# From the root of the zephyr repository
west build -b mimxrt1170_evk_cm7 --sysbuild samples/drivers/mbox_data/
west debug

mimxrt1170_evkb_cm7용 application build

# From the root of the zephyr repository
west build -b mimxrt1170_evkb_cm7 --sysbuild samples/drivers/mbox_data/
west debug

lpcxpresso55s69_cpu1용 application build

# From the root of the zephyr repository
west build -b lpcxpresso55s69_cpu1 --sysbuild samples/drivers/mbox_data/
west debug

Sample 출력

Minicom이나 PuTTY 같은 serial terminal을 열고 다음 설정으로 board에 연결합니다.

  • Speed: 115200
  • Data: 8 bits
  • Parity: None
  • Stop bits: 1

Board를 reset하면 해당 serial port 두 곳에 다음 message가 나타납니다. 하나는 main core이고 다른 하나는 remote core입니다.

*** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 ***
mbox_data Client demo started
Client send (on channel 3) value: 0
Client received (on channel 2) value: 1
Client send (on channel 3) value: 2
Client received (on channel 2) value: 3
Client send (on channel 3) value: 4
...
Client received (on channel 2) value: 95
Client send (on channel 3) value: 96
Client received (on channel 2) value: 97
Client send (on channel 3) value: 98
Client received (on channel 2) value: 99
mbox_data Client demo ended
*** Booting Zephyr OS build zephyr-v3.5.0-4051-g12f4f4dc8679 ***
mbox_data Server demo started
Server receive (on channel 3) value: 0
Server send (on channel 2) value: 1
Server receive (on channel 3) value: 2
Server send (on channel 2) value: 3
Server receive (on channel 3) value: 4
...
Server send (on channel 2) value: 95
Server receive (on channel 3) value: 96
Server send (on channel 2) value: 97
Server receive (on channel 3) value: 98
Server send (on channel 2) value: 99
mbox_data Server demo ended.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.