周末无聊给wndr4300v2安装openwrt,在一顿优化之后变砖了。现象就是反复重启,各路百度 科学百度之后都没有准确做法,现在把解决方法写出来。
硬件准备:
拆机工具,螺丝刀T8梅花形。
找TTL口。这个主板标注的UART的就是了,靠近电源口那一根是VCC空着,或者用跟电线给他套上。
VCC往下依次是TX.RX.GND.
TTL连接神器
二选一
路由器主板和ttl连接时需要RX接TX,TX接RX,GND接GND,都是教训。
软件准备
Tftpd64或者tftp2,总之吧就是tftp客户端软件,用windows自带的也行。
securCRT或者xshell等调试串口的“正版软件”。
注意,这个串口连接参数不能选9600,115200否则会乱码,受某位网友启发,填了117200,关闭流控才可以正常显示,不用管电脑驱动程序怎么写的。
问题解读
这个路由器被我优化后基本就是砖了,不停的重启,
显示信息:
U-Boot 1.1.4 (Aug 12 2014 - 15:21:46)
U-boot dni29 V0.5 for DNI HW ID: 29764821 NOR flash 2MB NAND flash 128MB RAM 128MB
- Dragonfly 1.0DRAM:
sri
ath_ddr_initial_config(278): (ddr2 init)
ath_sys_frequency: cpu 775 ddr 650 ahb 258
Tap values = (0x10, 0x10, 0x10, 0x10)
128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 265k for U-Boot at: 87fbc000
Reserving 192k for malloc() at: 87f8c000
Reserving 44 Bytes for Board Info at: 87f8bfd4
Reserving 36 Bytes for Global Data at: 87f8bfb0
Reserving 128k for boot params() at: 87f6bfb0
Stack Pointer at: 87f6bf98
Now running in RAM - U-Boot at: 87fbc000
Flash Manuf Id 0xc2, DeviceId0 0x20, DeviceId1 0x15
flash size 2MB, sector count = 32
Flash: 2 MB
Qualcomm Atheros SPI NAND Driver, Version 0.1 (c) 2014 Qualcomm Atheros Inc.
ath_parse_read_id: SPI NAND V.Id: 0xc8 D.Id: 0xf1
====== NAND Parameters ======
sc = 0x87ff77e4 page = 0x800 block = 0x20000In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fe914c
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: dc:ef:09:dd:61:06
eth0 up
eth0
Setting 0x181162c0 to 0x48902100
Hit any key to stop autoboot: 0
Trying eth0
dup 1 speed 1000
Client starts...[Listening] for ADVERTISE...checksum bad
Tchecksum bad
checksum bad
checksum bad
checksum bad
TTchecksum bad
checksum bad
checksum bad
checksum bad
checksum bad
Retry count exceeded; boot the image as usual
nmrp server is stopped or failed !
Loading from device 0: ath-spi-nand (offset 0x0)
** check kernel image **
Verifying Checksum ... OK
** check rootfs image **
Verifying Checksum ... OK
## Booting image at 81000000 ...
Image Name: MIPS OpenWrt Linux-5.4.143
Created: 2021-08-31 22:20:08 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 4194175 Bytes = 4 MB
Load Address: 80060000
Entry Point: 80060000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728
Starting kernel ...
[ 0.000000] Linux version 5.4.143 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16279-5cc0535800)) #0 Tue Aug 31 22:20:08 2021
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[ 0.000000] MIPS: machine is Netgear WNDR4300 v2
[ 0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32480
[ 0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 121920K/131072K available (5512K kernel code, 178K rwdata, 708K rodata, 1208K init, 210K bss, 9152K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 51
[ 0.000000] random: get_random_bytes called from 0x806a2a28 with crng_init=0
[ 0.000000] CPU clock: 775.000 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns
[ 0.000006] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns
[ 0.008225] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[ 0.046712] pid_max: default: 32768 minimum: 301
[ 0.051710] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.059424] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.071812] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.082114] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.089398] pinctrl core: initialized pinctrl subsystem
[ 0.096128] NET: Registered protocol family 16
[ 0.124336] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[ 0.137320] clocksource: Switched to clocksource MIPS
[ 0.143542] thermal_sys: Registered thermal governor 'step_wise'
[ 0.143884] NET: Registered protocol family 2
[ 0.154993] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.163314] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.172189] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.180282] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.187727] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.194554] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.201494] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.209159] NET: Registered protocol family 1
[ 0.213810] PCI: CLS 0 bytes, default 32
[ 0.221568] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[ 0.234655] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.240845] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.263886] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.275047] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[ 0.282176] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.291003] printk: console [ttyS0] disabled
[ 0.295599] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[ 0.304705] printk: console [ttyS0] enabled
[ 0.304705] printk: console [ttyS0] enabled
[ 0.313771] printk: bootconsole [early0] disabled
[ 0.313771] printk: bootconsole [early0] disabled
[ 0.333205] spi-nand spi0.1: GigaDevice SPI NAND was found.
[ 0.339029] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[ 0.348496] 2 fixed-partitions partitions found on MTD device spi0.1
[ 0.355111] Creating 2 MTD partitions on "spi0.1":
[ 0.360079] 0x000000000000-0x000000400000 : "kernel"
[ 0.370381] 0x000000400000-0x000008000000 : "ubi"
[ 0.509706] spi-nor spi0.0: mx25l1606e (2048 Kbytes)
[ 0.514932] 8 fixed-partitions partitions found on MTD device spi0.0
[ 0.521510] Creating 8 MTD partitions on "spi0.0":
[ 0.526478] 0x000000000000-0x000000040000 : "u-boot"
[ 0.532482] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.538853] 0x000000050000-0x000000060000 : "caldata_backup"
[ 0.545634] 0x000000060000-0x000000070000 : "config"
[ 0.551610] 0x000000070000-0x000000080000 : "traffic_meter"
[ 0.558266] 0x000000080000-0x000000090000 : "pot"
[ 0.564001] 0x000000090000-0x0000001f0000 : "reserved"
[ 0.570196] 0x0000001f0000-0x000000200000 : "caldata"
[ 0.577085] libphy: Fixed MDIO Bus: probed
[ 1.153314] random: fast init done
[ 1.221688] libphy: ag71xx_mdio: probed
[ 1.228755] switch0: Atheros AR8337 rev. 2 switch registered on mdio.0
[ 1.816827] ag71xx 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
[ 1.828104] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: sgmii
[ 1.837164] NET: Registered protocol family 10
[ 1.846766] Segment Routing with IPv6
[ 1.850710] NET: Registered protocol family 17
[ 1.855398] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 1.868801] 8021q: 802.1Q VLAN Support v1.8
[ 1.875401] PCI host bridge /ahb/pcie-controller@18250000 ranges:
[ 1.881773] MEM 0x0000000012000000..0x0000000013ffffff
[ 1.887185] IO 0x0000000000000000..0x0000000000000000
[ 1.892745] PCI host bridge to bus 0000:00
[ 1.897018] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[ 1.904126] pci_bus 0000:00: root bus resource [io 0x0000]
[ 1.909895] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 1.916910] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 1.925131] pci 0000:00:00.0: [168c:abcd] type 00 class 0x020000
[ 1.931394] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x0001ffff 64bit]
[ 1.938460] pci 0000:00:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[ 1.945477] pci 0000:00:00.0: supports D1
[ 1.949638] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[ 1.956617] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 1.963499] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x1201ffff 64bit]
[ 1.971079] pci 0000:00:00.0: BAR 6: assigned [mem 0x12020000-0x1202ffff pref]
[ 1.981566] UBI: auto-attach mtd1
[ 1.985018] ubi0: attaching mtd1
[ 4.020959] ubi0 warning: 0x803c0900: valid VID header but corrupted EC header at PEB 991
[ 4.029432] ubi0 error: 0x803bfb28: two LEBs with same sequence number 1
[ 4.036357] eraseblock attaching information dump:
[ 4.041316] ec 1
[ 4.043836] pnum 990
[ 4.046545] lnum 0
[ 4.049068] scrub 0
[ 4.051595] sqnum 1
[ 4.054120] Volume identifier header dump:
[ 4.058350] magic 55424921
[ 4.061594] version 1
[ 4.064201] vol_type 1
[ 4.066817] copy_flag 1
[ 4.069434] compat 5
[ 4.072043] vol_id 2147479551
[ 4.075464] lnum 0
[ 4.078080] data_size 22528
[ 4.081047] used_ebs 0
[ 4.083662] data_pad 0
[ 4.086279] sqnum 1
[ 4.088886] hdr_crc 6be26d14
[ 4.092130] Volume identifier header hexdump:
[ 4.096913] ubi0 error: 0x803b43f8: failed to attach mtd1, error -22
[ 4.103591] UBI error: cannot attach mtd1
[ 4.108371] /dev/root: Can't open blockdev
[ 4.112661] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 4.120396] Please append a correct "root=" boot option; here are the available partitions:
[ 4.129030] 1f00 4096 mtdblock0
[ 4.129033] (driver?)
[ 4.135790] 1f01 126976 mtdblock1
[ 4.135792] (driver?)
[ 4.142553] 1f02 256 mtdblock2
[ 4.142556] (driver?)
[ 4.149318] 1f03 64 mtdblock3
[ 4.149320] (driver?)
[ 4.156074] 1f04 64 mtdblock4
[ 4.156076] (driver?)
[ 4.162838] 1f05 64 mtdblock5
[ 4.162840] (driver?)
[ 4.169603] 1f06 64 mtdblock6
[ 4.169605] (driver?)
[ 4.176361] 1f07 64 mtdblock7
[ 4.176363] (driver?)
[ 4.183123] 1f08 1408 mtdblock8
[ 4.183125] (driver?)
[ 4.189888] 1f09 64 mtdblock9
[ 4.189890] (driver?)
[ 4.196645] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 4.205176] Rebooting in 1 seconds..
就是这样不断重启
除非在重启过程中打断它,才会停留在这里:
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: dc:ef:09:dd:61:06
eth0 up
eth0
Setting 0x181162c0 to 0x48902100
Hit any key to stop autoboot: 0
ath>
然后就想着怎么刷机,openwrt没有中文解决方案,搜索故障信息也没有头绪。
有人的办法是让路由器从tftp服务器端取u-boot.bin,和openwrt固件。这个办法太高端了,需要把文件准确的写在特定的物理地址上,这个地址是多少太难判断了。
还有用CFE的办法,也不行,这个残废的uboot系统没有那么强大。
神器复活
快要绝望时手贱运行了bootm.
ath> bootm
## Booting image at 81000000 ...
Bad Magic Number
Trying eth0
eth0 link down
FAIL
The Router is in TFTP Server Firmware Recovery mode NOW!
Listening on Port : 69, IP Address: 192.168.1.1...
然后就有字符闪烁,大脑瞬间像涂了芥末,这应该是tftpserver的意思吧?
于是连接电脑和路由器的口,从电脑用tftp客户端向路由器发送原装固件,速度非常快,它会自动存在适当的位置,自动重启,然后就活了,又可以愉快的折腾了。
不建议其他品牌路由器这么做,因为网件的官方做法就是通过tftp上传固件来恢复系统。
这个办法没有搜到过,特意写下来分享。