Difference between revisions of "CANbus Module"

From Voipac Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
<!-- -->
 
<!-- -->
 
<div style="float:right">__TOC__</div>
 
<div style="float:right">__TOC__</div>
 +
 +
'''''Input:''''' None<br />
 +
'''''Output:''''' Device driver is available
 +
 +
<syntaxhighlight lang="bash">
 +
root@imx8mq-voipac:~# ip addr show dev can0
 +
1: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
 +
    link/can
 +
</syntaxhighlight>
 +
 +
To setup can interface to 500kB bitrate use following command:
 +
<syntaxhighlight lang="bash">
 +
ip link set can0 up type can bitrate 500000
 +
</syntaxhighlight>
 +
 +
To test send data use following command:
 +
<syntaxhighlight lang="bash">
 +
cansend can0 365#AA.11.11
 +
</syntaxhighlight>
 +
 +
To test receiving data use following command:
 +
<syntaxhighlight lang="bash">
 +
candump can0
 +
</syntaxhighlight>
 +
 +
<br /><br />!!!!!!!!!!!!!OLD PART OF THE PAGE!!!!!!!!!!!!
 +
  
 
On this page PCIe card functionality is shown. Both Bluetooth and WiFi operations are tested using dual band Intel AC 3160 wireless card. Mini PCI Express slot must provide PCIe and USB signals to support all the features.
 
On this page PCIe card functionality is shown. Both Bluetooth and WiFi operations are tested using dual band Intel AC 3160 wireless card. Mini PCI Express slot must provide PCIe and USB signals to support all the features.
Line 10: Line 37:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
root@imx8mq-voipac:~# ip addr show dev can0
+
root@imx6-tinyrexpro:~# ip addr show dev can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
+
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
 
     link/can
 
     link/can
root@imx8mq-voipac:~# ip link set can0 type can bitrate 500000
 
root@imx8mq-voipac:~# ip link set can0 up
 
root@imx8mq-voipac:~# cansend can0 01a#01020304
 
interface = can0, family = 29, ty[  434.135862] NOHZ: local_softirq_pending 08
 
pe = 3, proto = 1
 
root@imx8mq-voipac:~#
 
to receive
 
root@imx8mq-voipac:~# candump can0
 
 
</syntaxhighlight><br/>
 
</syntaxhighlight><br/>
  

Latest revision as of 14:49, 25 January 2023

Input: None
Output: Device driver is available

root@imx8mq-voipac:~# ip addr show dev can0
1: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can

To setup can interface to 500kB bitrate use following command:

ip link set can0 up type can bitrate 500000

To test send data use following command:

cansend can0 365#AA.11.11

To test receiving data use following command:

candump can0



!!!!!!!!!!!!!OLD PART OF THE PAGE!!!!!!!!!!!!


On this page PCIe card functionality is shown. Both Bluetooth and WiFi operations are tested using dual band Intel AC 3160 wireless card. Mini PCI Express slot must provide PCIe and USB signals to support all the features.

Input: None
Output: Device driver is available

root@imx6-tinyrexpro:~# ip addr show dev can0
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can


Input: Connect a pair of iMX6 TinyRex Development boards and a couple of dedicated CAN evaluation modules
Output: Boards communicate between each other. Sent messages are received successfully

Board 1 (receiver) commands and outputs:

root@imx6-tinyrexpro:~# ip link set can0 type can bitrate 1000000
root@imx6-tinyrexpro:~# ip link set can0 up
flexcan 2090000.flexcan can0: writing ctrl=0x01232054
root@imx6-tinyrexpro:~# candump can0 &
[1] 833
root@imx6-tinyrexpro:~#   can0  123   [4]  DE AD BE EF

Board 2 (transmitter and receiver) commands and outputs:

root@imx6-tinyrexpro:~# ip link set can0 type can bitrate 1000000
root@imx6-tinyrexpro:~# ip link set can0 up
flexcan 2090000.flexcan can0: writing ctrl=0x01232054
root@imx6-tinyrexpro:~# candump can0 &
[1] 847
root@imx6-tinyrexpro:~# cansend can0 123#DEADBEEF
root@imx6-tinyrexpro:~#   can0  123   [4]  DE AD BE EF