Ethernet not working

Viewed 100

重现步骤

  1. Plugged Ethernet cable
  2. Plugged Power USB Cable
  3. Powered Up
  4. Plugged other USB cable & opened CanMV IDE
  5. Run Wired Network Example Code

期待结果和实际结果

软硬件版本信息

Hardware: CanMV-K230 V3.0
Image: CanMV_K230_V3P0_micropython_v1.3-0-g8dd764f_nncase_v2.9.0

错误日志

CanMV-IDE Serial Terminal Logs:
False
run ifconfig failed.
None
run ifconfig failed.
False
run ifconfig failed.
None
run ifconfig failed.
False
run ifconfig failed.
None
run get mac failed.
b'\x00\x00\x00\x00\x00\x00'
run ifconfig failed.
False
run ifconfig failed.
None
MPY: soft reboot
CanMV v1.2.2(based on Micropython e00a144) on 2025-06-16; k230_canmv_v3p0 with K230

尝试解决过程

补充材料

Link & Speed LEDs of RJ-25 connector remains off always.

Boot-up logs:
[2025-07-31_09:58:48:535]
[2025-07-31_09:58:48:535]U-Boot SPL 2022.10 (Jun 16 2025 - 02:48:35 +0000)
[2025-07-31_09:58:48:535]lpddr4 2660
[2025-07-31_09:58:48:550]00000000: PMU Major Msg: End of CA training
[2025-07-31_09:58:48:550]00000000: PMU Major Msg: End of initialization
[2025-07-31_09:58:48:565]00000000: PMU Major Msg: End of read enable training
[2025-07-31_09:58:48:565]00000000: PMU Major Msg: End of fine write leveling
[2025-07-31_09:58:48:580]00000000: PMU Major Msg: End of read dq deskew training
[2025-07-31_09:58:48:596]00000000: PMU Major Msg: End of MPR read delay center optimization
[2025-07-31_09:58:48:596]00000000: PMU Major Msg: End of Write leveling coarse delay
[2025-07-31_09:58:48:596]00000000: PMU Major Msg: End of write delay center optimization
[2025-07-31_09:58:48:612]00000000: PMU Major Msg: End of read delay center optimization
[2025-07-31_09:58:48:612]00000000: PMU Major Msg: End of max read latency training
[2025-07-31_09:58:48:628]00000000: PMU Major Msg: Firmware run has completed
[2025-07-31_09:58:48:753]image: uboot load to 0x1000000, compress=1 src=0x2aaaa254 len=0x49e5c
[2025-07-31_09:58:48:768]

[2025-07-31_09:58:48:768]U-Boot 2022.10 (Jun 16 2025 - 02:48:35 +0000)

[2025-07-31_09:58:48:768]CPU: rv64imafdcvsu
[2025-07-31_09:58:48:768]Model: kendryte k230 canmv v3.0
[2025-07-31_09:58:48:768]DRAM: 1 GiB
[2025-07-31_09:58:48:798]Core: 26 devices, 13 uclasses, devicetree: embed
[2025-07-31_09:58:48:798]MMC: mmc0@91580000: 0, mmc1@91581000: 1
[2025-07-31_09:58:48:798]Loading Environment from MMC... OK
[2025-07-31_09:58:48:892]In: serial@91400000
[2025-07-31_09:58:48:892]Out: serial@91400000
[2025-07-31_09:58:48:892]Err: serial@91400000
[2025-07-31_09:58:48:892]Net: No ethernet found.
[2025-07-31_09:58:48:892]Hit any key to stop autoboot: 0
[2025-07-31_09:58:49:062]image: rtt load to 0x0, compress=1 src=0x2aaaa25c len=0x195a68
[2025-07-31_09:58:49:078]Jump to big hart
[2025-07-31_09:58:49:094]
[2025-07-31_09:58:49:094]OpenSBI v1.2.2
[2025-07-31_09:58:49:109]heap: [0x00517080 - 0x04517080], size 65536 KB
[2025-07-31_09:58:49:109]page: [0x04517088 - 0x1fffec00], size 453534 KB
[2025-07-31_09:58:49:109]lwIP-2.1.2 initialized!
[2025-07-31_09:58:49:170][I/SDIO] SD card capacity 31166976 KB.
[2025-07-31_09:58:49:170]found part[0], begin: 52428800, size: 10.0MB
[2025-07-31_09:58:49:170]found part[1], begin: 62914560, size: 500.0MB
[2025-07-31_09:58:49:186]found part[2], begin: 1073741824, size: 28.740GB
[2025-07-31_09:58:49:385][E/drv_touch] touch probe failed.
[2025-07-31_09:58:49:385][I/sal.skt] Socket Abstraction Layer initialize success.
[2025-07-31_09:58:49:416]Can't find sensor on csi0
[2025-07-31_09:58:49:416]find sensor(gc2093_csi1) on csi1
[2025-07-31_09:58:49:448]Can't find sensor on csi2
[2025-07-31_09:58:49:448]vicap_mcm_init

