Lines Matching +full:rx +full:- +full:data +full:- +full:mode
31 timing for the CAN FD data phase).
38 For example, building the :zephyr:code-sample:`hello_world` sample for the :zephyr:board:`frdm_k64f…
41 .. zephyr-app-commands::
42 :zephyr-app: samples/hello_world
44 …:gen-args: -DCONFIG_SHELL=y -DCONFIG_CAN=y -DCONFIG_CAN_SHELL=y -DCONFIG_STATS=y -DCONFIG_CAN_STAT…
48 interact with the shell. The CAN shell comes with built-in help (unless
49 :kconfig:option:`CONFIG_SHELL_HELP` is disabled). The built-in help messages can be printed by
50 passing ``-h`` or ``--help`` to the ``can`` command or any of its subcommands. All subcommands also
51 support tab-completion of their arguments.
55 also supports tab-completion. A list of all devices available can be obtained using the ``device
64 RX filters supported, capabilities, current mode, current state, error counters, timing limits, and
67 .. code-block:: console
74 capabilities: normal loopback listen-only fd
75 mode: normal
77 rx errors: 0
80 timing data: sjw 1..16, prop_seg 0..0, phase_seg1 1..32, phase_seg2 1..16, prescaler 1..32
90 rx overruns: 0
98 The CAN shell allows for configuring the CAN controller mode and timing, along with starting and
102 The CAN controller mode and timing can only be changed while the CAN controller is stopped, which
103 is the initial setting upon boot-up. The initial CAN controller mode is set to ``normal`` and the
104 initial timing is set according to the ``bitrate``, ``sample-point``, ``bitrate-data``, and
105 ``sample-point-data`` :ref:`devicetree` properties.
113 .. code-block:: console
118 If :kconfig:option:`CONFIG_CAN_FD_MODE` is enabled, the data phase bitrate can be configured using
121 .. code-block:: console
124 setting data bitrate to 1000000 bps
134 Mode subsection
137 The CAN shell allows for setting the mode of the CAN controller using the ``can mode``
138 subcommand. An example for enabling loopback mode is shown below.
140 .. code-block:: console
142 uart:~$ can mode can@0 loopback
143 setting mode 0x00000001
145 The subcommand accepts multiple modes given on the same command line (e.g. ``can mode can@0 fd
146 loopback`` for setting CAN FD and loopback mode). Vendor-specific modes can be specified in
152 After the timing and mode has been configured as needed, the CAN controller can be started using the
155 .. code-block:: console
160 Prior to reconfiguring the timing or mode, the CAN controller needs to be stopped using the ``can
163 .. code-block:: console
171 In order to receive CAN frames, one or more CAN RX filters need to be configured. CAN RX filters are
177 .. code-block:: console
180 …adding filter with standard (11-bit) CAN ID 0x010, CAN ID mask 0x7ff, data frames 1, RTR frames 0,…
183 The filter ID (0 in the example above) returned is to be used when removing the CAN RX filter.
187 .. code-block:: console
189 # Dev Flags ID Size Data bytes
190 can0 -- 010 [8] 01 02 03 04 05 06 07 08
191 can0 B- 010 [08] 01 02 03 04 05 06 07 08
193 can0 -- 00000010 [0]
194 can0 -- 010 [1] 20
195 can0 -- 010 [8] remote transmission request
207 in error-passive state.
208 * ``-``: Unset flag.
212 * ``010``: The standard (11-bit) CAN ID of the frame in hexadecimal format, here 10h.
213 * ``00000010``: The extended (29-bit) CAN ID of the frame in hexadecimal format, here 10h.
217 * ``[8]``: The number of frame data bytes in decimal format, here a classic CAN frame with 8 data
219 * ``[08]``: The number of frame data bytes in decimal format, here a CAN FD frame with 8 data
222 * Data bytes
224 * ``01 02 03 04 05 06 07 08``: The frame data bytes in hexadecimal format, here the numbers from 1
227 carries no data bytes.
231 timestamp from the free-running timestamp counter in the CAN controller.
233 Configured CAN RX filters can be removed again using the ``can filter remove`` subcommand as shown
237 .. code-block:: console
246 subcommand accepts a CAN ID in hexadecimal format and optionally a number of data bytes, also
250 .. code-block:: console
253 enqueuing CAN frame #2 with standard (11-bit) CAN ID 0x010, RTR 0, CAN FD 0, BRS 0, DLC 8
259 The ``can recover`` subcommand can be used for initiating manual recovery from a CAN bus-off event
262 .. code-block:: console