services/ipc/ipc_service/backends/ipc_service_icmsg.html · services/ipc/ipc_service/backends/ipc_service_icmsg.rst 공식 원문 ↗

Zephyr 3.7.0 · IPC · ICMsg

ICMsg Backend

작은 memory footprint로 data는 shared memory에 두고 MBOX signal로 상대 CPU를 깨웁니다.

Official pathservices/ipc/ipc_service/backends/ipc_service_icmsg.html
Source fileservices/ipc/ipc_service/backends/ipc_service_icmsg.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

Instance당 endpoint 하나, tx/rx region swap과 magic-number bonding 반복 timeout을 설명합니다.

Storage

Shared memory

Signal

MBOX

Endpoint

One per instance

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 15223023F61BF7F833C1A1B9BC751B2DC012D46B6DE92AA98364541801827A79
.. _ipc_service_backend_icmsg:

ICMsg backend
#############

The inter core messaging backend (ICMsg) is a lighter alternative to the
heavier RPMsg static vrings backend. It offers a minimal feature set in a small
memory footprint. The ICMsg backend is build on top of :ref:`spsc_pbuf`.

Overview
========

The ICMsg backend uses shared memory and MBOX devices for exchanging data.
Shared memory is used to store the data, MBOX devices are used to signal that
the data has been written.

The backend supports the registration of a single endpoint on a single
instance. If the application requires more than one communication channel, you
must define multiple instances, each having its own dedicated endpoint.

Configuration
=============

The  backend is configured via Kconfig and devicetree.
When configuring the backend, do the following:

* Define two memory regions and assign them to ``tx-region`` and ``rx-region``
  of an instance. Ensure that the memory regions used for data exchange are
  unique (not overlapping any other region) and accessible by both domains
  (or CPUs).
* Define MBOX devices which are used to send the signal that informs the other
  domain (or CPU) that data has been written. Ensure that the other domain
  (or CPU) is able to receive the signal.

See the following configuration example for one of the instances:

.. code-block:: devicetree

   reserved-memory {
      tx: memory@20070000 {
         reg = <0x20070000 0x0800>;
      };

      rx: memory@20078000 {
         reg = <0x20078000 0x0800>;
      };
   };

      ipc {
         ipc0: ipc0 {
            compatible = "zephyr,ipc-icmsg";
            tx-region = <&tx>;
            rx-region = <&rx>;
            mboxes = <&mbox 0>, <&mbox 1>;
            mbox-names = "tx", "rx";
            status = "okay";
         };
      };
   };


You must provide a similar configuration for the other side of the
communication (domain or CPU) but you must swap the MBOX channels and  memory
regions (``tx-region`` and ``rx-region``).

Bonding
=======

When the endpoint is registered, the following happens on each domain (or CPU)
connected through the IPC instance:

1. The domain (or CPU) writes a magic number to its ``tx-region`` of the shared
memory.
#. It then sends a signal to the other domain or CPU, informing that the data
has been written. Sending the signal to the other domain or CPU is repeated
with timeout specified by
:kconfig:option:`CONFIG_IPC_SERVICE_ICMSG_BOND_NOTIFY_REPEAT_TO_MS` option.
#. When the signal from the other domain or CPU is received, the magic number
is read from ``rx-region``. If it is correct, the bonding process is finished
and the backend informs the application by calling
:c:member:`ipc_service_cb.bound` callback.

Samples
=======

 - :zephyr:code-sample:`ipc-icmsg`

Part 3

한국어 전문 번역

Inter-core messaging backend(ICMsg)는 무거운 RPMsg static vrings backend보다 가벼운 대안입니다. 작은 memory footprint로 최소 기능을 제공하며 spsc_pbuf 위에 구현됩니다.

Overview

ICMsg backend는 shared memory와 MBOX device로 data를 교환합니다. Shared memory에는 data를 저장하고, MBOX는 data가 기록됐다는 signal을 보냅니다.

Instance 하나에는 endpoint 하나만 등록할 수 있습니다. Application에 communication channel이 둘 이상 필요하면 instance를 여러 개 정의하고 각 instance에 전용 endpoint를 하나씩 둬야 합니다.

Configuration

Backend는 Kconfig와 devicetree로 구성합니다.

  • Memory region 두 개를 정의해 instance의 tx-region과 rx-region에 지정합니다. Region은 다른 영역과 겹치지 않아야 하고 양쪽 domain 또는 CPU가 모두 접근할 수 있어야 합니다.
  • 상대 domain 또는 CPU에 data 기록을 알리는 MBOX device를 정의합니다. 상대편이 이 signal을 받을 수 있어야 합니다.

한쪽 instance의 configuration 예는 다음과 같습니다.

reserved-memory {
   tx: memory@20070000 {
      reg = <0x20070000 0x0800>;
   };

   rx: memory@20078000 {
      reg = <0x20078000 0x0800>;
   };
};

   ipc {
      ipc0: ipc0 {
         compatible = "zephyr,ipc-icmsg";
         tx-region = <&tx>;
         rx-region = <&rx>;
         mboxes = <&mbox 0>, <&mbox 1>;
         mbox-names = "tx", "rx";
         status = "okay";
      };
   };
};

반대편 domain 또는 CPU에도 비슷한 configuration을 제공하되 MBOX channel과 tx-region·rx-region을 서로 바꿔야 합니다.

Bonding

Endpoint를 등록하면 IPC instance로 연결된 각 domain 또는 CPU에서 다음 과정이 진행됩니다.

  1. 자신의 shared memory tx-region에 magic number를 씁니다.
  2. Data가 기록됐음을 알리는 signal을 상대 domain 또는 CPU로 보냅니다. CONFIG_IPC_SERVICE_ICMSG_BOND_NOTIFY_REPEAT_TO_MS에 지정한 timeout으로 이 signal 전송을 반복합니다.
  3. 상대편 signal을 받으면 rx-region에서 magic number를 읽습니다. 값이 올바르면 bonding을 끝내고 ipc_service_cb.bound callback을 호출해 application에 알립니다.

Samples

ICMsg 사용 예는 ipc-icmsg code sample에서 확인할 수 있습니다.

Source

출처

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