[2025-07-31_09:58:49:448]THIS BOARD MAYBE NOT CONFIGURE BANK VOLTAGE!!!

[2025-07-31_09:58:49:448]
[2025-07-31_09:58:49:448]#############SDK VERSION######################################
[2025-07-31_09:58:49:479]SDK : v1.3-20250616-024928-runner-fv-az1110-325-c05f7f5
[2025-07-31_09:58:49:479]CanMV : v1.3-20250616-024928-runner-fv-az1110-325-8dd764f
[2025-07-31_09:58:49:479]nncase: 2.9.0
[2025-07-31_09:58:49:479]##############################################################
[2025-07-31_09:58:49:479]msh />usb disconnect
[2025-07-31_09:58:50:849]IDE debugger built Jun 16 2025 02:50:13
[2025-07-31_09:58:50:849][W/USB] read timeout
[2025-07-31_09:58:50:957][mpy] enter repl

8 Answers

I suspect there might be a hardware issue with your board. Could you try testing with a different board?
,I tested using the same image as yours on the V3 board, and there was no issue. The test log is as follows:

U-Boot SPL 2022.10 (Jun 16 2025 - 02:48:35 +0000)
lpddr4 2660
00000000: PMU Major Msg: End of CA training                                                        
00000000: PMU Major Msg: End of initialization                                                     
00000000: PMU Major Msg: End of read enable training                                               
00000000: PMU Major Msg: End of fine write leveling                                                
00000000: PMU Major Msg: End of read dq deskew training                                            
00000000: PMU Major Msg: End of MPR read delay center optimization                                 
00000000: PMU Major Msg: End of Write leveling coarse delay                                        
00000000: PMU Major Msg: End of write delay center optimization                                    
00000000: PMU Major Msg: End of read delay center optimization                                     
00000000: PMU Major Msg: End of max read latency training                                          
00000000: PMU Major Msg: Firmware run has completed                                                
image: uboot load to 0x1000000, compress=1 src=0x2aaaa254 len=0x49e5c


U-Boot 2022.10 (Jun 16 2025 - 02:48:35 +0000)

CPU:   rv64imafdcvsu
Model: kendryte k230 canmv v3.0
DRAM:  1 GiB
Core:  26 devices, 13 uclasses, devicetree: embed
MMC:   mmc0@91580000: 0, mmc1@91581000: 1
Loading Environment from MMC... OK
In:    serial@91400000
Out:   serial@91400000
Err:   serial@91400000
Net:   No ethernet found.
Hit any key to stop autoboot:  0
image: rtt load to 0x0, compress=1 src=0x2aaaa25c len=0x195a68
Jump to big hart

OpenSBI v1.2.2
heap: [0x00517080 - 0x04517080], size 65536 KB
page: [0x04517088 - 0x1fffec00], size 453534 KB
lwIP-2.1.2 initialized!
[I/SDIO] SD card capacity 31140864 KB.
found part[0], begin: 52428800, size: 10.0MB
found part[1], begin: 62914560, size: 500.0MB
found part[2], begin: 1073741824, size: 28.714GB
probe touch ft5x16
[I/sal.skt] Socket Abstraction Layer initialize success.
Can't find sensor on csi0
Can't find sensor on csi1
Can't find sensor on csi2
vicap_mcm_init

THIS BOARD MAYBE NOT CONFIGURE BANK VOLTAGE!!!


