Part 1
요약·해설
Kconfig frame 속성, chosen CAN controller와 중단 button 조건을 설명합니다.
Continuous CAN frames
No data
Optional sw0
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
8D081858528AFE4F218270C2BD22564170FB721A632E11CD4915D3A31F13A6AB
.. zephyr:code-sample:: can-babbling
:name: Controller Area Network (CAN) babbling node
:relevant-api: can_interface
Simulate a babbling CAN node.
Overview
********
In a Controller Area Network a babbling node is a node continuously (and usually erroneously)
transmitting CAN frames with identical - often high - priority. This constant babbling blocks CAN
bus access for any CAN frame with lower priority as these frames will loose the bus arbitration.
This sample application simulates a babbling CAN node. The properties of the CAN frames sent are
configurable via :ref:`Kconfig <kconfig>`. The frames carry no data as only the arbitration part of
the CAN frame is of interest.
Being able to simulate a babbling CAN node is useful when examining the behavior of other nodes on
the same CAN bus when they constantly loose bus arbitration.
The source code for this sample application can be found at:
:zephyr_file:`samples/drivers/can/babbling`.
Requirements
************
This sample requires a board with a CAN controller. The CAN controller must be configured using the
``zephyr,canbus`` :ref:`devicetree <dt-guide>` chosen node property.
The sample supports an optional button for stopping the babbling. If present, the button must be
configured using the ``sw0`` :ref:`devicetree <dt-guide>` alias, usually in the :ref:`BOARD.dts file
<devicetree-in-out-files>`.
Building and Running
********************
Example building for :ref:`twr_ke18f`:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/can/babbling
:board: twr_ke18f
:goals: build flash
Sample output
=============
.. code-block:: console
*** Booting Zephyr OS build zephyr-v3.1.0-4606-g8c1efa8b96bb ***
babbling on can@40024000 with standard (11-bit) CAN ID 0x010, RTR 0, CAN FD 0
abort by pressing User SW3 button
Part 3
한국어 전문 번역
개요
Controller Area Network에서 babbling node란 동일하고 대개 우선순위가 높은 CAN frame을 계속, 보통은 오류로 전송하는 node입니다. 이처럼 끊임없이 전송하면 우선순위가 더 낮은 CAN frame은 bus arbitration에서 패배하므로 CAN bus에 접근하지 못합니다.
이 sample application은 babbling CAN node를 모의합니다. 전송할 CAN frame의 속성은 Kconfig로 구성할 수 있습니다. 관심 대상은 CAN frame의 arbitration 부분뿐이므로 frame에는 data를 싣지 않습니다.
Babbling CAN node를 모의할 수 있으면, 같은 CAN bus에 있는 다른 node가 계속 bus arbitration에서 패배할 때 어떻게 동작하는지 조사하는 데 유용합니다.
이 sample application의 source code는 samples/drivers/can/babbling에서 찾을 수 있습니다.
요구 사항
이 sample에는 CAN controller가 있는 board가 필요합니다. CAN controller는 devicetree의 zephyr,canbus chosen node property로 구성해야 합니다.
Babbling을 중단하는 선택적 button도 지원합니다. Button이 있다면 보통 BOARD.dts 파일에서 devicetree의 sw0 alias로 구성해야 합니다.
Build와 실행
twr_ke18f용 build 예는 다음과 같습니다.
# From the root of the zephyr repository
west build -b twr_ke18f samples/drivers/can/babbling
west flash
Sample 출력
*** Booting Zephyr OS build zephyr-v3.1.0-4606-g8c1efa8b96bb ***
babbling on can@40024000 with standard (11-bit) CAN ID 0x010, RTR 0, CAN FD 0
abort by pressing User SW3 button
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.