我有一台Raspberry Pi 2,Model B,我想使用SPI与另一台Pi进行通信(以后用于更多的SPI设备)。我也想使用WiringPi来编写C程序。
我认为我应该确保我拥有所需的所有内容,所以我运行了完整的升级:
我安装了
我认为我应该确保我拥有所需的所有内容,所以我运行了完整的升级:
sudo apt-get update && sudo apt-get upgrade -y
我安装了
WiringPi
,并在raspi-config
中启用SPI加载,但仍无法执行gpio load SPI
,出现以下错误:gpio: Unable to load/unload modules as this Pi has the device tree enabled.
You need to run the raspi-config program (as root) and select the
modules (SPI or I2C) that you wish to load/unload there and reboot.
There is more information here:
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314
我随后尝试了建议的链接:
... 在你的config.txt文件中添加"device_tree=",然后重新启动。
$ nano sudo /boot/config.txt
# Go to last line
# Add 'device_tree='
# Save, and exit
$ sudo reboot
然后我尝试了gpio load spi
,但我仍然收到相同的错误信息。
/boot/config.txt
中已启用SPI:
$ cat /boot/config.txt | grep spi
dtparam=spi=on
你们有什么建议,我可以尝试启用我的SPI吗?