How to set up BeagleBone AI with CAN

Hello,

I’ve been trying to figure out how to get the CAN ports configured for the BeagleBone AI. Is there a specific process for getting these ports initiated or are they pre-configured already? I haven’t found much information available for how to get this setup so any information or direction would be appreciated.

Here are two links. But as is the case with most AI questions, these links are for the BB Black, not AI. The BBBlack requires a helper chip to provide the physical interface to CAN.

https://www.element14.com/community/community/designcenter/single-board-computers/next-genbeaglebone/blog/2019/09/29/test-can-bus-on-beaglebone

https://www.thomas-wedemeyer.de/beaglebone-canbus-python.html

Hey BB Community,

This is my first post here. I am also facing the same problem with BB AI 64. Is there any update on how can to integrate CAN with BB AI 64.

Thank you

You will need to hook up some CAN transceivers. Very few boards that have CAN actually include CAN transceivers. This will probably mean doing a custom cape for the BBAI-64 or I have seen some CAN transceiver modules for sale on Amazon. But be careful you will need a 3V capable part. They do exists but many are 5V only. 3V CAN transceiver tend to be in short supply, at least the last time I checked.

Alternatively you can buy USB CAN dongles which will give you a single CAN channel. I have a few of these types of dongles for hooking my laptop up to CAN. They are cheap and appear as native CAN interfaces (requires a firmware update on the dongle usually)

If not using a USB dongle you will also need to setup a custom DTS overlay or modify the root one to enable the interface and set the pin muxing.

Once done the CAN interfaces should become visible when you list network interfaces.

I have a custom cape running 6 CAN interfaces on the BBAI-64. You can get even more if needed although laying them all out on a standard cape would prove challenging.

Hi Benedict,

Thanks for the reply. This sounds helpful.

Best
Shubham

Hello Benedict,

I got hands on CAN transreceiver. However, I am not able to set custom DTS Overlay as no BONE-CAN0.dts file is provided in the /opt/source/DeviceTreeOverlay for version 5.10.x.

Do you have any idea as how can I create a custom DTS file or if it’s already there can you point me in that direction. That would be of great help.

Thank you

Note: I have already tried with BONE-CAN0.dts from version 4.19.x and now my boot is messed-up.

Hello @ss13ms110 ,

I think there are CAN DTS files available but not for 5.10.x-ti-unified (yet) and not for 5.10.x-ti either.

The CAN DTS files may be in other versions of the kernel or within the kernel or within u-boot. I will need to check.

If you drop to 4.19.x, the CAN bus is available and I am pretty sure in 5.4.x too but please do not quote me (that is from poor memory).

Anyway…if you need to have 5.10.x-ti or 5.10.x-ti-unified as your kernel checkout from git, okay. One may have to wait or like you say, one would have to make one. I am sort of new to DTS. This means that I obliterate my board, the BBB, each time I perform DTS actions.

So, yeap.

Seth

P.S. If you guys configure something, that would be neat. I have a transceiver over here collecting dust! oh! I did find this tempting test to try: src/arm/overlays/BBORG_COMMS-00A2.dts · v5.10.x · BeagleBoard.org / BeagleBoard-DeviceTrees · GitLab

That may or may not build. I do not have that Cape currently and it may need some readjusting to handle perfection, i.e. as DTS demands it.

@ss13ms110 ,

Sorry for the misinformation…

I just saw this older post of 16 days ago. I was unaware of your requirements. This is my fault.

I should have not told you what I said if you are using the BBAI-64 and NOT using the BBAI. This is completely my fault.

I take full responsibility of this issue.

Seth

P.S. I thought you were working on the AI and not the AI-64 like the older header stated. I should have read the previous posts. Anyway, I am sorry. I cannot take back what I did and I know now to read more than headers and picking and choosing what I read.

Update

Anyway, I am very sorry and this lax in reading a simple post created this issue. Please view this set of overlays instead: src/arm64/overlays · v5.10.x-ti-unified · BeagleBoard.org / BeagleBoard-DeviceTrees · GitLab

As you can tell, you were right all along. Not one CAN interface in the form of a DTS file is listed…

But, keeping up-to-date on their, the beagleboard.org persons, repo may prove valuable in the future.

Hello Seth,

No problem, I anyways tried that and it didn’t work, But, this gave me an idea as how can I create a CAN dts file for BB AI-64.

I will post an update once it will be working.

Thank you

Best
Shubham

Hello Seth (@silver2row),

Thank you for the help. I was able to utilize this repo to make custom .dts file for CAN on BB AI-64.

Please have a look at this post.

I am still facing some minute error may be you can help.

Thank you

Best
Shubham