Hi, I am using a devkit. I have tried reflashing, but I do not have a can1 interface. Running sudo ip link set can1 up type can bitrate 1000000
shows:
Cannot find device "can1"
Only running sudo ip link set can0 up type can bitrate 1000000
runs successfully, but it does not give any CAN readings using candump can0
when wiring the MCP2515 to the SPI0 pins and a device that outputs CAN (the device’s CAN data is read correctly from a Rasperry Pi 4B + MCP2515).
Running zcat /proc/config.gz | grep CONFIG_CAN_MCP251X
shows the following (after re-flashing):
CONFIG_CAN_MCP251X=m
CONFIG_CAN_MCP251XFD=m
# CONFIG_CAN_MCP251XFD_SANITY is not set
This is what I tried:
- Ran the following:
sudo apt install git-core build-essential bc flex bison
cd /home/robomaster/Downloads/images/JetPack_6.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source
./source_sync.sh -k -t jetson_36.4.3
- Modified
kernel/kernel-jammy-src/arch/arm64/configs/defconfig
:
...
CONFIG_CAN_MCP251X=y
CONFIG_CAN_MCP251XFD=y
- Modified
hardware/nvidia/t23x/nv-public/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi
to the following:
...
can_clock: can_clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <25000000>;
clock-accuracy = <100>;
};
/* SPI1, 40pin header, Pin 19(MOSI), Pin 21(MISO), Pin 23(CLK), Pin 24(CS) */
spi@3210000{
status = "okay";
spi@0 {
compatible = "microchip,mcp2515";
reg = <0x0>;
spi-max-frequency = <2000000>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA234_MAIN_GPIO(Q, 5) IRQ_TYPE_LEVEL_LOW>;
clocks = <&can_clock>;
nvidia,enable-hw-based-cs;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
...
- Ran the following:
cd /home/robomaster/Downloads/images/JetPack_6.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source
export CROSS_COMPILE=/home/robomaster/Downloads/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
make -C kernel
export INSTALL_MOD_PATH=/home/robomaster/Downloads/images/JetPack_6.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/rootfs/
sudo -E make install -C kernel
cp kernel/kernel-jammy-src/arch/arm64/boot/Image ../kernel/Image
export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
make dtbs
cp kernel-devicetree/generic-dts/hardware/nvidia/t23x/nv-public/nv-platform/* ../kernel/dtb/
sudo ./apply_binaries.sh
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk0p1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
- Booted up the Jetson, enabled SPI1 with the following, and rebooted:
sudo /opt/nvidia/jetson-io/jetson-io.py
I am flashing by plugging in a USB-C cable from my host to the Jetson, shorting pins 9/10, and inserting an SD card into the Jetson. (flashing to mmcblk1p1 shows that /dev/mmcblk1p1 was not found)
Also here is the output of sudo dmesg
for can0:
mttcan c310000.mttcan can0: Bitrate set
mttcan_controller_config: ctrlmode 0
mttcan c310000.mttcan can0: Bitrate set
IPV6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
can: controller area network core
NET: Registered PF_CAN protocol family
can: raw protocol