|
本帖最后由 楠楠 于 2020-12-11 07:31 编辑
本人不是专业码农,只是自己理解的表面东西,下面写的不是无脑教程,抛砖引玉,有错误的地方勿喷
K3板块里有很多发帖求助救砖的,本人也是入坑,找资料,再顺利爬出来,下面说说我对博通系列的CFE的理解,K3救砖、换非三星NAND闪存后刷机等都可以参考一下
救砖、换闪存等操作前提是用SPI双启动,双启动改造方法自行搜索;TTL小板也是必备工具,TTL连接K3输入命令等操作最稳定可靠
所谓救砖就是SPI启动后用命令把CFE 文件正确的写进NAND,再从NAND上启动CFE用正确的刷机命令把固件文件写入NAND正确的分区,再启动K3。
论坛里的救砖帖子一般是小白教程,按步骤照着做,具体为什么这么操作,介绍的很少
遇到一点问题就会刷机失败,而且还不知道原因,论坛里又找不到答案,然后就是凉凉,或者送修
我喜欢问为什么,知道自己每一步在干什么,但是网上找不到关于CFE命令的详解,于是TTL连接后研究了一下CFE的使用方法,
CFE可以理解为路由器的最小操作系统,支持TTL连接的命令行、HTTP、FTP等协议
CFE本身是有帮助系统的,TTL连接使用,输入help就可以看到各种命令的列表,具体命令的使用参数介绍直接输入命令 或者 加参数 /? 。
比如flash命令的帮助文本是:
CFE> flash
flash [options] filename [flashdevice]
Copies data from a source file name or device to a flash memory device.
The source device can be a disk file (FAT filesystem), a remote file
(TFTP) or a flash device. The destination device may be a flash or eeprom.
If the destination device is your boot flash (usually flash0), the flash
command will restart the firmware after the flash update is complete
-noerase Don't erase flash before writing
-offset=* Begin programming at this offset in the flash device
-size=* Size of source device when programming from flash to flash
-noheader Override header verification, flash binary without checking
-noboot Remove boot and header lenght
-forceflash Dangerous Command, Don't use if you don't know what you do
-erase Erase the partition, can set the offset and length
-mem Use memory as source instead of a device
spi启动可以刷写NAND的固件,tb和各路大神给出了刷cfe的命令,
192.168.2.1/do.htm?cmd=flash+-noheader+192.168.2.10:mtd0.img+nflash0.brcmnand
其实仔细看看CFE的帮助系统,刷固件的命令是需要把固件的bin文件或者trx文件写入正确的固件分区,如下
192.168.2.1/do.htm?cmd=flash+-noheader+192.168.2.2:K3.bin+nflash0.trx
或者TTL里直接刷
flash -noheader 192.168.2.2:K3.bin nflash0.trx
注意:最后的 nflash0.trx 就是代表固件分区,但是CFE版本不同,对固件分区的命名也不同
比如Ghost大的最新384 K3适配CFE里有 show devices 命令,可以直接查看分区名称,写入对应的分区就行了
CFE> show devices
Device Name Description
------------------- ---------------------------------------------------------
uart0 NS16550 UART at 0x18000300
uart1 NS16550 UART at 0x18000400
nflash0 AMD NAND flash size 131072KB
nflash0.boot AMD NAND flash offset 0 size 512KB
nflash0.nvram AMD NAND flash offset 80000 size 3584KB
nflash0.trx AMD NAND flash offset 400000 size 1KB
nflash0.os AMD NAND flash offset 40001C size 126976KB
nflash1.boot AMD NAND flash offset 0 size 512KB
nflash1.nvram AMD NAND flash offset 80000 size 3584KB
nflash1.trx AMD NAND flash offset 400000 size 61440KB
nflash1.brcmnand AMD NAND flash offset 4000000 size 65536KB
可惜斐讯原版CFE没有 show devices 这个命令
如果CFE写入NAND不能正常成功启动,需要擦除一下CFE分区,用命令:
flash -erase nflash0.brcmnand
不要重启,不要重启,不要重启,直接再写一次CFE 就会正常启动了
CFE写入NAND能正常启动后,K3就活了,启动NAND的CFE,刷固件等就是常规操作
啥都没隐藏,嘿嘿嘿
乱七八糟写一堆,重点是通过CFE的帮助系统学习CFE命令行怎么使用,救砖就易如反掌了
|
|