Ok i am really struggling with this. I need the CAN to control motors but i am not getting anywhere. Can you guys help me? You seem to have it working already. This Thread is already pretty long and i am kinda lost on the steps so i want to explain what i figured out and where i am in the process. Here is what i managed to understand from this thread and other guides:
The most important bit of information is this one: There are old ways and guides that don’t work anymore and are the first google results. Evade those.
You need to be able to flash the Jetson. For this i installed Ubuntu 18.04 with the SDK_Manager tools from nvidia. I have successfully flashed the Jetson this way.
In the SDK manager you can click on the folder icon next to ‘Jetson OS image’. A folder will open with all files used to flash the Jetson. (There is one called ‘Drivers for Jetson’ and one called ‘File System and OS’ but they both open the same folder).
Just for sanity here is the Folder and its structure. All relative paths i mention will be from this Folder:
dev@ubu:~/nvidia/nvidia_sdk/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/Linux_for_Tegra$ tree . -L 2
.
├── apply_binaries.sh
├── bootloader
│ ├── badpage.bin
│ ├── bmp.blob
│ ├── boot.img
│ ├── boot.img.sb
│ ├── BUP_generator.py
│ ├── cboot.bin
│ ├── chkbdinfo
│ ├── cvm.bin
│ ├── eks.img
│ ├── extlinux.conf
│ ├── flashcmd.txt
│ ├── flash_parameters.txt
│ ├── flash_win.bat
│ ├── flash.xml
│ ├── flash.xml.sb
│ ├── initrd
│ ├── l4t_bup_gen.func
│ ├── l4t_initrd.img
│ ├── LICENSE
│ ├── LICENSE.chkbdinfo
│ ├── LICENSE.mkbctpart
│ ├── LICENSE.mkbootimg
│ ├── LICENSE.mkgpt
│ ├── LICENSE.mksparse
│ ├── LICENSE.tos-mon-only.img.arm-trusted-firmware
│ ├── LICENSE.u-boot
│ ├── mkbctpart
│ ├── mkbootimg
│ ├── mkgpt
│ ├── mksparse
│ ├── nv_boot_control.conf
│ ├── nvidia-l4t-bootloader_32.4.3-20200625213809_arm64.deb
│ ├── NVIDIA_Trademark_License_Addendum_SW.pdf
│ ├── nvtboot.bin
│ ├── nvtboot_cpu.bin
│ ├── nvtboot_recovery.bin
│ ├── nvtboot_recovery_cpu.bin
│ ├── P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg
│ ├── qspi_bootblob_ver.txt
│ ├── rp4.blob
│ ├── sc7entry-firmware.bin
│ ├── system.img
│ ├── system.img.raw
│ ├── t210ref
│ ├── tegra210-p3448-0000-p3449-0000-b00.dtb
│ ├── tegra210-p3448-0000-p3449-0000-b00.dtb.sb
│ ├── tegrabct
│ ├── tegradevflash
│ ├── tegraflash_internal.py
│ ├── tegraflash_internal.pyc
│ ├── tegraflash.py
│ ├── tegrahost
│ ├── tegraparser
│ ├── tegrarcm
│ ├── tegrasign
│ ├── tos.img → tos-mon-only.img
│ ├── tos-mon-only.img
│ └── warmboot.bin
├── build_l4t_bup.sh
├── flash.sh
├── jetson-nano-devkit.conf → p3449-0000+p3448-0000-qspi-sd.conf
├── jetson-nano-devkit-emmc.conf → p3449-0000+p3448-0002.conf
├── jetson-nano-emmc.conf → p3449-0000+p3448-0002.conf
├── jetson-nano-qspi.conf → p3449-0000+p3448-0000-qspi.conf
├── jetson-nano-qspi-sd.conf → p3449-0000+p3448-0000-qspi-sd.conf
├── jetson-tx1.conf → p2597-0000+p2180-1000.conf
├── jetson-tx1-devkit.conf → p2597-0000+p2180-1000.conf
├── kernel
│ ├── dtb
│ ├── dtc
│ ├── Image
│ ├── kernel_headers.tbz2
│ ├── kernel_supplements.tbz2
│ ├── LICENSE
│ ├── LICENSE.dtc
│ ├── nv-enable-hard-coded-kernel-boot-display-mode.sh
│ ├── nvidia-l4t-kernel_4.9.140-tegra-32.4.3-20200625213809_arm64.deb
│ ├── nvidia-l4t-kernel-dtbs_4.9.140-tegra-32.4.3-20200625213809_arm64.deb
│ └── nvidia-l4t-kernel-headers_4.9.140-tegra-32.4.3-20200625213809_arm64.deb
├── l4t_generate_soc_bup.sh
├── nvmassflashgen.sh
├── nv_tegra
│ ├── bsp_version
│ ├── config.tbz2
│ ├── graphics_demos.tbz2
│ ├── l4t_deb_packages
│ ├── l4t-usb-device-mode-filesystem.img
│ ├── LICENSE
│ ├── LICENSE.brcm_patchram_plus
│ ├── LICENSE.l4t-usb-device-mode-filesystem.img
│ ├── LICENSE.libnvargus
│ ├── LICENSE.libnvcam_imageencoder
│ ├── LICENSE.libnveventlib
│ ├── LICENSE.libnvscf
│ ├── LICENSE.libnvtracebuf
│ ├── LICENSE.libtegrav4l2
│ ├── LICENSE.minigbm
│ ├── LICENSE.wayland-ivi-extension
│ ├── LICENSE.weston
│ ├── LICENSE.weston-data
│ ├── nv-apply-debs.sh
│ ├── nvidia_drivers.tbz2
│ ├── nv_sample_apps
│ ├── nv_tools.tbz2
│ └── weston.tbz2
├── p2371.conf → p2597-0000+p2180-1000.conf
├── p2597-0000+p2180-1000-24x7.conf
├── p2597-0000+p2180-1000.conf
├── p3448-0000.conf.common
├── p3448-0000-max-spi.conf
├── p3448-0000-max-spi-sd.conf
├── p3449-0000+p3448-0000-qspi.conf
├── p3449-0000+p3448-0000-qspi-sd.conf
├── p3449-0000+p3448-0002.conf
├── p3450.conf → p3449-0000+p3448-0000-qspi.conf
├── README_Massflash.txt
├── rootfs
│ ├── bin
│ ├── boot
│ ├── dev
│ ├── etc
│ ├── home
│ ├── lib
│ ├── media
│ ├── mnt
│ ├── opt
│ ├── proc
│ ├── README.txt
│ ├── root
│ ├── run
│ ├── sbin
│ ├── snap
│ ├── srv
│ ├── sys
│ ├── tmp
│ ├── usr
│ └── var
├── source
│ └── nv_src_build.sh
├── sources
│ ├── hardware
│ ├── kernel
│ └── u-boot
├── source_sync.sh
├── tools
│ ├── bmp-splash
│ ├── jetson-disk-image-creator.sh
│ ├── jetson-gpio-common_2.0.8_arm64.deb
│ ├── nvptparser.py
│ ├── python3-jetson-gpio_2.0.8_arm64.deb
│ └── python-jetson-gpio_2.0.8_arm64.deb
└── TX1_boot-firmware-redundancy.txt34 directories, 120 files
Now i think i need to make changes to these folders and then flash the Jetson with the changes so that i can have my MCP2515 running as a CAN socket.
The solution is we need to change the device tree. However i don’t know where i should do the changes.
I booted my Jetson Nano and used the following command to find out which dtb file is actually used by my jetson. This command has to be done on the jetson and not on your Ubuntu host machine:
developer@nano:~$ dmesg | grep .dts
[ 0.207848] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
[ 0.416319] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
[ 0.442907] tegra-pmc 7000e400.pmc: scratch reg offset dts data not present
from the output i figured i have to work with this file:
tegra210-p3448-0000-p3449-0000-b00.dts
its the only one mentioned by dmesg. I found the file here(on the ubuntu machine with the sdk installed):
dev@ubu:~/nvidia/nvidia_sdk/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/Linux_for_Tegra/kernel/dtb$ ls
tegra210-jetson-tx1-p2597-2180-a01-devkit-adafruit-sph0645lm4h.dtbo
tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
tegra210-jetson-tx1-p2597-2180-a01-devkit-fe-pi-audio-z-v2.dtbo
tegra210-jetson-tx1-p2597-2180-a01-devkit-hdr40.dtbo
tegra210-jetson-tx1-p2597-2180-a02-devkit-24x7.dtb
tegra210-p3448-0000-p3449-0000-a00.dtb
tegra210-p3448-0000-p3449-0000-a01-adafruit-sph0645lm4h.dtbo
tegra210-p3448-0000-p3449-0000-a01.dtb
tegra210-p3448-0000-p3449-0000-a01-fe-pi-audio-z-v2.dtbo
tegra210-p3448-0000-p3449-0000-a01-hdr40.dtbo
tegra210-p3448-0000-p3449-0000-a02-adafruit-sph0645lm4h.dtbo
tegra210-p3448-0000-p3449-0000-a02.dtb
tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo
tegra210-p3448-0000-p3449-0000-a02-hdr40.dtbo
tegra210-p3448-0000-p3449-0000-b00.dtb
tegra210-p3448-0002-p3449-0000-a02.dtb
tegra210-p3448-0002-p3449-0000-b00.dtb
I cannot simply open the file with a text editor. I needed to download ‘dtc’. To do this, use this command:
$ sudo apt install device-tree-compiler
using the compiler i could open the read with:
$ dtc tegra210-p3448-0000-p3449-0000-b00.dtb
However it is rather long and i will not post its output here. I used the following command to get the output into a copy and pasteable format:
$ dtc tegra210-p3448-0000-p3449-0000-b00.dtb >> dtb_outfile
I have it uploaded on a pastebin site if anyone wants to see it:
I tried to use dtc to see the contents of ‘tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo’ but i get the same error as jake. He mentioned he could open it when he build the latest dtc from git resources but i am getting errors on that one too. So i can’t open the ‘tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo’ to see whats inside. Can anyone help me generate the file for the b00?
On the jetson i turned on SPI:
developer@nano:~$ sudo /opt/nvidia/jetson-io/jetson-io.py
there i saw that no SPI was set on the GPIOs so i choose the option to configure the 40pin header and selected the spi1. saved changes and rebooted. Now jetson-io gives me this output:
| 3.3V ( 1) ( 2) 5V |
| i2c2 ( 3) ( 4) 5V |
| i2c2 ( 5) ( 6) GND |
| unused ( 7) ( 8) uartb |
| GND ( 9) (10) uartb |
| unused (11) (12) unused |
| unused (13) (14) GND |
| unused (15) (16) unused |
| 3.3V (17) (18) unused |
| spi1 (19) (20) GND |
| spi1 (21) (22) unused |
| spi1 (23) (24) spi1 |
| GND (25) (26) spi1 |
| i2c1 (27) (28) i2c1 |
| unused (29) (30) GND |
| unused (31) (32) unused |
| unused (33) (34) GND |
| unused (35) (36) unused |
| unused (37) (38) unused |
| GND (39) (40) unused |
I connected my mcp2515 according to the pinout from pinout.xyz . It powers up just fine. But i think i am missing steps because the MPC module does not show up at all in my dmesg:
developer@nano:~$ dmesg | grep can
[ 0.000000] OF: fdt:memory scan node memory@80000000, reg size 32,
[ 0.964001] tegra-pwm 7000a000.pwm: PWM clk cannot sleep in ops
developer@nano:~$ dmesg | grep spi
[ 0.437858] iommu: Adding device 7000d400.spi to group 7
[ 0.438129] iommu: Adding device 7000d600.spi to group 8
[ 0.438424] iommu: Adding device 70410000.spi to group 9
[ 1.613235] tegra-qspi 70410000.spi: Prod settings list not found
[ 1.614364] qspi_mtd spi32766.0: MX25U3235F (4096 Kbytes)
[ 1.614375] qspi_mtd spi32766.0: mtd .name = spi32766.0, .size = 0x400000 (4MiB) .erasesize = 0x00001000 (4KiB) .numeraseregions = 0
Does this mean i need to first configure the DTB files?
Where do i go from here? I downloaded the newest ‘mcp.zip’ from this thread but its made for the a02 and not the b00. I used diff to compare the two and they are vastly different. How did you guys made the changes to fit your b00?
Am i right in the assumption that i can just change the files in kernel/dtb and then flash the jetson and it should work? Or do i have to rebuild the kernel somehow? I am really lost here. I wanted to use the CAN mcp modul to work with motors and have a deadline. I am desperate for help.