Open ShellAlbert opened 4 years ago
这些pinmux的设置值跟nvidia官网上说明的一致,但为什么物理引脚上没有波形呢?
CONFIG_SPI=y CONFIG_SPI_TEGRA114=y CONFIG_SPI_SPIDEV=m CONFIG_QSPI_TEGRA186=y 重新编译一下内核 有可能官网的内核 CONFIG_SPI_TEGRA186这个没有编译进内核导致物理引脚没有输出。 按照手册手工下载内核。因为网速原因,nvidia/nvidia_sdk/JetPack_4.2_Linux_P3310/Linux_for_Tegra/source_sync.sh太慢了。改用迅雷,在windows下载。
spidev_test.c https://raw.githubusercontent.com/torvalds/linux/master/tools/spi/spidev_test.c in jetson tx2 terminal: gcc spidev_test.c -o spidev_test
### 卧槽出数据了!!!!!! 突然发现,使用github上的spidev_test.c并在jetson-tx2上使用gcc或aarch64-linux-gnu-gcc编译后,运行没有数据。 必须要使用内核中的tools/spi/目录下的spidev_test.c并在pc机上使用aarch64-linux-gnu-编译才行,将pc(linux host)的传到win10 守望迷你ftp服务器,使用passive mode/binary模式,然后在jetson-tx2上安装sudo apt update && sudo apt install ftp并下载编译过的spidev_test,才能运行成功!!
设备树dts中将spi-max-frequency设置为20MHz. 而默认的spidev_test.c中的speed设置为500khz, 所以我们将spidev_test.c中的speed设置为20MHz(20 000 000), 经过实验发现是可以,只不过速度有点高,从时钟波形上来看,有点变形而已。
https://elinux.org/Jetson/TX2_SPI#Modifying_the_Device_Tree https://devtalk.nvidia.com/default/topic/1062484/jetson-tx2/for-the-love-of-god-make-spi-easy-to-enable-/post/5381680/#5381680
为什么收不到任何数据呢???