Radxa Zero使用ENC28J60模块(1)

Placeholder Placeholder

Hallo,
我在尝试使用Radxa Zero 通过GPIO 连接ENC28J60模块访问互联网。我自己用的系统为官网下载的Debian Buster,但由于kernel内并不提供这个模块的,所以需要costum Kernel:https://wiki.radxa.com/Zero/dev/kernel

技术支持 @RadxaYuntian 给我提供了另一个解决方案,但目前还未成功:

  1. 使用包含ENC28J60.detbo的新的镜像: [Bulleye](https://github.com/radxa-build/radxa-zero/releases/download/20230201-0149/radxa-zero_debian_bullseye_kde_2023-02-01T1101+0000_msdos.img.xz 1)
  2. 新镜像的config.txt不支持Device-Tree-Overlays,但重命名dtbo应该是足够让系统加载overlay的。选择的原文件为 meson-g12a-spi-b-enc28j60.dtbo.disabled,去掉disabled, reboot。
  3. 可以然后执行以下命令检查是否正确加载:
sudo find /sys 2>/dev/null | grep -i enc28j60

当我完成以上步骤之后,并执行此命令,Termial没有给出任何信息
使用lsmod | grep enc,也无法查询到模块。
我连接的方式为:
ENC28J60 -> Radxa Zero
MOSI -> GPIOH_4 (SPI_B_MOSI)
MISO -> GPIOH_5(SPI_B_MISO)
SCK -> GPIOH_7(SPI_B_SCLK)
CS -> GPIOH_6(SPI_B_SS0)
INT -> GPIOX_8(PWM_C)
Reset -> 未连接
Clkout -> 未连接
WOL -> 未连接
Vcc-> +3.3v
GND -> GND

希望可以再次得到帮助,感谢!

Hi @RadxaYuntian,
我的ENC28J60还是无法被加载,我观察了boot的界面,没有记录表示dtbo被加载到了程序当中去(Device-Tree-Overlay也许没有实现?)
我观察到usr/lib/Linux...../amlogic/meson-g12a-radxa-zero-dtb被boot加载了,在usr/lib/Linux...../amlogic/overlays 文件夹中也有enc28j60的dtbo文件,但是不知道该如何正确加载它?我找到的方法都是需要将文件添加到uEnv.txt,但是这个文件也并没有在我们的镜像中。
请问你还有什么方法么?是我的接线有错误么?
image

抱歉我记错了,你手动改名后应该需要运行sudo u-boot-update
使用新镜像的时候支持的开启overlay的方式是通过rsetup配置工具。

Hi @RadxaYuntian,
我根据你说的给出 sudo u-boot-update,之后便重启机器。经过了boot界面之后就卡在了图下这个界面当中,无法再启动。我尝试了使用RZ_BSB_Boot_Help, 使用了erase_emmc,之后也完全无法开机了,请问有什么解决办法么?还是错过了一些设置?我在新的镜像中只是进行了重命名和 sudo u-boot-update


我之前也打开了rsetup,确认如下图里面的ENC28J60选中了

我又尝试了在无桌面系统的镜像上进行以上的步骤(rename,u-boot-update),发现在Starting Kernel这里已经卡住了,之后便自动关机了

我们这边会尝试复现。
placeholder placeholder

多谢了! 有结果了请您跟我讲!

Hi @RadxaYuntian,
请问您那边的复现有结果了么?

目前使用的的内核有bug,在开启SPI后会崩溃。目前更换了内核后可以启动,但模块暂时未识别出来

@RadxaYuntian 那您这边会继续尝试识别模块对吧? 能识别这个模块目前对我来说还挺重要的。我目前的项目是想设计一个搭载ENC28J60 的电路板,通过SPI读取的一个Internet数据,之后通过设定一个static IP, 并开启AP-Mode,通过手机连接访问一个在Radxa Zero上已经装载的Web Server。
Linux这部分我确实不熟悉,所以非常希望可以得到您的帮助

这是一个regression,我们会尝试修复

@Enoch_Lee
These are my main steps to update the enc28j60 overlay:

  1. Get the updated kernel:
    https://github.com/radxa-pkg/linux-stable/releases/download/0.1-1/linux-image-5.10.156-1-stable_5.10.156-1-6d46ef50b_arm64.deb
  2. Install the kernel:
    sudo dpkg -i linux-image-5.10.156-1-stable_5.10.156-1-6d46ef50b_arm64.deb
  3. Copy the ./usr/lib/modules/5.10.165-1-stable/kernel/drivers/net/ethernet/microchip/enc28j60.ko
    to: ./usr/lib/modules/5.10.165-1-stable/enc28j60.ko
  4. load the module:
    sudo modprobe enc28j60
  5. copy *.dtbo from: ./usr/lib/linux-image-5.10.165-1-stable/amlogic/overlays/
    to: ./usr/lib/linux-image-5.10.165-1-stable/amlogic/overlay/
    Somehow the subfolder name changed from “overlay“ to “overlays"
  6. edit /boot/uEnv.txt
    overlays=meson-g12a-spi-gpio-enc28j60
    Make sure the file name is correct.

image
Replace: messon-g12a-spi-b-enc28j60.dtbo
with: meson-g12a-spi-gpio-enc28j60.dtbo

Hi all,
The enc28j60 overlay seems to work but it is not stable. The enc28j60 LAN ethernet paused and hung after about 10 minutes.
I used the eth0 to ping another device, after a while, it hung. I could not do another ping nor using ssh to connect to it.
I attached the dmesg log file.
Please advice!
Thanks
enc28j60_up_down_2.zip (15.4 KB)