I agree 100%. I used the Nvidia SDK Manager (https://developer.nvidia.com/nvidia-sdk-manager) to setup the Jetson TX2. I, like many others, are finding it difficult to simply enable SPI. The doc which seems to be the one everyone points to (https://elinux.org/Jetson/TX2_SPI) could be significantly improved!!
I’ve spent the last few days trying to get it working and I think I reached the point where I need to test it. See my progress here for TX2 https://devtalk.nvidia.com/default/topic/1062484/jetson-tx2/for-the-love-of-god-make-spi-easy-to-enable-/post/5381235/#5381235. I too was wondering where to find the tools…the elinux doc (linked above) simply says “in a copy of the kernel sources, change directories to tools/spi/” but they fail to give the absolute path leaving everyone scratching their heads. I was able to find something here on my host OS
~/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9/tools/spi
This directory was created following the SDK Manager setup. I don’t know if this is what @ShaneCCC is referring to by saying “For the tools/spi it’s in the kernel source”. This is just a repeated statement found in the elinux doc (linked above) and offers no support.
Nevertheless, I went to the directory I pointed to above and ran the following command (as the elinux doc says)
CROSS_COMPILE=/usr/bin/aarch64-linux-gnu- make
I get the following output:
make
make: *** No rule to make target ‘spidev_test’, needed by ‘all’. Stop.
The Makefile reads:
CC = $(CROSS_COMPILE)gcc
all: spidev_test spidev_fdx
clean:
$(RM) spidev_test spidev_fdx
And this is where I’m stuck. The only file in the directory is the Makefile?!?!
Again, I’ve started with the SDK Manager and I’m working with the files installed by it. Starting from here, how do I create the spidev_test binary??
I tried to change the directory to ~/nvidia and run:
sudo find ./ -name “spidev*”
I get the following output:
./nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/usr/src/linux-headers-4.9.140-tegra-linux_x86_64/kernel-4.9/include/uapi/linux/spi/spidev.h
./nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/usr/src/linux-headers-4.9.140-tegra-linux_x86_64/kernel-4.9/include/config/spi/spidev.h
./nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux/spi/spidev.h
./nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9/include/config/spi/spidev.h
./nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/usr/include/linux/spi/spidev.h
./nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/rootfs/lib/modules/4.9.140-tegra/kernel/drivers/spi/spidev.ko
Nothing about “spidev_test” which makes me wonder if I do have to obtain the souces? Maybe the SDK Manager does not natively obtain those sources?