找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
楼主: zyguowei

[PRO(R3P)] 小米路由器R3P拆机_NAND改SPI(内含高清图慎入)

  [复制链接]
发表于 2019-6-27 22:00 | 显示全部楼层
本帖最后由 laomao9000 于 2019-6-28 00:22 编辑
fyi2000 发表于 2019-6-23 07:24
So, that's the key. I almost forgot that you had reported a bug of pb-boot on R3P with Micron NAND ...

@tolikvl @fyi2000 换上了Micron NAND,通过SPI启动,刷入了PB-BOOT,然后切换到NAND启动,可以进入PB-BOOT的WEB界面了!
但是,接下来刷入固件,在40%多的地方失败!!看了看TTL控制台,应该是FLASH有坏块,刷写不成功。
如何解决?

点评

#11  详情 回复 发表于 2019-6-28 05:24
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-28 05:24 | 显示全部楼层
laomao9000 发表于 2019-6-27 22:00
@tolikvl @fyi2000 换上了Micron NAND,通过SPI启动,刷入了PB-BOOT,然后切换到NAND启动,可以进入PB-BO ...

#11
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-28 11:04 | 显示全部楼层

1.frist,upgrade to last pb-boot,fix skip badblock bug in nand write
https://downloads.pangubox.com/l ... boot-xiaomi-r3p.img
这个是刷入SPI还是nand?
我试了刷入NAND,启动PBBOOT,在web界面无法完成下面这步,报错
2.second,upgrade a initramfs firmware under pb-boot.
https://downloads.pangubox.com/l ... nitramfs-kernel.bin

=================================================
Data load at 0x80300000,len:0x4c508a.
Check image:
Image type              --> Firmware
Image Header Checksum   --> OK
Image Data Checksum     --> OK

=================================================
[TCP/IP]udp: no matching connection found
[HTTPD]File upload done!

[TCP/IP]udp: no matching connection found
[TCP/IP]udp: no matching connection found
[TCP/IP]udp: no matching connection found
[TCP/IP]udp: no matching connection found
[TCP/IP]udp: no matching connection found
[TCP/IP]udp: no matching connection found
[TCP/IP]udp: no matching connection found
[kernel]Firmware Upgrade Tasks detect!!
Upgrade linux kernel block !!
nand writing:
  0%ranand_erase: attempt to erase a bad block at 0x00200000
bad block: 200000, try next: 220000
ranand_erase: attempt to erase a bad block at 0x00220000
bad block: 220000, try next: 240000                                           2%[TCP/IP]udp: no matching connection found                                    13%[TCP/IP]udp: no matching connection found                                    18%[TCP/IP]udp: no matching connection found                                    20%ranand_erase: attempt to erase a bad block at 0x00340000
bad block: 340000, try next: 360000
ranand_erase: attempt to erase a bad block at 0x00360000
bad block: 360000, try next: 380000
ranand_write: attempt to write a bad block at 0x00000000,mark it bad
done. 5001354 bytes written
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-28 16:29 | 显示全部楼层
本帖最后由 fyi2000 于 2019-6-28 17:17 编辑
laomao9000 发表于 2019-6-28 11:04
1.frist,upgrade to last pb-boot,fix skip badblock bug in nand write
https://downloads.pangubox.co ...

tolikvl已经说了pb-boot-xiaomi_r3p-20190317-61b6d33.img支持Micron

其次,从串口登陆pb-boot,载入initramfs至内存中执行,避开写入错误

最後,建议向其他网友要一份最新支持Micron NAND闪存的官方u-boot备份,因为小米官方并未提出带此u-boot的官方固件,所以刷错官方固件可能会变砖
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-28 20:44 | 显示全部楼层
本帖最后由 laomao9000 于 2019-6-28 22:35 编辑
fyi2000 发表于 2019-6-28 16:29
tolikvl已经说了,pb-boot-xiaomi_r3p-20190317-61b6d33.img支持Micron

其次,从串口登陆pb-boot,载 ...