#############SDK VERSION######################################
SDK   : v1.3-20250616-024928-runner-fv-az1110-325-c05f7f5
CanMV : v1.3-20250616-024928-runner-fv-az1110-325-8dd764f
nncase: 2.9.0
##############################################################
msh />[I/WLAN.dev] wlan init success
[I/WLAN.lwip] eth device init ok name:w0
[I/WLAN.dev] wlan init success
usb disconnect
[I/WLAN.lwip] eth device init ok name:w1
Interface Descriptor:
        bLength: 0x09
        bDescriptorType: 0x04
        bInterfaceNumber: 0x00
        bAlternateSetting: 0x00
        bNumEndpoints: 0x03
        bInterfaceClass: 0xff
        bInterfaceSubClass: 0xff
        bInterfaceProtocol: 0x00
        iInterface: 0x00
IDE debugger built Jun 16 2025 02:50:13
[W/USB] read timeout
[mpy] enter repl
[mpy] exit, reset
<3>[4] [Func]:vb_do_exit [Line]:1569 [Info]:vb already exited!
[mpy] enter script
[mpy] exit, reset
<3>[4] [Func]:vb_do_exit [Line]:1569 [Info]:vb already exited!
[mpy] enter script

@wjx I attached schematic of ethernet part. can you please help me to debug the hardware issue?

Run Wired Network Example Code
Please provide the specific example.

@wjx I added new answer as code & logs are not coming into a comment

I run this code:

import network
def main():
    #获取lan接口
    a=network.LAN()
    #获取网口是否在使用
    print(a.active())
    #查看网口 ip,掩码,网关,dns配置
    print(a.ifconfig())
    #设置网口 ip,掩码,网关,dns配置
    print(a.ifconfig(('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8')))
    #查看网口 ip,掩码,网关,dns配置
    print(a.ifconfig())
    #设置网口为dhcp模式
    print(a.ifconfig("dhcp"))
    #查看网口 ip,掩码,网关,dns配置
    print(a.ifconfig())
    #查看网口mac地址
    print(a.config("mac"))
    #设置网口为dhcp模式
    print(a.ifconfig("dhcp"))
    #查看网口 ip,掩码,网关,dns配置
    print(a.ifconfig())
main()

Here is the Serial Terminal Logs:

False
run ifconfig failed.
None
run ifconfig failed.
False
run ifconfig failed.
None
run ifconfig failed.
False
run ifconfig failed.
None
run get mac failed.
b'\x00\x00\x00\x00\x00\x00'
run ifconfig failed.
False
run ifconfig failed.
None
MPY: soft reboot

Here is UART Debug logs:

[2025-08-01_09:55:15:853][mpy] exit, reset
[2025-08-01_09:55:15:932]<3>[4] [Func]:vb_do_exit [Line]:1569 [Info]:vb already exited!
[2025-08-01_09:55:15:932][mpy] enter script
[2025-08-01_09:55:24:041][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:041][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:041][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:041][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:041][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:041][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:072][E/NetMgmtDev] Can't find netif u0

[2025-08-01_09:55:24:088][mpy] exit, reset
[2025-08-01_09:55:24:165]<3>[4] [Func]:vb_do_exit [Line]:1569 [Info]:vb already exited!
[2025-08-01_09:55:24:165][mpy] enter script

We have made custom PCB board based on V3 design files. There is no change in USB & Ethernet peripherals. It is same as V3 design.
Can you please help me to debug the issue with our custom PCB?
Below I attached schematic of Ethernet part.

Please check whether the power supply to USB1 is functioning properly.
image.png

@wjx I checked the voltage. Please check my answer.

I checked voltage on USB1_VBUS. 5v on one side of 30k resistor and 2.83v on other side of resistor.

@wjx Can you please help!!

@wr_canaan 请帮忙看下这个问题,

To ensure the RTL8152B USB-to-Ethernet chip is in working condition, test the following:

Please test whether the USB D+ and D- lines is a valid 480Mbps signal.

Check if the crystal oscillator and power supply voltages of the RTL8152B are functioning properly.

I checked power supply voltages on RTL8152B chip, which is ok

@wr_canaan I used 12pF capacitors for 25Mhz crystal used for RTL8152B chip. This can be the issue?

IS the crystal working properly,please test the output of the crystral.

Please give me the full sch of your board

@wr_canaan Can you please help?