小米路由器4使用ttl刷breed、pandavan和openwrt
前言
一年前买了一个小米路由4,本来想刷openwrt的,结果被告知没有开发板固件,一直吃灰中,最近发现网上有刷breed的教程,自己动手尝试一下,过程记录在这里。
拆机&焊接ttl线
焊接过程不多说了,3v3不用连接,板子上“贴心”的标好了tx和rx,记得互换位置。
注意:路由器串口检测到高电平就不启动,所以先插好电源,再连接ttl线 。
问题
小米路由器第一次启动后,会往uboot 配置(nvram)里写入 uart_en=0 ,导致uboot引导后,不接受ttl输入,只能查看,从而没法从ttl刷机了 。
解决方法
连好ttl线,PC开启putty打开com,参数是标准 115200 8N1
进入小米路由器设置选项,选择恢复出厂设置,重启
看到uboot引导时候,不停按键盘 4 键(进入uboot 命令行)
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
进入uboot命令行以后,输入:
setenv uart_en 1
saveenv
这样以后ttl口就会一直生效了
刷机过程
下载刷机工具,记得校验breed (要刷openwrt直接看下面,不要刷breed!!)
文件大小:105490 字节
修改时间:2019年6月13日 14:42:16
MD5 :6C6965AFC478D2FFAB2CF5CAA80A92B9
SHA1 :43A1B30C4C0209F9A506F2FF73DD43D6AA3AFB8D
CRC32 :CEB7AC52
因为r4 和r3g的区别,就是 阉割了128M内存和usb口,所以直接使用小米3g的版本即可
开启tftpd,设置pc ip(我这里是192.168.31.2)拔电,插电, 在引导界面 按9
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
You choosed 9
然后会有一系列确认,按照你需要的修改各项
9: System Load Boot Loader then write to Flash via TFTP.
Warning!! Erase Boot Loader in Flash then burn new one. Are you sure?(Y/N)
Please Input new ones /or Ctrl-C to discard
Input device IP (192.168.31.1) ==:192.168.31.1
Input server IP (192.168.31.33) ==:192.168.31.2
Input Uboot filename (uboot.bin) ==:breed.bin
开始uboot刷机
TFTP from server 192.168.31.2; our IP address is 192.168.31.1
Filename 'breed.bin'.
TIMEOUT_COUNT=10,Load address: 0x80100000
Loading: Got ARP REPLY, set server/gtwy eth addr (00:xx:xx:xx:xx:xx)
Got it
#####################
done
Bytes transferred = 105490 (19c12 hex)
LoadAddr=80100000 NetBootFileXferSize= 00019c12
..ranand_erase: start:0, len:20000
.(5192)offs=0 piece=0 piece_size=105490 rc=0
Done!
接着会直接引导breed
Boot and Recovery Environment for Embedded Devices
Copyright (C) 2018 HackPascal <[email protected]>
Build date 2018-12-29 [git-135bed9]
Version 1.1 (r1266)
DRAM: 128MB
Platform: MediaTek MT7621A ver 1, eco 3
Board: Xiaomi R3G
Clocks: CPU: 880MHz, DDR: 1200MHz, Bus: 293MHz, Ref: 40MHz
Environment variables @ 00060000 on flash bank 0, size 00020000
Flash: Toshiba NAND 128MiB 3.3V 8-bit (128MB) on mt7621-nfi.0
mt7621-nfi.0: Found Fact BBT at block 1023 (offset 0x07fe0000)
mt7621-nfi.0: Block 768 (offset 0x06000000) is marked as bad block in Fact BBT
rt2880-eth: MAC address from EEPROM is invalid, using default settings.
rt2880-eth: Using MAC address 00:0c:43:00:00:01
eth0: MediaTek MT7530 Gigabit switch
Network started on eth0, inet addr 192.168.1.1, netmask 255.255.255.0
Press any key to interrupt autoboot ... 0
这样就完成了,breed刷好了
然后进入breed web控制台 192.168.1.1 ,清除之前的nvram设置,也可以在里面直接刷 pandavan ,过程与r3g相同
PS: 网口 1和3会对调
openwrt刷机过程
创建本地TFTP服务器
路由器上电,按键盘2,选择
2:Load system code then write to Flash via TFTP
之后
Input device IP (192.168.31.1) ==:192.168.31.1
Input server IP (192.168.31.100) ==:192.168.31.2
Input Linux Kernel filename () ==:你下载的文件.bin
等待路由器刷机完成
版权属于:NoColor
转载时须注明出处及本声明