Jetson nano and mcp2515 can module

Thank you for your reply @jetson_spi . I will try your solution next week and share the results
@shgarg Can you prepare a documentation explaining how to integrate the MCP2515 into the Jetson
Nano, regardless of the crystal frequency on it? In particular, answering the following questions:
1-) What changes need to be made to Jetson nano for the 8 mhz crystal MCP2515? What are these changes in order?
2-) Or is it enough just to change the crystal on the MCP to 10mhz?

In JP4.5, MCP dtb has default 20MHz MCP clock frequency set and 10MHZ SPI frequency.
If you want to change:
go to the Jetpack Linux_for_Tegra folder.

  1. sudo dtc -I dtb kernel/dtb/tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo -o mcp_local.dts
  2. open mcp_local.dts and change frequencies (note in dts, freq are in hex)
  3. Convert it back to dtbo:
    sudo dtc -I dts mcp_local.dts -O dtb -o kernel/dtb/tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo
  4. Now copy this dtbo to target under /boot/ and rerun jetson-io

For the people whose MCP is not getting initialized:

  1. Make sure your connections are perfect and it’s fine to use 3.3V
  2. Follow this doc:
    Note: You do not need any updated driver.

For the people who sees MCP initialized successfully and interrupts assigned correctly under /proc/interrupts but no communication.
I would like to know few things:

  1. Can you make sure 120 ohm termination is there on the bus
  2. Can you see any activities on CAN bus when you send messages I believe messages are getting sent but no interrupts are getting received from HW. You can also make sure this by probing INT line of MCP and see if it is going low anytime during cansend.

Hi shgarg ,

it fails while converting dtb to dts file. there is terminal output

dtc: livetree.c:521: get_node_by_phandle: Assertion `(phandle != 0) && (phandle != -1)' failed.
Aborted (core dumped)

Hi baris, that’s why I asked to convert from Linux_for_Tegra folder. Is this output coming from the same place or you are trying from the target location (/boot/ folder) ?

Hi shgarg,
I tried both of them and give same output. /boot/folder and Linux_for_Tegra/kernel I recive same output.
What I did after configuration of jetson-io tool it creates new file under /boot which name is “kernel_tegra210-p3448-0000-p3449-0000-b00-mcp251x-can-controller.dtb” I convert this file to dts and make change for frequency. After that convert to dtb again and copy back to under /boot folder.
I can see the result with “ip -d -s link show can0” terminal command
When I did any cansend command I couldnt see any increament packets
can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE restart-ms 0
bitrate 125000 sample-point 0.875
tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
mcp251x: tseg1 3…16 tseg2 2…8 sjw 1…4 brp 1…64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0

Hi baris,
For the communication failure, I am not in front of the HW to probe the lines. Am also trying to figure out why we are not receiving interrupts. To help in debugging, can you check if there is any activity on the CAN bus H and L pins. Can you probe the pins and capture scope shots?
It will help debug further.

Unfortunantliy I’dont have any osiloscop to connect and retain to CAN bus H and L pins. But there is another CAN Bus device connected and I’m sniffing the signals. I belive it is related with interrupt pin issue.

sudo cat /sys/kernel/debug/gpio
gpio-168 (GPIO07              ) pin32
gpio-200 (GPIO11              ) pin31

What is meaning of GPIO07  and  GPIO11 

GPIO07(168) and GPIO11(200) are just the names of pins on SODIMM connector.

If you do not have oscilloscope but have some other device (ex. multimeter), can you tell me if INT pin is going low on the MCP chip when you send the message from MCP?

Hi shgarg,
I will measure and inform you. But for god result I don’t have analog multimeter.
The other situation is I download the source code for JP4.5 and check the mcp251x.c file.The patches which you give us was not implement on the driver file. I change the source code according your patch file and compile it.
With these change I got additional this error on bellow. When I check this error from source code this is added by us it could be happen only gpio tag assigned value smaller than 0. I know no need to make any change in kernel dr

[ 8.654066] mcp251x spi0.0: failed to get GPIO from device tree
/* If GPIO based interrupt is passed in device tree */
gpio = of_get_named_gpio(np, “interrupts”, 0);
if (gpio < 0) {
dev_err(&spi->dev, “failed to get GPIO from device tree\n”);

else {
	ret = gpio_request(gpio, "mcp251x-gpio");
	if (ret) {
		dev_err(&spi->dev, "failed to request GPIO %d\n", gpio);
		return ret;

	ret = gpio_export(gpio, false);
	if (ret) {
		dev_err(&spi->dev, "failed to export GPIO %d\n", gpio);
		return ret;

	ret = gpio_direction_input(gpio);
if (ret) {
		dev_err(&spi->dev, "failed to set pin to input state\n");
		return -EINVAL;

	/* IRQ setup */
	ret = gpio_to_irq(gpio);
	if (ret < 0) {
		dev_err(&spi->dev, "failed to map GPIO to IRQ: %d\n", ret);
		return -EINVAL;

	spi->irq = ret;

Why are you applying the patches? You do not need to modify driver.
DTB is already present , just run with jetson-io

The new develeoper kit is not same as previous one. in this manual you can see the previous carrier board . Does this dtb files work both carrier board.

Yes works for both A02 and B00

According to new manual my carrier board is B01. It is not A02 or B00.
Jetson Nano User Manual

When I save the configuration on jetson-io it return me with B00 .

 Configuration saved to file                

yes still it will work.