1.. zephyr:code-sample:: can-babbling 2 :name: Controller Area Network (CAN) babbling node 3 :relevant-api: can_interface 4 5 Simulate a babbling CAN node. 6 7Overview 8******** 9 10In a Controller Area Network a babbling node is a node continuously (and usually erroneously) 11transmitting CAN frames with identical - often high - priority. This constant babbling blocks CAN 12bus access for any CAN frame with lower priority as these frames will loose the bus arbitration. 13 14This sample application simulates a babbling CAN node. The properties of the CAN frames sent are 15configurable via :ref:`Kconfig <kconfig>`. The frames carry no data as only the arbitration part of 16the CAN frame is of interest. 17 18Being able to simulate a babbling CAN node is useful when examining the behavior of other nodes on 19the same CAN bus when they constantly loose bus arbitration. 20 21The source code for this sample application can be found at: 22:zephyr_file:`samples/drivers/can/babbling`. 23 24Requirements 25************ 26 27This sample requires a board with a CAN controller. The CAN controller must be configured using the 28``zephyr,canbus`` :ref:`devicetree <dt-guide>` chosen node property. 29 30The sample supports an optional button for stopping the babbling. If present, the button must be 31configured using the ``sw0`` :ref:`devicetree <dt-guide>` alias, usually in the :ref:`BOARD.dts file 32<devicetree-in-out-files>`. 33 34Building and Running 35******************** 36 37Example building for :ref:`twr_ke18f`: 38 39.. zephyr-app-commands:: 40 :zephyr-app: samples/drivers/can/babbling 41 :board: twr_ke18f 42 :goals: build flash 43 44Sample output 45============= 46 47.. code-block:: console 48 49 *** Booting Zephyr OS build zephyr-v3.1.0-4606-g8c1efa8b96bb *** 50 babbling on can@40024000 with standard (11-bit) CAN ID 0x010, RTR 0, CAN-FD 0 51 abort by pressing User SW3 button 52