How To use MCP2515 CAN BUS module with the Jetson Family

Hello Jetson Community,

I am trying to create a socketcan on the Jetson Nano. For this i have a 3Volt MCP2515 board that uses the SPI protocol. MCP2515 drivers should be included in the linux kernel.

Before i moved to the Jetson, I managed to get everything running on a Raspberry pi. For this i needed to add a few lines to config.txt to manipulate the device tree and i was done.
I assumed i need to do almost the same for my jetsons i am quite shocked at the amount of complicated steps involved. I am not sure if they are still up to date and wanted to verify that the instructions i found also apply to the jetson Nano.

I actually have two Jetsons: One is a Jetson Nano developer board and the other is a TX2 with a XEC2 board.
I read the TX2 has CAN BUS pins already available but on the XEC2 board that i am using they are not part of the breakout. So even for the TX2 i need to use the MCP2515.
Are the steps different for each board? Or can i first try to get it working on the Nano and then move to the TX2? Because the TX2 is much more expensive i wanted to first try everything on the Jetson Nano. Does it even help me if i get the Nano setup first? Is there any transfer knowledge? Maybe i should skip the Nano and go for the TX2 directly? I am not sure about this…

There is an old guide from 2017 that explains how to get the SOCKETCAN working in an TX1 jetson. Can i follow this for the Jetson Nano? The guide mentions that there are problems with the 1.8V output/input on the Jetson and the 3V of the MCP chip. Does the Nano has 1.8V or 3V? They mention a jumper to switch the device to 3V but where can i find this jumper on the Nano?

Here is the old guide:

If you read the guide you will see the line: ‘Old Guide for r24.2’ How do i know if this is still applicable to my board? If i run uname -a i get the following output:

$ uname -a
Linux devnano 4.9.140-tegra #1 SMP PREEMPT Wed Apr 8 18:10:49 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux

What ‘r’ number is that? Can i even follow the guide at all?

Assuming i should follow that guide they mention that i should become familiar with the process of building the kernel. I followed links and ended up with the ‘sdkmanager_1.2.0-6738_amd64.deb’ However i am running arch (manjaro). Is there a way that i can get this to work without access to a debian machine? I assume the PI3 i have is too slow to take over the task of compiling the linux kernel…

This all seems so vague and outdated. I can’t believe this is the right path to use a MCP2515 with a jetson… For the pi it was 3 lines added into config.txt and one reboot. That is why i am thinking i am doing something horribly wrong here. Is there an easier path?

For some reason I can no longer edit my original post to update the link, but here’s the guide for the TX2:

Everything is now done via the device tree and should be mostly identical between the Nano and the TX2.

I recommend downloading the NVIDIA Tegra Linux Driver Package Development Guide for your release and following the “Kernel Customization” section to get started. If you have any questions post back here and I should get a notification.

On second thought you may want to move this topic to the Jetson Nano forums:

How would i move this thread? Its my first one and i was overwhelmed by the extremely specific topics. I thought a driver issue might be the right one. But i am open to move this threat to a more appropriate location.

Back to Topic:

I installed ubuntu version 1804 to an usb stick and worked from that. I installed the nvidia SDKmanager but i don’t know how i make changes to the device tree.

I can choose which board etc via the gui. I decided to download instead of install. But looking through the downloaded files i can’t find any dts or dtb file. Where would i go from here?

I can see the following:
Folders: dist, logs, replays, .updater
Files: sdkm.db, sdkm.log, sdkm-2020-09-09-14-47-48.log, sdkm-2020-09-09-15-06-53.log

How would i go about inserting the device tree changes?

To move it I would simply re-post the question in the appropriate forum and then reply to this thread with a link to the new location. That way anyone that comes across it can follow the link.

The reason you would want to move it is that the Jetson forum devs are very active and knowledgeable about stuff like this.

The first thing you’ll want to do is get the board flashed using the sdk-manager. These boards run on a modified version of linux called L4T (similar to how the Pi runs Rasbian). You won’t have much success running standard Ubuntu.

Unfortunately the SDKManager only runs on Ubuntu 16.04 (and I think maybe 18.04), I have an old laptop set up for that purpose, or you could set up duel boot.

Edit: Woops I overlooked that you already have SDKManager installed. You’ll want to go through the full process to flash and install libraries on your board, once that’s done you can download the sources