ShellAlbert / deploy-tx2

1 stars 0 forks source link

spi调试 #15

Open ShellAlbert opened 4 years ago

ShellAlbert commented 4 years ago

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 1 2 3 4

为什么收不到任何数据呢???

ShellAlbert commented 4 years ago

1 2 这些pinmux的设置值跟nvidia官网上说明的一致,但为什么物理引脚上没有波形呢?

ShellAlbert commented 4 years ago

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下载。 3 1 2

ShellAlbert commented 4 years ago

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

sudo ./spidev_test -D /dev/spidev3.0

ShellAlbert commented 4 years ago

https://devtalk.nvidia.com/default/topic/1049799/jetson-tx2/howto-enable-spi-interface-with-jetpack-4-2-/

ShellAlbert commented 4 years ago

https://devtalk.nvidia.com/default/topic/1024806/jetson-tx2/how-to-enable-spi-spidev-on-28-1-on-target-/

ShellAlbert commented 4 years ago

1 2

ShellAlbert commented 4 years ago

1 2 3

ShellAlbert commented 4 years ago

1

ShellAlbert commented 4 years ago

1 2 3

ShellAlbert commented 4 years ago

### 卧槽出数据了!!!!!! 突然发现,使用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,才能运行成功!!

卧槽!!!!!!!!

1 2 3

ShellAlbert commented 4 years ago

设备树dts中将spi-max-frequency设置为20MHz. 而默认的spidev_test.c中的speed设置为500khz, 所以我们将spidev_test.c中的speed设置为20MHz(20 000 000), 经过实验发现是可以,只不过速度有点高,从时钟波形上来看,有点变形而已。 4 QQ截图20191017112714

ShellAlbert commented 4 years ago

QQ截图20191024102227

ShellAlbert commented 4 years ago

QQ截图20191030163340 QQ截图20191030163621 QQ截图20191030163850

ShellAlbert commented 4 years ago

QQ截图20191030164051 QQ截图20191030164213