How write or use Can Bus driver on BBB with Ubuntu?

1,533 views
Skip to first unread message

Onur Duran

unread,
Aug 28, 2015, 5:42:41 AM8/28/15
to BeagleBoard
Hi,
I want to use Can Bus module but I didn't find any driver for CAN Bus.Have you any suggestion on  this topic?  I think I must write driver code for the CAN BUS driver. what do you think ? 

I researched  lot this topic and  only at this web site i find example but this example wrote Erlang programming language.(  http://www.embedded-things.com/bbb/enable-canbus-on-the-beaglebone-black/  )
But that wrote for the enable CAN Bus İ have to  do   patched device tree compiler.Then for patching i connect this webpage   http://www.embedded-things.com/bbb/patching-the-device-tree-compiler-for-ubuntu/    there explain  with  some steps .However  at second steps  they write this command git clone http://jdl.com/software/dtc.git/

but there website removed and i couldn't download dtc on that webpage.Then i found different sites and download there dtc files.(http://git.qemu.org/?p=dtc.git;a=summary) but when i want to suply third steps so i try this command
git reset --hard f8cb5dd94903a5cfa1609695328b8f1d5557367f
ubuntu gave this error. HEAD is now at f8cb5dd utilfdt_read_err: use xmalloc funcs

Then i found https://groups.google.com/forum/#!topic/beagleboard/vCh6ed9ZATk this page and try Robert Nelson's steps but condition don't change i get same error.
 
Please Help me for this topic What can i use Can Bus Module on Beaglebone Black?
Kind Regards

 


Andrew P. Lentvorski

unread,
Aug 28, 2015, 9:53:08 AM8/28/15
to BeagleBoard
Well, you need a CAN cape of some form to provide a CAN transceiver.  Something like this:

After that, follow the directions that the manufacturer provides.

Onur Duran

unread,
Aug 29, 2015, 2:52:21 AM8/29/15
to BeagleBoard
Thank you Andrew  for your suggestion.But i don't  want to  use any extra hardware.I want to use direct BBB.Wonder if i couldn't find  Can Bus  driver for BBB ?

28 Ağustos 2015 Cuma 16:53:08 UTC+3 tarihinde Andrew P. Lentvorski yazdı:

William Hermans

unread,
Aug 29, 2015, 4:29:58 AM8/29/15
to beagl...@googlegroups.com
Thank you Andrew  for your suggestion.But i don't  want to  use any extra hardware.I want to use direct BBB.Wonder if i couldn't find  Can Bus  driver for BBB ?

Good luck with that. It is my understanding that you *have* to have a cape, or at minimum logic level translation in order to use the canbus on the BBB. Otherwise, the canbus behaves as if it's non functional.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew P. Lentvorski

unread,
Aug 30, 2015, 4:48:21 AM8/30/15
to BeagleBoard
You don't get a choice.  CAN *requires* a transceiver to convert from the TX/RX signals on the Beaglebone into the differential bus dominant/recessive that is the physical layer for CAN.

In addition, you must have *TWO* can nodes in order to test communication.  CAN *requires* an ACK before it will release the transmit buffer.

I would really suggest that you start with something simpler like SPI or I2C (both of which can be used directly off of the Beaglebone connectors).  CAN isn't hard, but it's not for beginners either.

If you just want to play with the CAN protocol, use the Linux virtual can drivers.  However, those won't put any signals "on the wire" so to speak as they truly are "virtual".

Side note: wireshark is capable of decoding CAN packets and even the SocketCAN protocol!

William Hermans

unread,
Aug 30, 2015, 11:37:14 AM8/30/15
to BeagleBoard
Side note: wireshark is capable of decoding CAN packets and even the SocketCAN protocol!

This is something I guess I'll never get. Whats the point ? socketcan frames only have up to 8 byte data payloads . . .candump, and a good eye for your data is all that is needed.

Onur Duran

unread,
Aug 31, 2015, 2:35:02 AM8/31/15
to BeagleBoard
Hi Andrew ,
I think you misunderstand me.I couldn't active BBB's CAN  legs.So i couldn't use CAN .Then i couldn't find to using of CAN Bus with BBB .So  i want to learn  Beaglebones Black's how to  CAN leg  could do active and starting  communication.But  at this link commands didn't work.(http://www.embedded-things.com/bbb/enable-canbus-on-the-beaglebone-black/)

30 Ağustos 2015 Pazar 11:48:21 UTC+3 tarihinde Andrew P. Lentvorski yazdı:

Andrew P. Lentvorski

unread,
Aug 31, 2015, 3:14:24 AM8/31/15
to BeagleBoard
In the comments from the linked article you have this message:

which cape is this tutorial for? I also have several TowerTech Can capes. http://circuitco.com/support/index.php?title=TT3201_CAN_Cape

To which the original author responds:

I did not use any cape when making this tutorial, I simply hooked up a CAN transceiver to the relevant pins. However, I see now reason why it shouldn't work with the cape, it may simply be a device tree conflict.


Note the need for a CAN transceiver. If you don't get this, you can't even start.

Andrew P. Lentvorski

unread,
Aug 31, 2015, 3:18:18 AM8/31/15
to BeagleBoard
Huh?  CANOpen/SocketCAN SDO transactions can have almost indefinite extent, have toggle bits that persist across frames, and CRC's that span the whole transaction.

If you can eyeball that, you are way smarter than me.

I think you may only be considering PDO transactions which are only ever 8 bytes max.

Onur Duran

unread,
Sep 1, 2015, 5:14:47 AM9/1/15
to BeagleBoard
Hi Mr Hermans
I could work cansend command but i couldn't see outgoing data.Could I see datas with oscilloscope? I tried but couldn't see anything  wonder if what's wrong 

30 Ağustos 2015 Pazar 18:37:14 UTC+3 tarihinde William Hermans yazdı:
Reply all
Reply to author
Forward
0 new messages