Difference between revisions of "UCM-iMX95 Yocto Linux: CAN"
(Created page with "=CAN bus= CAN bus interface is available on the evaluation board on header '''P17'''.<br> CAN bus on-board termination can be enabled by shorting jumper '''E6'''.<br> For more...") |
|||
Line 1: | Line 1: | ||
=CAN bus= | =CAN bus= | ||
CAN bus interface is available on the evaluation board on header '''P17'''.<br> | CAN bus interface is available on the evaluation board on header '''P17'''.<br> | ||
− | |||
For more details, please refer to the [[UCM-iMX95:_Evaluation_Kit:_Hardware_Guide#CAN_bus|Hardware Guide]] | For more details, please refer to the [[UCM-iMX95:_Evaluation_Kit:_Hardware_Guide#CAN_bus|Hardware Guide]] | ||
− | == | + | ==Operation Example== |
− | * | + | * Obtain another board with CAN |
+ | * Short jumper E6 | ||
+ | * Connect: | ||
+ | <pre> | ||
+ | DUT Device 2 | ||
+ | CAN_H (pin 2) -------- CAN_H | ||
+ | CAN_L (pin 6) -------- CAN_L | ||
+ | </pre> | ||
* Configure both CAN interface bit-rate to 1 Mbit/sec: | * Configure both CAN interface bit-rate to 1 Mbit/sec: | ||
<pre> | <pre> | ||
ip link set can0 up type can bitrate 1000000 | ip link set can0 up type can bitrate 1000000 | ||
</pre> | </pre> | ||
− | * On | + | * On both system, listen to received data frames as well as error frames: |
− | + | candump any,0:0,#FFFFFFFF & | |
− | candump any,0:0,#FFFFFFFF | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | * | + | * Send data from one system and expect to receive it on the other: |
− | + | :* Standard frame: | |
− | cangen -g 50 -e -D r -v can0 | + | cansend can0 111#1122334455667788 |
− | + | :* Extended frame: | |
− | + | cansend can0 11111111#1122334455667788 | |
− | + | :* Generate 50 random extended frames with 50 msec interval between each: | |
− | + | cangen -g 50 -e -D r -v can0 -n 50 | |
− | + | * Disable the interfaces: | |
− | + | ip link set can0 down | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:Yocto]] | [[Category:Yocto]] | ||
[[Category:UCM-iMX95]] | [[Category:UCM-iMX95]] |
Latest revision as of 10:05, 19 February 2025
CAN bus
CAN bus interface is available on the evaluation board on header P17.
For more details, please refer to the Hardware Guide
Operation Example
- Obtain another board with CAN
- Short jumper E6
- Connect:
DUT Device 2 CAN_H (pin 2) -------- CAN_H CAN_L (pin 6) -------- CAN_L
- Configure both CAN interface bit-rate to 1 Mbit/sec:
ip link set can0 up type can bitrate 1000000
- On both system, listen to received data frames as well as error frames:
candump any,0:0,#FFFFFFFF &
- Send data from one system and expect to receive it on the other:
- Standard frame:
cansend can0 111#1122334455667788
- Extended frame:
cansend can0 11111111#1122334455667788
- Generate 50 random extended frames with 50 msec interval between each:
cangen -g 50 -e -D r -v can0 -n 50
- Disable the interfaces:
ip link set can0 down