I am trying to get adis16475 to work with Jetson Orin NX 16GB and Jetpack 36.4.3.
Below are the steps I have followed so far, and I am getting very strange behaviour. CE disables the chip when the clock is provided to it, so it can’t send the response.
Step by step:
I first generated the pinmux configuration files with the spreadsheet from the documentation (I know that those have overlay, even though they are not overlays):
Orin-obc_pinmux_overlay_v1.0-gpio-default.txt (3.4 KB)
Orin-obc_pinmux_overlay_v1.0-padvoltage-default.txt (2.4 KB)
Orin-obc_pinmux_overlay_v1.0-pinmux.txt (65.8 KB)
(attached as txt, bc the website only allows specific extensions).
Then I decided to modify this board config file:
p3768-0000-p3767-0000-a0.conf
instead of making a new one, because I already had issues before with the flashing process not working. The command from the quick start guide is completely wrong, and the partition configuration XML files are not in the locations it gives:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1
-c tools/kernel_flash/flash_l4t_t234_nvme.xml -p “-c bootloader/generic/cfg/flash_t234_qspi.xml”
–showlogs --network usb0 jetson-orin-nano-devkit internal
I found out that the most reliable and simplest way to flash was to use this:
sudo ./nvsdkmanager_flash.sh --storage nvme0n1p1
but afaik it does not allow custom board configs, instead it figures it out automatically, so I changed this file:
> p3768-0000-p3767-0000-a0.conf
with the following changes 56,57c56,57 < PINMUX_CONFIG="Orin-obc_pinmux_overlay_v1.0-pinmux.dtsi"; < PMC_CONFIG="Orin-obc_pinmux_overlay_v1.0-padvoltage-default.dtsi"; --- > PINMUX_CONFIG="tegra234-mb1-bct-pinmux-p3767-dp-a01.dtsi"; > PMC_CONFIG="tegra234-mb1-bct-padvoltage-p3767-dp-a01.dtsi"; 99,100c99,100 < PINMUX_CONFIG="Orin-obc_pinmux_overlay_v1.0-pinmux.dtsi"; < PMC_CONFIG="Orin-obc_pinmux_overlay_v1.0-padvoltage-default.dtsi"; --- > PINMUX_CONFIG="tegra234-mb1-bct-pinmux-p3767-dp-a03.dtsi"; > PMC_CONFIG="tegra234-mb1-bct-padvoltage-p3767-dp-a03.dtsi";
And I replace those files with the gpio one from the spreadsheet:
bootloader/tegra234-mb1-bct-gpio-p3767-dp-a03.dtsi
bootloader/tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi
After flashing, I was able to verify that the new configuration was applied with gpioinfo, however, the SPI interfaces would not work at all. By following this forum thread, I removed the lines of code that assign the gpio pins, as can already be seen in the config attached above. I also changed all the relevant entries containing:
nvidia,function = “rsvd1”;
to this:
nvidia,function = “spi1”;
In the pinmux file, but still nothing. All of the pins dead, I used both the loopback test and spi-pipe from the spi-tools package.
Then, as a last resort, I used the jetson-io.py tool to reconfigure the header, and it worked for both of the interfaces. When I inspected the files that it generated:
40pin_ovly.dts.txt (2.9 KB)
tegra234-40pin.dts.txt (6.1 KB)
It seems that those overlays are basically doing the same thing as the configs from the spreadsheet, but with macros, and somehow this works. For clarity, I was doing testing here with the default kernel device tree, so I had the tegra-spidevdriver assigned to the ports. I would love to learn what the difference is and how to make my approach work, but that’s a side issue now, since it works. Perhaps the parts of the tree that define the macros are also overlaying the pin settings?
Going back to the ADIS driver, the next step was to create the device tree config. Following this thread, I modified the default tree and connected the adis driver. I also have a SPI - CAN interface there, which also doesn’t work but that might be a hardware issue:
tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi.txt (7.7 KB)
After that I compiled the kernel modules using the kernel source coude from the sources provided by Nvidia. This is my menuconfig:
For the IMU (ADIS16475): The default state in the
Device Drivers ---> kernel provided by Nvidia:
<*> Industrial I/O support ---> <*>
--- Industrial I/O support
[*] Enable buffer support within IIO <*>
-*- Industrial I/O buffering based on kfifo <M>
-*- Enable triggered sampling support <M>
[--snip--]
Inertial measurement units --->
[--snip--]
<*> Analog Devices ADIS16475 and similar IMU driver < > (chng. to <M>)
[--snip--]
The drivers compiled sucessfully and they load fine, but once I modprobe it I get very strange timings. Chip enable goes high when the clock for the IMU’s response is provided:
I tried adjusting those parameters, but it didn’t help:
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,enable-hw-based-cs;
I found this post that suggests that the driver itself might be an issue causing problems with timings. There are other posts that also lead to the same conclusion:
Should I investigate this further or is there something else that I could be missing? I would greatly appreciate any help.
Also, what to hell?
