Lines Matching +full:power +full:- +full:state +full:- +full:name
1 .. zephyr:code-sample:: canopennode
2 :name: CANopenNode
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
31 .. code-block:: console
33 west config manifest.project-filter +canopennode
36 Building and Running for TWR-KE18F
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
55 transceiver. In order to use the CAN bus on the FRDM-K64F board, an
60 The sample can be built and executed for the FRDM-K64F as follows:
62 .. zephyr-app-commands::
63 :zephyr-app: samples/modules/canopennode
81 .. zephyr-app-commands::
82 :zephyr-app: samples/modules/canopennode
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)>;
119 .. zephyr-app-commands::
120 :zephyr-app: samples/modules/canopennode
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
157 .. code-block:: console
159 sudo ip link set can0 type can bitrate 125000 restart-ms 100
165 `can-utils`_ package as follows:
167 .. code-block:: console
171 NMT State Changes
173 Changing the Network Management (NMT) state of the node can be
176 .. code-block:: py
195 node.nmt.state = 'STOPPED'
199 node.nmt.state = 'PRE-OPERATIONAL'
203 node.nmt.state = 'OPERATIONAL'
207 node.nmt.state = 'RESET COMMUNICATION'
211 node.nmt.state = 'RESET'
216 Running the above Python code will update the NMT state of the node
223 name) can be accomplished using the following Python code:
225 .. code-block:: py
241 name = node.sdo['Manufacturer device name']
243 print("Device name: '{}'".format(name.raw))
249 .. code-block:: console
251 Device name: 'Zephyr RTOS/CANopenNode'
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))
285 node.nmt.state = 'RESET'
288 print("Power-on counter: {}".format(reboots.raw))
290 # Set interval and store it to non-volatile storage
296 node.nmt.state = 'RESET'
299 print("Power-on counter: {}".format(reboots.raw))
303 node.nmt.state = 'RESET'
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.
333 .. code-block:: py
354 # Enter pre-operational state to map TPDO
355 node.nmt.state = 'PRE-OPERATIONAL'
365 node.nmt.state = 'OPERATIONAL'
381 .. code-block:: console
399 Building and Running for FRDM-K64F
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
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