samples/subsys/canbus/isotp/README.html · samples/subsys/canbus/isotp/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · CAN · Transport

ISO-TP library sample

BS 8 long message와 STmin 5 ms short message를 blocking·non-blocking 방식으로 교환합니다.

Official pathsamples/subsys/canbus/isotp/README.html
Source filesamples/subsys/canbus/isotp/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

두 board 요구 사항, TWR-KE18F build와 248-byte receive output을 보존합니다.

Long

BS = 8 frames

Short

STmin = 5 ms

Peers

2 CAN boards

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 33CA8819A4AB7CDCEB1AFA054D719F4ABE61FF7257B482F55F9A1F1BAD7352B5
.. zephyr:code-sample:: isotp
   :name: ISO-TP library
   :relevant-api: can_isotp

   Use ISO-TP library to exchange messages between two boards.

Overview
********
This sample demonstrates how to use the :ref:`ISO-TP library <can_isotp>`.

Messages are exchanged between two boards. A long message, that is sent with
a block-size (BS) of eight frames, and a short one that has a minimal
separation-time (STmin) of five milliseconds.

The send function call for the short message is non-blocking, and the send
function call for the long message is blocking.

Building and Running
********************
Use these instructions with integrated CAN controller like in the NXP TWR-KE18F
or Nucleo-F746ZG board.

For the NXP TWR-KE18F board:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/canbus/isotp
   :board: twr_ke18f
   :goals: build flash

Requirements
************

* Two boards with CAN bus support, connected together

Sample output
=============
.. code-block:: console

    Start sending data
    [00:00:00.000,000] <inf> can_driver: Init of CAN_1 done
    ========================================
    |   ____  ___  ____       ____  ____   |
    |  |_  _|/ __||    | ___ |_  _||  _ \  |
    |   _||_ \__ \| || | ___   ||  | ___/  |
    |  |____||___/|____|       ||  |_|     |
    ========================================
    Got 248 bytes in total
    This is the sample test for the short payload
    TX complete cb [0]

.. note:: The values shown above might differ.

Part 3

한국어 전문 번역

개요

두 board 사이에서 message를 교환하며 ISO-TP library를 사용하는 방법을 보여 주는 sample입니다. 관련 API는 can_isotp입니다.

Long message는 block size(BS) 8 frame으로 보내고, short message는 minimum separation time(STmin) 5 ms로 보냅니다. BS는 receiver의 다음 flow-control을 기다리기 전에 연속으로 보낼 frame 수를 제한하고, STmin은 consecutive frame 사이 최소 간격을 정합니다.

Short message의 send function call은 non-blocking이라 전송 완료를 기다리지 않고 돌아오며, long message의 send function call은 blocking이라 전송 절차가 끝날 때까지 기다립니다.

빌드 및 실행

NXP TWR-KE18F 또는 Nucleo-F746ZG처럼 integrated CAN controller가 있는 board에서 이 절차를 사용합니다. 다음은 NXP TWR-KE18F용 build·flash command입니다.

# From the root of the zephyr repository
west build -b twr_ke18f samples/subsys/canbus/isotp
west flash

요구 사항

  • CAN bus를 지원하고 서로 CAN wiring으로 연결된 board 두 대

출력 예

Start sending data
[00:00:00.000,000] <inf> can_driver: Init of CAN_1 done
========================================
|   ____  ___  ____       ____  ____   |
|  |_  _|/ __||    | ___ |_  _||  _ \  |
|   _||_ \__ \| || | ___   ||  | ___/  |
|  |____||___/|____|       ||  |_|     |
========================================
Got 248 bytes in total
This is the sample test for the short payload
TX complete cb [0]

CAN_1 initialization 뒤 248 byte long payload를 받은 결과와 short payload text, non-blocking transmission completion callback의 status 0을 확인할 수 있습니다. Timestamp와 실제 값은 실행마다 달라질 수 있습니다.

Source

출처

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