lintel说在PB-BOOT可以跳过坏块,正确第装入initramfs固件,这一步我已经完成了。现在可以启动,进入initramfs的固件,接下来的第三步不明白,具体如何做个upgrade?是在web页面做固件升级吗?(3.third,do sysupgrade follow firmware under the "initramfs firmware"

目前问题:我启动initramfs,通过固件升级安装了固件,仍然无法启动:
1、启动initramfs,进入固件升级界面,安装PandoraBox-ralink-mt7621-xiaomi-r3p-2019-02-17-git-9d8fbcf27-squashfs-sysupgrade.bin
     TTL输出:
killall: dropbear: no process killed
Sending TERM to remaining processes ...logd rpcd netifd odhcpd crond ntpd dnsmasq sh sysupgrade ubus ubusd
Sending KILL to remaining processes ...
Performing system upgrade...
Unlocking kernel ...
Writing from <stdin> to kernel...  [e]
Skipping bad block at 0x00020000[e]
Skipping bad block at 0x00040000[e]
Skipping bad block at 0x00060000[e]
Skipping bad block at 0x00080000[e]
Skipping bad block at 0x000a0000[e]
Skipping bad block at 0x000c0000[e]
Skipping bad block at 0x000e0000[e]
Skipping bad block at 0x00100000[e]
Skipping bad block at 0x00120000[e]
Skipping bad block at 0x00140000[e]
Skipping bad block at 0x0016000
ubidetach: error!: cannot detach"/dev/mtd10"
          error 19 (No such device)
ubiformat: mtd10 (nand), size 244711424bytes (233.4 MiB), 1867 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size2048 bytes
libscan: scanning eraseblock 1866 -- 100 %complete
ubiformat: 1866 eraseblocks have validerase counter, mean value is 0
ubiformat: 1 eraseblocks are supposedlyempty
ubiformat: flashing eraseblock 151 -- 100 %complete
ubifo[ 143.584000] UBI: attaching mtd10 to ubi0mplete
ubiformat: formatting eraseblock 1[  143.644000] UBI: EOF marker found, PEBs from147 will be erased
812 -- 96 % comp[  143.652000] UBI: scanning is finished
ubifo[ 143.676000] UBI: volume 1 ("rootfs_data") re-sized from 9 to1678 LEBs
rmat: formatting eraseblock 1817[  143.684000] UBI: attached mtd10 (name"ubi", size 233 MiB) to ubi0
--97 % complet[  143.692000] UBI: PEB size:131072 bytes (128 KiB), LEB size: 126976 bytes
ubiformat: f[  143.700000] UBI: min./max. I/O unit sizes:2048/2048, sub-page size 2048
ormatting eraseb[  143.708000] UBI: VID header offset: 2048(aligned 2048), data offset: 4096
lock 1818 -- 97 [  143.716000] UBI: good PEBs: 1867, bad PEBs:0, corrupted PEBs: 0
ubi[ 143.724000] UBI: user volume: 2, internal volumes: 1, max. volumescount: 128
format: formatti[  143.732000] UBI: max/mean erase counter: 2/1,WL threshold: 4096, image sequence number: 96317419
ng eraseblock 18[  143.744000] UBI: available PEBs: 0, totalreserved PEBs: 1867, PEBs reserved for bad PEB handling: 40
19 -- 97 % compl[  143.752000] UBI: background thread"ubi_bgt0d" started, PID 1867
ubiformat: formatting eraseblock 1866 --100 % complete
UBI device number 0, total 1867 LEBs(237064192 bytes, 226.1 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes(124.0 KiB)
sysupgrade successful
umount: can't unmount /dev: Device orresource busy
umount: can't unmount /tmp: Device orresource busy
[ 145.300000] reboot: Restarting system
[ 145.304000] soft-resetting all blocks ...

2、安装完毕,自动重启,报CRC错误,自动进入PBBOOT
PandoraBox-Boot Version 2.1
Build:Feb 21 2019-07:26:39
SoC:MT7621AT
Memory-Testing...524288K OK
DRAM HighMem Reserved
MT7621:CPU clock set to 880Mhz
PCIe:reset controller
Software System Reset
PB-Boot running at 0x9BF9C000!
NAND: MT29F2G08ABAEA 256MiB
Using internal default config
Board:Xiaomi R3P
PandoraBox GPIO subsystem init
PandoraBox MT762x GPIO driver initialized.
GPIO_Mode_REG: 0x000AD028
PandoraBox LED subsystem init
LED [Power] registered
PandoraBox Button subsystem init
Button [Reset] registered
Enable USB#1 Power
MT7530 GSW initialized
MT7530 set LAN/WAN WLLLL                                                                    0
Booting from Flash...
Booting image from bc200000 ...
  Image Name:   MIPS PandoraBoxLinux-3.14.79
  Image Type:   MIPS Linux KernelImage (lzma compressed)
  Data Size:    1489355 Bytes =  1.4 MB
  Load Address: 80001000
  Entry Point:  80001000
ranand_read: skip reading a bad block220000 -> 240000
ranand_read: skip reading a bad block240000 -> 260000
ranand_read: skip reading a bad block260000 -> 280000
ranand_read: skip reading a bad block280000 -> 2a0000
ranand_read: skip reading a bad block2a0000 -> 2c0000
ranand_read: skip reading a bad block2c0000 -> 2e0000
ranand_read: skip reading a bad block2e0000 -> 300000
ranand_read: skip reading a bad block300000 -> 320000
ranand_read: skip reading a bad block320000 -> 340000
ranand_read: skip reading a bad block340000 -> 360000
ranand_read: skip reading a bad block360000 -> 380000
  Verifying Checksum ... Bad Data CRC
  ______________________________________________________
|                                                    |
|           HTTPD Recovery Modulev3.0              |
|                                                   |
| Notelease Use Web Browser Upgrade theFirmware ! |
|                                                   |
|         Copyright 2017 PandoraBox Team            |
|____________________________________________________|
[kernel]uOS Version: v2.0
[kernel]PWM-LED Thread started!!
[kernel]Task Thread started!!
[TCP/IP]ETH0 MAC:78:11C:05:C2:4C
[TCP/IP]Max ReceiveBuffer:1492!
[TCP/IP]IP:192.168.1.1
[TCP/IP]Netmask:255.255.255.0
[TCP/IP]Default Router:0.0.0.0
[DHCPD]Server IP:192.168.1.1
Ralink GMAC initializing
[kernel]Enter uOS core task!


我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-28 22:40 | 显示全部楼层
laomao9000 发表于 2019-6-28 20:44
lintel说在PB-BOOT可以跳过坏块,正确第装入initramfs固件,这一步我已经完成了。现在可以启动,进入init ...

initramfs没刷成功,所以固件还是官方固件,看mtd分区便可知,请按照我的方法载入内存执行,再升级2-21的潘多拉,19.02比2-21还旧,只能等lintel大神更新
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-28 23:50 | 显示全部楼层
fyi2000 发表于 2019-6-28 22:40
initramfs没刷成功,所以固件还是官方固件,看mtd分区便可知,请按照我的方法载入内存执行,再升级2-21的 ...

刷机显示成功,缺总是报CRC错误。
现在无论刷官方固件还是pandorabox,都显示成功,却都不能启动。

尴尬了!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-29 00:11 | 显示全部楼层
本帖最后由 fyi2000 于 2019-7-1 20:28 编辑
laomao9000 发表于 2019-6-28 20:44
lintel说在PB-BOOT可以跳过坏块,正确第装入initramfs固件,这一步我已经完成了。现在可以启动,进入init ...
PuTTY登陆pb-boot
载入initramfs到内存并执行
  1. tftp 0x90000000 PandoraBox-ralink-mt7621-xiaomi-r3p-initramfs-kernel.bin
  2. bootm 0x90000000
复制代码
PuTTY登陆潘多拉
  1. cd /tmp
  2. wget -O - http://192.168.1.100/PandoraBox-ralink-mt7621-xiaomi-r3p-2019-02-17-git-9d8fbcf27-squashfs-sysupgrade.bin | dd of=kernel.bin bs=1 count=$((0x16ba0b))
  3. mtd verify kernel.bin kernel
复制代码
如果比对错误,请把kernel分区下载至电脑,再和02-17固件前0x16ba0b字节比对
或者试试
  1. sysupgrade -v -n PandoraBox-ralink-mt7621-xiaomi-r3p-2019-02-17-git-9d8fbcf27-squashfs-sysupgrade.bin
复制代码
不过我不知道mtd & sysupgrade命令能否处理闪存坏块

另外我看到官方bootlog显示 "load_fact_bbt success 2047",貌似官方固件可以处理UBI/rootfs分区的坏块
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-30 00:27 | 显示全部楼层
换个闪存试试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-7-1 20:36 | 显示全部楼层
laomao9000 发表于 2019-6-28 23:50
刷机显示成功,缺总是报CRC错误。
现在无论刷官方固件还是pandorabox,都显示成功,却都不能启动。

Micron闪存是全新的吗?坏块让人难以理解,如果用lintel大神的方法不成,那么不妨试试小米官方U盘刷机!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-7-1 21:50 | 显示全部楼层
fyi2000 发表于 2019-7-1 20:36
Micron闪存是全新的吗?坏块让人难以理解,如果用lintel大神的方法不成,那么不妨试试小米官方U盘刷机!
...

某宝淘来的,不好说啊。坏块太讨厌,无法进行了。尝试了刷入官方kernel,以便U盘恢复,不成功,刷入kernel过程就报错了,CRC错误,可能是芯片不过关。
但经过此次折腾,可以证明:

micron NAND可以和SPI并存,不必切换CS片选信号,PBBOOT支持。这是一个非常好入口,方便救砖。
最简单的还是直接换SPI 闪存,以后想刷就刷,更简单了。所以, 我现在也不折腾NAND了,继续探索OPENWRT的优化,包括MTK闭源驱动和OPENWRT开源驱动(OPENWRT 18.06.3 SNAPSHOT支持了MT7615,刚刚)。OPENWRT更强大,更灵活。其实,小米的官方系统也是基于OPENWRT的。

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-7-2 11:19 | 显示全部楼层
laomao9000 发表于 2019-7-1 21:50
某宝淘来的,不好说啊。坏块太讨厌,无法进行了。尝试了刷入官方kernel,以便U盘恢复,不成功,刷入kerne ...

能不能最后帮我一个忙?我只想验证在线切换能不能免halt/reset处理器,在内存执行另一个适配NAND的Bootloader?如果你已经在J10/J11装上开关,那么应该不难才是,你已经完成了这么多,不差最后这么一点点时间才是

我看了许多教程,确定在线切换不会死机,但是就是没有任何关于从SPI启动之后,再想办法启动另一个适配NAND的Bootloader的实验报告,这么简单的道理,验证并不难,缺少的是硬件和愿意尝试的人,你可以帮我吗?

从SPI启动
按4进入命令模式
tftp 0x90000000 pb-boot-r3p.img
切换至NAND
bootm 0x90000000
按4进入命令模式
nand read 0 40

请把TTL输出贴上来,如果没有错误,那就有机会执行官方的U盘刷机,对你来说也是多一个机会,看看哪个固件处理坏块的能力比较强

感激不尽
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-7-2 11:57 来自手机 | 显示全部楼层
本帖最后由 fyi2000 于 2019-7-2 12:01 编辑

还有一点,官方固件分区有两套系统,kernel0有坏块,那么还有kernel1,你帮我实验,我帮你U盘刷机,总之请不要现在就放弃!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-7-2 23:38 | 显示全部楼层
本帖最后由 laomao9000 于 2019-7-2 23:40 编辑
fyi2000 发表于 2019-7-2 11:57
还有一点,官方固件分区有两套系统,kernel0有坏块,那么还有kernel1,你帮我实验,我帮你U盘刷机,总之请 ...

问题是MTD写入报错,CRC错误,过不去。然后PBBOOT拒绝加载内核。
所以initramfs下的upgrade无法成功。唯一可行的就是PBBOOT下的刷机,但只能保证initramfs刷入成功,加载成功。普通固件因为有多个分区,rootfs部分是内核加载的,无法兼容坏块。

1、启动initramfs,进入固件升级界面,安装PandoraBox-ralink-mt7621-xiaomi-r3p-2019-02-17-git-9d8fbcf27-squashfs-sysupgrade.bin
     TTL输出:
killall: dropbear: no process killed
Sending TERM to remaining processes ...logd rpcd netifd odhcpd crond ntpd dnsmasq sh sysupgrade ubus ubusd
Sending KILL to remaining processes ...
Performing system upgrade...
Unlocking kernel ...
Writing from <stdin> to kernel...  [e]
Skipping bad block at 0x00020000[e]
Skipping bad block at 0x00040000[e]
Skipping bad block at 0x00060000[e]
Skipping bad block at 0x00080000[e]
Skipping bad block at 0x000a0000[e]
Skipping bad block at 0x000c0000[e]
Skipping bad block at 0x000e0000[e]
Skipping bad block at 0x00100000[e]
Skipping bad block at 0x00120000[e]
Skipping bad block at 0x00140000[e]
Skipping bad block at 0x0016000
ubidetach: error!: cannot detach"/dev/mtd10"
          error 19 (No such device)
ubiformat: mtd10 (nand), size 244711424bytes (233.4 MiB), 1867 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size2048 bytes
libscan: scanning eraseblock 1866 -- 100 %complete
ubiformat: 1866 eraseblocks have validerase counter, mean value is 0
ubiformat: 1 eraseblocks are supposedlyempty
ubiformat: flashing eraseblock 151 -- 100 %complete
ubifo[ 143.584000] UBI: attaching mtd10 to ubi0mplete
ubiformat: formatting eraseblock 1[  143.644000] UBI: EOF marker found, PEBs from147 will be erased
812 -- 96 % comp[  143.652000] UBI: scanning is finished
ubifo[ 143.676000] UBI: volume 1 ("rootfs_data") re-sized from 9 to1678 LEBs
rmat: formatting eraseblock 1817[  143.684000] UBI: attached mtd10 (name"ubi", size 233 MiB) to ubi0
--97 % complet[  143.692000] UBI: PEB size:131072 bytes (128 KiB), LEB size: 126976 bytes
ubiformat: f[  143.700000] UBI: min./max. I/O unit sizes:2048/2048, sub-page size 2048
ormatting eraseb[  143.708000] UBI: VID header offset: 2048(aligned 2048), data offset: 4096
lock 1818 -- 97 [  143.716000] UBI: good PEBs: 1867, bad PEBs:0, corrupted PEBs: 0
ubi[ 143.724000] UBI: user volume: 2, internal volumes: 1, max. volumescount: 128
format: formatti[  143.732000] UBI: max/mean erase counter: 2/1,WL threshold: 4096, image sequence number: 96317419
ng eraseblock 18[  143.744000] UBI: available PEBs: 0, totalreserved PEBs: 1867, PEBs reserved for bad PEB handling: 40
19 -- 97 % compl[  143.752000] UBI: background thread"ubi_bgt0d" started, PID 1867
ubiformat: formatting eraseblock 1866 --100 % complete
UBI device number 0, total 1867 LEBs(237064192 bytes, 226.1 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes(124.0 KiB)
sysupgrade successful
umount: can't unmount /dev: Device orresource busy
umount: can't unmount /tmp: Device orresource busy
[ 145.300000] reboot: Restarting system
[ 145.304000] soft-resetting all blocks ...

2、上面自动刷机不成功,改用手工刷机:

#mtd write fw.bin firmware

Unlocking firmware ...
Writing from fw.bin to firmware ...  [e]
Skipping bad block at 0x00020000[e]
Skipping bad block at 0x00040000[e]
Skipping bad block at 0x00060000[e]
Skipping bad block at 0x00080000[e]
Skipping bad block at 0x000a0000[e]
Skipping bad block at 0x000c0000[e]
Skipping bad block at 0x000e0000[e]
Skipping bad block at 0x00100000[e]
Skipping bad block at 0x00120000[e]
Skipping bad block at 0x00140000[e]
Skipping bad block at 0x00160000[e]
Skipping bad block at 0x00400000[w]

#mtd verify fw.bin firmware
Verifying firmware against fw.bin ...
a07c63ecc37c5933115845487853b700 - firmware
93fb6d90808fad7487ae05dcbc6c0c46 - fw.bin
Failed

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-7-2 23:47 | 显示全部楼层

手头有两片NAND,一批买入,换上后报同样的坏块。
可能不是NAND问题,会不会是我的BGA焊接不过关,造成地址信号线丢失了一条呢?有懂行的分析下这个坏块分布,看是不是地址线接触不良,是哪个管脚没焊接好。
ranand_read: skip reading a bad block220000 -> 240000
ranand_read: skip reading a bad block240000 -> 260000
ranand_read: skip reading a bad block260000 -> 280000
ranand_read: skip reading a bad block280000 -> 2a0000
ranand_read: skip reading a bad block2a0000 -> 2c0000
ranand_read: skip reading a bad block2c0000 -> 2e0000
ranand_read: skip reading a bad block2e0000 -> 300000
ranand_read: skip reading a bad block300000 -> 320000
ranand_read: skip reading a bad block320000 -> 340000
ranand_read: skip reading a bad block340000 -> 360000
ranand_read: skip reading a bad block360000 -> 380000
  Verifying Checksum ... Bad Data CRC
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-24 14:20

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表