Fishwaldo / sophgo-sg200x-debian

Debian Image for SG200x based boards such as Milk Duo256/DuoS and Sipeed LicheeRVNano
53 stars 5 forks source link

Duo S bricked - no RNDIS connection on boot up #24

Open UQuark opened 2 weeks ago

UQuark commented 2 weeks ago

Hi. I would very like to provide more info, but I've got absolutely no clue how to get any kind of log in this brick state.

Previously everything worked with a stock buildroot image as well as self-built buildroot image I dd'ed latest .img file onto an SD card and connected Duo S to my PC After more than 5 minutes, no network connection appeared.

The only thing I noticed is that when I connect Duo S to my PC WITHOUT an SD card, a "usb connected" message appears in dmesg. When SD card with debian is present, no dmesg events are reported whatsoever.

Could you please provide some guidance on how to debug such issues

Fishwaldo commented 2 weeks ago

You will need to connect a serial terminal to the UART to see the boot up messages and from there we can determine what went wrong.

UQuark commented 2 weeks ago

Hi again. I connected it via UART as you told and when I used minicom - it suddenly started initializing and the network connection appeared.

I will perform some more tests to pinpoint the issue.

Maybe it is due to a few resets I've done during UART setup.

UQuark commented 2 weeks ago

Can confirm - resetting the device is a workaround. Still no clue why.

UQuark commented 2 weeks ago

There you go, managed to pull out logs from a fresh boot.


DCP/0x7c9b0/0.
Loader_2nd loaded.
Switch RTC mode to xtal32k
Jump to monitor at 0x80000000.
OPENSBI: next_addr=0x80200020 arg1=0x80080000
OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Milk-V DuoS
Platform Features         : mfdeleg
Platform HART Count       : 1
Platform IPI Device       : clint
Platform Timer Device     : clint
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform SysReset Device  : ---
Firmware Base             : 0x80000000
Firmware Size             : 132 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000074000000-0x000000007400ffff (I)
Domain0 Region01          : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200020
Domain0 Next Arg1         : 0x0000000080080000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcvsux
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 38
Boot HART MHPM Count      : 8
Boot HART MHPM Count      : 8
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109

U-Boot 2021.10-ga57aa1f2-dirty (Jun 01 2024 - 14:14:24 +0000) cvitek_cv181x

DRAM:  510 MiB
gd->relocaddr=0x9fbbf000. offset=0x1f9bf000
set_rtc_register_for_power
MMC:   cv-sd@4310000: 0, wifi-sd@4320000: 1
Loading Environment from FAT... mmc1 : finished tuning, code:76
OK
In:    serial
Out:   serial
Err:   serial
Net:   
Warning: ethernet@4070000 (eth0) using random MAC address - 46:33:13:ca:b4:63
eth0: ethernet@4070000
Hit any key to stop autoboot:  0 
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
ethernet@4070000 Waiting for PHY auto negotiation to complete.... done
Speed: 100, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

Retry time exceeded; starting again
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-riscv
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
Speed: 100, full duplex
*** ERROR: `ipaddr' not set
Config file not found
Boot from SD dev 0 ...
switch to partitions #0, OK
mmc0 is current device
** Unable to read file boot.sd **
Failed to load 'boot.sd'
set sdenv=0
set root=root=/dev/mmcblk0p2 rootwait rw
Card did not respond to voltage select! : -110
Boot from SD dev 0 auto ...
switch to partitions #0, OK
mmc0 is current device
** Unable to read file boot.sd **
Failed to load 'boot.sd'
cv181x_c906# 

After I hit reset, I can see it boots up properly

UQuark commented 2 weeks ago

Another fresh boot, different weird log:

ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A80003
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A8000
ethernet@4070000 Waiting for PHY auto negotiation to complete........ done
Speed: 100, full duplex
Using ethernet@4070000 device
TFTP from server 192.168.56.101; our IP address is 192.168.0.3; sending through gateway 192.168.0.11
Filename 'pxelinux.cfg/C0A8000'.
Load address: 0x81400000
Loading: *
ARP Retry count exceeded; starting again
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A800
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A80
ethernet@4070000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@4070000
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A8
ethernet@4070000 Waiting for PHY auto negotiation to complete...... done
Speed: 100, full duplex
Using ethernet@4070000 device
TFTP from server 192.168.56.101; our IP address is 192.168.0.3; sending through gateway 192.168.0.11
Filename 'pxelinux.cfg/C0A8'.
Load address: 0x81400000
Loading: *
ARP Retry count exceeded; starting again
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A
Speed: 100, full duplex
Using ethernet@4070000 device
TFTP from server 192.168.56.101; our IP address is 192.168.0.3; sending through gateway 192.168.0.11
Filename 'pxelinux.cfg/C0A'.
Load address: 0x81400000
Loading: *
ARP Retry count exceeded; starting again
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0
Speed: 100, full duplex
Using ethernet@4070000 device
TFTP from server 192.168.56.101; our IP address is 192.168.0.3; sending through gateway 192.168.0.11
Filename 'pxelinux.cfg/C0'.
Load address: 0x81400000
Loading: *
ARP Retry count exceeded; starting again
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C
Speed: 100, full duplex
Using ethernet@4070000 device
TFTP from server 192.168.56.101; our IP address is 192.168.0.3; sending through gateway 192.168.0.11
Filename 'pxelinux.cfg/C'.
Load address: 0x81400000
Loading: *
UQuark commented 1 week ago

Seems like a relevant thread: https://unix.stackexchange.com/questions/762032/uboot-boots-from-sd-card-but-cant-read-info-from-mmc