Skip to content

Instantly share code, notes, and snippets.

@pdp7
Last active April 20, 2019 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdp7/09fdbcc332eae59fe4e05eb6f7647c78 to your computer and use it in GitHub Desktop.
Save pdp7/09fdbcc332eae59fe4e05eb6f7647c78 to your computer and use it in GitHub Desktop.
Macchina: SWCAN with PocketBeagle and M2

Macchina PocketBeagle M2

debian@beaglebone:~$ dmesg |grep -i can |grep -v Cannot
[    1.222748] CAN device driver interface
[    1.223974] c_can_platform 481cc000.can: c_can_platform device registered (regs=fa1cc000, irq=39)
[    1.224890] c_can_platform 481d0000.can: c_can_platform device registered (regs=fa1d0000, irq=40)
[    1.339441] can: controller area network core (rev 20170425 abi 9)
[   36.260718] mcp251x spi2.1 can2: MCP2515 successfully initialized.
debian@beaglebone:~$ uname -r
4.14.79-ti-r82
debian@beaglebone:~$ cat /etc/dogtag 
BeagleBoard.org Debian Image 2018-11-11
debian@beaglebone:~$ cat /etc/debian_version 
9.6
debian@beaglebone:~$ sudo ip link set can2 type can bitrate 500000 listen-only on
[sudo] password for debian: 
debian@beaglebone:~$ sudo ifconfig can2 up
debian@beaglebone:~$ sudo ifconfig can2
can2: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 19132  bytes 102192 (99.7 KiB)
        RX errors 848  dropped 0  overruns 0  frame 848
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
debian@beaglebone:~$ dmesg
[  593.971347] can: raw protocol (rev 20170425)

debian@beaglebone:~$ candump -cae can2,0:0,#FFFFFFFF |head -25
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       1D5   [8]  remote request
  can2       5EF   [0]                            ''
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       1D5   [8]  remote request
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       1D5   [8]  remote request
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       1D5   [8]  remote request
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       5EF   [0]                            ''
  can2       1D5   [8]  remote request
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       5EF   [0]                            ''
  can2       1D5   [8]  remote request
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       1D5   [8]  remote request
  can2  1DC41FE6   [8]  7F 23 71 C7 6F CF D6 FB   '.#q.o...'
  can2       5EF   [0]                            ''
  can2       1D5   [8]  remote request
  can2       5EF   [0]                            ''
  can2       1D5   [8]  remote request
  can2       5EF   [0]                            ''
  can2       1D5   [8]  remote request
@pdp7
Copy link
Author

pdp7 commented Apr 20, 2019

Josh:

Look at PB adapter connector J3 pin 9 is M0, J3 pin 28 is M1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment