Part 1
요약·해설
Zephyr M4와 Linux remote module 사이의 blocking echo와 전체 출력을 보존합니다.
Messaging Unit
32 · 64 · 128 bit
/dev/mu0…mu3
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
7B08E3604DD086657DC78D4ECB2CB67E6838BE5B8A92AE048D3501980FD569B6
.. zephyr:code-sample:: ipm-imx
:name: IPM on NXP i.MX
:relevant-api: ipm_interface
Implement inter-processor mailbox (IPM) on i.MX SoCs containing a Messaging Unit peripheral.
Overview
********
This simple example can be used with multicore i.MX SoCs containing a
Messaging Unit peripheral. It reads the received data from the Messaging Unit
using the IPM and transmits it back unchanged. The information about
the received data is printed to the console. When sending the data back,
it blocks until the data are read by the remote side.
The i.MX Messaging Unit peripheral consists of four 32-bit transmit and receive
registers. The sample uses the option :kconfig:option:`CONFIG_IPM_IMX_MAX_DATA_SIZE_4`,
which effectively creates four IPM channels. Selecting the option
:kconfig:option:`CONFIG_IPM_IMX_MAX_DATA_SIZE_8` or
:kconfig:option:`CONFIG_IPM_IMX_MAX_DATA_SIZE_16` would result in two 64-bit channels
or a single 128-bit channel respectively.
Note that this is just a simple demo to demonstrate the i.MX IPM functionality
and blocking sending of the data back is done in the interrupt handler, which
would not be appropriate for a real world application.
Building and Running the Zephyr Code
************************************
The sample requires that data are being sent by the remote core so it can echo
it back. The other core is usually not running Zephyr but Linux on i.MX
multicore processors.
This project outputs data to the console.
It can be built as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/ipm/ipm_imx
:board: udoo_neo_full/mcimx6x/m4
:goals: build flash
:compact:
Follow the instructions in the :ref:`udoo_neo_full` board documentation
for how to load the Zephyr binary to the desired core and execute it.
Building and Running the Linux Code
***********************************
The remote code is in the form of a loadable Linux kernel module. It creates
four character devices /dev/mu0 till /dev/mu3, which are used to read data from
and write data into the Messaging Unit.
The remote code and the instructions how to build and run it are located at:
https://source.codeaurora.org/external/imxsupport/imx-mu/
Sample Output
=============
Typing this in the Linux console:
.. code-block:: console
# cat > /dev/mu0
abcdefgh
^D
Results in the following output on the Zephyr side:
.. code-block:: console
***** Booting Zephyr OS v1.12.0-291-g8cc508b *****
IPM initialized, data size = 4
ipm_callback: id = 0, data = 0x03323130
ipm_callback: id = 0, data = 0x03353433
ipm_callback: id = 0, data = 0x03383736
ipm_callback: id = 0, data = 0x02000a39
Part 3
한국어 전문 번역
개요
이 간단한 예제는 Messaging Unit peripheral이 있는 multicore i.MX SoC에서 사용할 수 있습니다. IPM으로 Messaging Unit에서 수신한 data를 읽고 변경 없이 다시 전송합니다. 수신 data의 정보는 console에 출력합니다. Data를 돌려보낼 때는 remote side가 data를 읽을 때까지 block합니다.
i.MX Messaging Unit peripheral은 네 개의 32-bit transmit register와 receive register로 구성됩니다. Sample은 CONFIG_IPM_IMX_MAX_DATA_SIZE_4 option을 사용해 사실상 IPM channel 네 개를 만듭니다. CONFIG_IPM_IMX_MAX_DATA_SIZE_8을 선택하면 64-bit channel 두 개가 되고, CONFIG_IPM_IMX_MAX_DATA_SIZE_16을 선택하면 128-bit channel 한 개가 됩니다.
이 sample은 i.MX IPM 기능을 보여주는 간단한 demo일 뿐입니다. Interrupt handler 안에서 data를 block 방식으로 되돌려 보내므로 실제 application에는 적합하지 않습니다.
Zephyr Code Build와 실행
Sample이 data를 echo하려면 remote core가 data를 보내야 합니다. i.MX multicore processor에서 다른 core는 보통 Zephyr가 아니라 Linux를 실행합니다.
이 project는 console로 출력하며 다음과 같이 build할 수 있습니다.
west build -b udoo_neo_full/mcimx6x/m4 samples/drivers/ipm/ipm_imx
west flash
Zephyr binary를 원하는 core에 load하고 실행하는 방법은 udoo_neo_full board 문서의 지침을 따르십시오.
Linux Code Build와 실행
Remote code는 load 가능한 Linux kernel module 형태입니다. 이 module은 Messaging Unit에 data를 쓰고 읽는 데 사용하는 네 character device /dev/mu0부터 /dev/mu3까지를 생성합니다.
Remote code와 build·실행 지침은 i.MX MU project에 있습니다.
Sample 출력
Linux console에서 다음을 입력합니다.
# cat > /dev/mu0
abcdefgh
^D
그러면 Zephyr 쪽에 다음 출력이 나타납니다.
***** Booting Zephyr OS v1.12.0-291-g8cc508b *****
IPM initialized, data size = 4
ipm_callback: id = 0, data = 0x03323130
ipm_callback: id = 0, data = 0x03353433
ipm_callback: id = 0, data = 0x03383736
ipm_callback: id = 0, data = 0x02000a39
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.