Hi, I am new in delevoping with Nvidia devices.
I am trying to use a PiCAN 2 (PiCAN2 - Controller Area Network (CAN) Bus Interface for Raspberry Pi 2 ) with the jetson nano. When I used it with the Raspberry PI 4, it was just requiered the following configurations into the configuration file (/boot/config.txt):
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
I was following this tutorial (CanBus on the Nano - #19 by Dan0811), but I have some questions.
I have converted de dtb file into a dts file in order to follow this solution. In the step 3, I decided to use the spi1 with this configuration:
can_clock: can_clock {
compatible = “fixed-clock”;
#clock-cells = <0>;
clock-frequency = <16000000>;
clock-accuracy = <100>;
};
spi@7000d600 { /* SPI 1 to 40 pin header */
status = “okay”;
spi@0 {
compatible = “microchip,mcp2515”;
reg = <0x0>;
spi-max-frequency = <16000000>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x7>;
clocks = <&can_clock>;
// interrupts = <&gpio TEGRA_GPIO(Z, 0) 0x19>; // GPIO pin chosen from 40 pin header
controller-data {
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};
In the PiCAN2 there is no pin for interruption like in the tutorial, so I assume that it is no required to do this step.
Then, in the step 4 I did some changes in the input and tristate from 0x1 to 0x0 like in the example below. But, I don’t know how to change the function property, and how to add the GPIO entry.
spi1_mosi_pc0 {
nvidia,pins = "spi1_mosi_pc0";
nvidia,function = "rsvd1";
nvidia,pull = <0x1>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <0x1>;
};
Also, according to the tutorial it is necessary to flash the devide, but since I am using the SD card method. I am not sure how to do it.
I would appreciate any help with my doubts.