Lines Matching +full:host +full:- +full:interface

3 Controller Area Network (CAN) Host Tests
9 This test suite uses `python-can`_ for testing Controller Area Network (CAN) communication between a
10 host PC (running :ref:`Twister <twister_script>`) and a device under test (DUT) running Zephyr.
17 * The python-can library installed on the host PC.
18 * A CAN fixture creating a CAN bus between the host PC and the DUT.
25 the ``bitrate`` and ``bitrate-data`` CAN controller devicetree properties if needed. Default
29 The host end of the CAN fixture can be configured through python-can. Available configuration
30 options depend on the type of host CAN adapter used. The python-can library provides a lot of
31 flexibility for configuration as decribed in the `python-can configuration`_ page, all centered
35 * By default, the python-can configuration context is not specified, causing python-can to use the
38 ``:`` (i.e. specify fixture ``can:zcan0`` to use the ``zcan0`` python-can configuration context).
39 * The configuration context can be overridden using the ``--can-context`` test suite argument
40 (i.e. run ``twister`` with the ``--pytest-args=--can-context=zcan0`` argument to use the ``zcan0``
41 python-can configuration context).
50 (vcan) providing a virtual CAN interface named ``zcan0``.
52 On the host PC, a virtual SocketCAN interface needs to be created and brought up before running the
55 .. code-block:: shell
60 Next, python-can needs to be configured for the ``zcan0`` interface. One option is to use a
63 .. code-block:: ini
66 interface = socketcan
70 Once the virtual SocketCAN interface has been created, brought up, and configured the test suite can
73 .. code-block:: shell
75 west twister -v -p native_sim/native/64 -X can:zcan0 -T tests/drivers/can/host/
77 After the test suite has completed, the virtual SocketCAN interface can be removed again:
79 .. code-block:: shell
86 Running the test suite on hardware requires a physical CAN adapter connected to the host PC. The CAN
87 adapter must be supported by python-can. The examples below assumes using a Linux SocketCAN
88 interface named ``can0``. For other platforms/adapters, please see the `python-can`_ documentation.
95 .. code-block:: shell
98 sudo ip link set can0 type can restart-ms 1000 bitrate 125000 dbitrate 1000000 fd on
101 Next, python-can needs to be configured for the ``can0`` interface. One option is to use a dedicated
104 .. code-block:: ini
107 interface = socketcan
112 Once the SocketCAN interface has been brought up and configured the test suite can be launched using
115 .. code-block:: shell
117 …west twister -v -p lpcxpresso55s36/lpc55s36 --device-testing --device-serial /dev/ttyACM0 -X can:c…
119 After the test suite has completed, the SocketCAN interface can be brought down again:
121 .. code-block:: shell
125 .. _python-can:
126 https://python-can.readthedocs.io
128 .. _python-can configuration:
129 https://python-can.readthedocs.io/en/stable/configuration.html