1- How to configure BSP files to enable SPI?
2- How to Test SPI?
Hardware: DSBOARD-NX2 with Jetson Xavier NX
OS: Jetpack 4.6
In this blog post, we will use SPI port which is on the extension connector. First we will flash the module which includes BSP files. Then, we will copy test file to Jetson. Afterwards, we can build test file and execute it.
Open the target HW image folder.
Download SPI BSP files from here & extract it.
Copy files that mentioned below to the directories inside JetPack-4.6.
Move tegra194-p3668-all-p3509-0000.dtb file inside to ./kernel/dtb directory and overwrite on the file that exist before.
Move tegra19x-mb1-pinmux-p3668-a01.cfg file inside to ./bootloader/t186ref/BCT directory and overwrite on the file that exist before.
Return to the “Linux_for_Tegra” folder and open a Terminal.
Type "lsusb" and check the device connected in Recovery mode (0955:7e19 NVidia Corp.)
After this step, you can flash the module with the command below.
sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1
When the flash is successfully done, the module will reboot and open itself.
First, we need to connect MOSI to MISO pins with a jumper. Below image shows connector’s pinout.
After that, we need to download spidev_test file from here and extract it.
Then, go to file destination, open a terminal there and compile this file using below command:
gcc -o spidev_test spidev_test.c
After this step, use below command to test SPI:
sudo ./spidev_test -D /dev/spidev0.0
Thank you for reading our blog post.