Jetson nano and mcp2515 can module

And your tegra210-p3448-0000-p3449-0000-a02.dtb is same as I uploaded? You copied to /boot/dtb/ ?

Difference is gpio based interrupt was not available in driver, so I have enabled interrupts based on gpio.

Yes tegra210-p3448-0000-p3449-0000-a02.dtb is the same as you uploaded, I just renamed it to tegra210-p3448-0000-p3449-0000-b00.dtb

Try renaming tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo also with tegra210-p3448-0000-p3449-0000-b00-mcp251x.dtbo

Something wrong with this kernel file I copied back original mcp251x.ko back and it was possible to load driver. I tried again with your modified file and I couldn’t load mcp251x.

No still the same issue, the grey gui for /opt/nvidia/jetson-io/jetson-io.py script pops up and then closes immediately

Which Jetpack version , kernel version are you using? It should be kernel 4.9

I am not sure why is it so, it should not happen. Something messed up in between. Start fresh: Reboot, delete both dtb and dtbo, copy again and start jetson_io script. Can you once repeat all the steps?

When I flash sd card from downloaded file with etcher the dtb file was b00. When I flash with nvidia sdk manaager it was a02. When you flash with sdk maybe you dont need to change the file name. I don’t know it could help your problem.
The other thing have you copied the mcp251x.ko on target under /lib/modules/4.9.140-tegra/kernel/drivers/net/can/spi/ folder. If you did what is your lsmod output.

Okay I will try that out, but do I need to replace the old tegra210-p3448-0000-p3449-0000-b00.dtb there already was existing under /boot with the tegra210-p3448-0000-p3449-0000-b00.dtb new one that I rename to that you provided
Thanks!

Thanks for your input, but when I flash with sdk manager its only about 12gb of your sd-card that is available
Thanks!

Linux jetson-nano 4.9.140-tegra #1 SMP PREEMPT Mon Dec 9 22:47:42 PST 2019 aarch64 aarch64 aarch64 GNU/Linux

Do you have kernel source code if you can add changes in mcp251x driver?

No, not needed to modify dtb in /boot

Unfortuantley I don’t have any idea about how the kernel source can be edit.

I started from fresh. What I did was I followed your steps again and renamed the file you provided to tegra210-p3448-0000-p3449-0000-b00.dtb copied to /boot/dtb and renamed tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo to tegra210-p3448-0000-p3449-0000-b00-mcp251x.dtbo and copied to /boot, but I still got the same issue as before. If I copy tegra210-p3448-0000-p3449-0000-b00.dtb there already was existing under /boot to /boot/dtb, then I can run the /opt/nvidia/jetson-io/jetson-io.py script but not when I copy the file you provided and rename it
Thanks !

Hi shgarg

I think I fixed the issue by change the compatible device in the dtb file you provided to tegra210-p3448-0000-p3449-0000-b00.dtb and copied it into /boot/dtb. Now I can run the script, where I selected Select MCP251x CAN Controller. But after reboot, I still see the spidev0.1 and spidev1.1, and when I run
ip link set can0 up type can bitrate 500000
to bring up the CAN interfaces on network I still got the error Cannot find device “can0” and Cannot find device “can1”
Thank you so much!

Hi,
This means changes are not reflected. DTB with name something like /boot/tegra210-p3448-0000-p3449-0000-b00-mcp251x-can-controller.dtb must be created. In this dtb, changes should be there. This is the dtb which is taken up when system reboots.
Check if this got generated and have node:
spi@0 {
interrupts = <0x00000056 0x000000c8 0x00000001>;
clocks = <0x0000012c>;
nvidia,rx-clk-tap-delay = <0x00000006>;
nvidia,enable-hw-based-cs;
compatible = “microchip,mcp2515”;
reg = <0x00000000>;
spi-max-frequency = <0x00989680>;
controller-data {
nvidia,tx-clk-tap-delay = <0x00000000>;
nvidia,cs-hold-clk-count = <0x0000001e>;
nvidia,cs-setup-clk-count = <0x0000001e>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x0000001f>;
};
};

Yes there is a new file /boot/tegra210-p3448-0000-p3449-0000-b00-mcp251x-can-controller.dtb and In that I have the node
spi@0 {
interrupts = <0x56 0xa8 0x1>;
clocks = <0x12c>;
nvidia,rx-clk-tap-delay = <0x7>;
nvidia,enable-hw-based-cs;
compatible = “microchip,mcp2515”;
reg = <0x0>;
spi-max-frequency = <0x989680>;

		controller-data {
			nvidia,tx-clk-tap-delay = <0x0>;
			nvidia,cs-hold-clk-count = <0x1e>;
			nvidia,cs-setup-clk-count = <0x1e>;
			nvidia,enable-hw-based-cs;
			nvidia,rx-clk-tap-delay = <0x1f>;
		};

Please share your output of command:
$dmesg | grep spi
$lsmod
Also, once check connections are proper and fixed(not loose).