python - 如何在 rock64 系统上启用/dev/spidev0,0?

标签 python arm linux-device-driver spi

上下文:我正在尝试使 Waveshare ePaper 的 python 演示代码(如 https://www.waveshare.com/wiki/E-Paper_Driver_HAT )与 Rock64 一起工作。

我已经使用了不同的 python 库(使用 RPi.GPIO-PineA64)并调整了引出线。

Current os (uname -a) is Linux rock64 4.4.126-rockchip-ayufan-239 aarch64 GNU/Linux

Current Error is:
File "/root/test-code/python/epdif.py", line 43, in 
SPI = spidev.SpiDev(0, 0)
FileNotFoundError: [Errno 2] No such file or directory

我认为这可能只是一个类似的命令 “enable_dtoverlay i2c0 i2c@ff150000 okay”但我还没有弄清楚魔法词是什么或我需要更改什么。

我查看了设备树的文档,但我无法理解我需要做什么。

类似的悬而未决的问题是:

  1. https://forum.armbian.com/topic/5951-activate-spidev-on-the-rock64/
  2. https://forum.pine64.org/showthread.php?tid=5409 [...]

没有理解到我可以采取行动的程度:

  1. https://github.com/ayufan-rock64/linux-build/blob/master/recipes/additional-devices.md#use-additional-devices

答案无效(不再)或超出我的能力范围的类似问题是:

  1. https://forum.pine64.org/showthread.php?tid=5682 (没用)
  2. https://forum.pine64.org/showthread.php?tid=4869 (modprobe 对我没用)
  3. https://forum.pine64.org/showthread.php?tid=5473 (不知道是否相关)
  4. https://forum.pine64.org/showthread.php?tid=1297&page=5 (其他发行版,对吧?)

提前感谢您的帮助。

最佳答案

如果您不打算使用 Ayufan 的操作系统镜像,我建议您尝试一下 Armbian Xenial (基于 Ubuntu 16.04)然后你可以应用来自 point 4 的解决方案在您的帖子中,正如用户“martinayotte”在该线程中建议的方法收到了积极的反馈,它还提供了一种测试新启用的 SPI 设备是否正常工作的方法。

就我个人而言,我一直在我的 4GB Rock64 上运行 Armbian Xenial,到目前为止没有任何提示,除了 this ,但我认为这是一个更普遍的问题,而不是 Armbian 问题。

此外,我偶然发现了 this post它提供了一个 Pine64 板的解决方案,而不是 Rock64,但也许你可以尝试适应它。

关于python - 如何在 rock64 系统上启用/dev/spidev0,0?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51321788/

相关文章:

c - 在 C 中使用 ASM 命令

arm - 我可以在多核 ARM Cortex-A9 SoC 中使用 LDREX/STREX 实现自旋锁而不启用 SCU 吗?

在 VirtualBox 上的 linux fedora 13 或 14 中编译 alsa + c + armv5tel

c++ - 跨内核和用户空间的 Linux 时序

operating-system - __init 和 __exit 属性的使用

python - 将行与引用行 pandas 进行比较

python - 使用 Berkeley DB(bsddb 模块)、Python

linux-kernel - Linux 内核模块 : When to use try_module_get/module_put

python - 根据您拥有的日期和年份阅读多个excel

python - 当宽度 <1.0 时,Matplotlib 周线太细;当宽度>=1.0 时,周线太粗