Lines Matching +full:can +full:- +full:transceiver

1 .. zephyr:code-sample:: canopennode
9 stack can be used in Zephyr.
11 CANopen is an internationally standardized (`EN 50325-4`_, `CiA 301`_)
13 systems used in automation. CANopenNode is a 3rd party, open-source
17 demonstrates the use of non-volatile storage for the CANopen object
23 * A board with CAN bus and flash support
24 * Host PC with CAN bus support
31 .. code-block:: console
33 west config manifest.project-filter +canopennode
36 Building and Running for TWR-KE18F
38 The :zephyr:board:`twr_ke18f` board is equipped with an onboard CAN
39 transceiver. This board supports CANopen LED indicators (red and green
40 LEDs). The sample can be built and executed for the TWR-KE18F as
43 .. zephyr-app-commands::
44 :zephyr-app: samples/modules/canopennode
52 Building and Running for FRDM-K64F
54 The :zephyr:board:`frdm_k64f` board does not come with an onboard CAN
55 transceiver. In order to use the CAN bus on the FRDM-K64F board, an
56 external CAN bus transceiver must be connected to ``PTB18``
60 The sample can be built and executed for the FRDM-K64F as follows:
62 .. zephyr-app-commands::
63 :zephyr-app: samples/modules/canopennode
73 The :zephyr:board:`stm32f072b_disco` board does not come with an onboard CAN
74 transceiver. In order to use the CAN bus on the STM32F072RB Discovery board, an
75 external CAN bus transceiver must be connected to ``PB8`` (``CAN_RX``) and
79 The sample can be built and executed for the STM32F072RB Discovery as follows:
81 .. zephyr-app-commands::
82 :zephyr-app: samples/modules/canopennode
92 The :zephyr:board:`stm32f3_disco` board does not come with an onboard CAN
93 transceiver. In order to use the CAN bus on the STM32F3 Discovery board, an
94 external CAN bus transceiver must be connected to ``PD1`` (``CAN_TX``) and
98 The sample can be built and executed for the STM32F3 Discovery as follows:
100 .. zephyr-app-commands::
101 :zephyr-app: samples/modules/canopennode
111 The sample cannot run if the <erase-block-size> of the flash-controller exceeds 0x10000.
112 Typically nucleo_h743zi with erase-block-size = <DT_SIZE_K(128)>;
117 The sample can be built for boards without a flash storage partition by using a different configura…
119 .. zephyr-app-commands::
120 :zephyr-app: samples/modules/canopennode
128 CANopen communication between the host PC and Zephyr can be
131 the host PC and Zephyr. First, install python-canopen along with the
132 python-can backend as follows:
134 .. code-block:: console
136 pip3 install --user canopen python-can
138 Next, configure python-can to use your CAN adapter through its
142 .. code-block:: console
151 Please refer to the `python-can`_ documentation for further details
154 Finally, bring up the CAN interface on the test PC. On GNU/Linux, this
155 can be done as follows:
157 .. code-block:: console
159 sudo ip link set can0 type can bitrate 125000 restart-ms 100
163 examples, you can monitor the CAN traffic from the host PC. On
164 GNU/Linux, this can be accomplished using ``candump`` from the
165 `can-utils`_ package as follows:
167 .. code-block:: console
173 Changing the Network Management (NMT) state of the node can be
176 .. code-block:: py
199 node.nmt.state = 'PRE-OPERATIONAL'
223 name) can be accomplished using the following Python code:
225 .. code-block:: py
249 .. code-block:: console
257 can be accomplished using the following Python code:
259 .. code-block:: py
276 reboots = node.sdo['Power-on counter']
278 # Set heartbeat interval without saving to non-volatile storage
280 print("Power-on counter: {}".format(reboots.raw))
288 print("Power-on counter: {}".format(reboots.raw))
290 # Set interval and store it to non-volatile storage
299 print("Power-on counter: {}".format(reboots.raw))
306 print("Power-on counter: {}".format(reboots.raw))
312 .. code-block:: console
315 Power-on counter: 1
318 Power-on counter: 2
321 Power-on counter: 3
323 Power-on counter: 4
325 Note that the power-on counter value may be different.
331 press counter) can be accomplished using the following Python code:
333 .. code-block:: py
354 # Enter pre-operational state to map TPDO
355 node.nmt.state = 'PRE-OPERATIONAL'
381 .. code-block:: console
399 Building and Running for FRDM-K64F
401 The sample can be rebuilt with MCUboot and program download support
402 for the FRDM-K64F as follows:
406 .. zephyr-app-commands::
408 :zephyr-app: samples/modules/canopennode
411 :west-args: --sysbuild
412 :gen-args: -Dcanopennode_CONF_FILE=prj_img_mgmt.conf -DSB_CONFIG_BOOTLOADER_MCUBOOT=y
417 .. code-block:: console
419 west flash --skip-rebuild
423 .. code-block:: console
425 west flash --skip-rebuild --domain canopennode --runner canopen --confirm-only
429 .. code-block:: console
431 west flash --skip-rebuild --domain canopennode --runner canopen
435 The CANopen object dictionary used in this sample application can be
437 the Zephyr tree. The object dictionary can be modified using any
444 project file can be opened and modified, and new implementation files
446 :zephyr_file:`samples/modules/canopennode/objdict/CO_OD.c`) can be
447 generated. The EDS editor can also export an updated Electronic Data
454 .. _EN 50325-4:
455 https://can-cia.org/cia-groups/international-standardization/
458 https://can-cia.org/cia-groups/technical-documents/
463 .. _python-can:
464 https://python-can.readthedocs.io/
466 .. _can-utils:
467 https://github.com/linux-can/can-utils