找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1804|回复: 2

诺基亚贝尔EA0326GMP (AX3000) TTL救砖时TFTP无效U-Boot console用loady模式刷回uboot

[复制链接]
本帖最后由 狐狸也糊涂 于 2024-4-27 16:50 编辑

其实是第一次对路由器这么刷机折腾,开始又没注册该论坛会员,没有看相关帖子,所以遇到很多弯弯绕绕,请听小生一一道来
买该路由器源于刷某音看到一相关评测刷机视频,心想家里4台路由器用了快7年,是该换换新的,于是先买2个回来试用看看,某多多下单购买4月17号收到
当天拿1台先试着刷机,按照www.right.com.cn/forum/forum.php?mod=viewthread&tid=8351029上面操作,已经刷好了固件,是加了上面群在群里找的
结果不曾想心里怎么作祟,找到firmware-selector.immortalwrt.org,想刷里面的固件
怀着好奇的心下了immortalwrt-23.05-snapshot-r27674-a0c4e698e4-mediatek-filogic-nokia_ea0326gmp-squashfs-sysupgrade.itb后进uboot web控制台刷不进去
又想着是不是uboot不同才不支持刷进去,于是又下了immortalwrt-23.05-snapshot-r27674-a0c4e698e4-mediatek-filogic-nokia_ea0326gmp-bl31-uboot.fip
进immortalwrt后台,把刚下的uboot上传后又用控制台命令写进FIP分区,接着又在备份升级里试下刷写刚下的固件,提示有问题后心一横被我强制刷写了
刷完后自动重启,等了很久指示灯亮了power灯和mesh灯微亮,心想不对劲哦
断电又按住mesh wps按键通电5秒后放开,结果192.168.1.1打不开uboot web控制台
心头一紧,坏了,应该成砖,有点后悔不该,警醒大家上面类似的行为莫要乱尝试

接下来就动手抢救了,下面是抢救的整个过程
在群里下载了MediaTek Filogic 系列路由器串口TTL救砖教程 - 暗云.rar,解压后详细拜读了一会
拿出2年多前10块买的土豪金ch341A编程器看了下,有TTL功能,于是决定拆机救砖,下面操作是以ch341A编程器来进行
路由器背部上方的两个垫片用吹风机热风吹后取下来,然后拧下两颗螺丝,用撬棒把外壳上下部严禁赌博开就可以,卡扣卡得很紧实



看到主板后找下TTL接口,4脚分别是VCC GND TX RX,路由器通电后用万用表测了下VCC电压是3.3V



下面是接线,VCC接编程器上3.3V,GND接编程器上GND,TX接编程器上RXD,RX接编程器上TXD,编程器上跳帽接23脚TTL刷机





没有万用表测电压的,可以根据芯片型号查找官方资料,从而知道工作电压是多少,如该路由器芯片是W25N01GV



编程器插上电脑,设备管理器出来USB UART-LPT加感叹号,之前下载的该编程器软件包里有个TTL驱动,装上驱动后出来COM21口



MediaTek Filogic 系列路由器串口TTL救砖教程 - 暗云.rar 解压后的文件夹,打开txt文本教程照着操作,把mt7981_nokia_ea0326gmp-fip-fixed-parts.bin复制进该文件夹
在该文件夹内打开CMD命令提示符,输入命令
  1. .\mtk_uartboot.exe -s COM21 -p .\mt7981\mt7981-ddr3-bl2.bin -a -f mt7981_nokia_ea0326gmp-fip-fixed-parts.bin --brom-load-baudrate 921600 --bl2-load-baudrate 1500000
复制代码
出来
mtk_uartboot - 0.1.1
Using serial port: COM21
Handshake...

后给路由器通电,等待跑完

mtk_uartboot - 0.1.1
Using serial port: COM21
Handshake...
hw code: 0x7981
hw sub code: 0x8a00
hw ver: 0xca00
sw ver: 0x1
Baud rate set to 921600
sending payload to 0x201000...
Checksum: 0x55cf
Setting baudrate back to 115200
Jumping to 0x201000 in aarch64...
Waiting for BL2. Message below:
==================================
NOTICE:  BL2: v2.10.0   (release):v2.4-rc0-5845-gbacca82a8-dirty
NOTICE:  BL2: Built : 20:18:08, Feb  2 2024
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  EMI: Using DDR3 settings
NOTICE:  EMI: Detected DRAM size: 256MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  CPU: MT7981 (1300MHz)
NOTICE:  Starting UART download handshake ...
==================================
BL2 UART DL version: 0x10
Baudrate set to: 1500000
FIP sent.
==================================
NOTICE:  Received FIP 0xb34d1 @ 0x40400000 ...
==================================

等跑完这个过程后我按了一下reset键或是几秒,192.168.1.1均打不开,或是按mesh wps键,重复多次后还是不行
最后再仔细研究了下,无意间打开了 MediaTek Filogic 系列路由器串口救砖教程 - 暗云 - 博客园.mhtml



突然从这发现要用串口工具访问串口移动上下键选择操作,感觉又明亮了离成功不远了
随后打开常用软件Xshell点着点着发现可以访问串口,随即创建一个COM21的串口访问配置



又重新操作上面步骤,NOTICE: Received FIP 0xb34d1 @ 0x40400000 ... 跑完这个后,立马用Xshell访问串口按键盘上下键



出来这个界面,跟教程上的略有不同,选了7后出来这个



于是把IP地址设置为192.168.1.254,把要刷的uboot改名为immortalwrt-mediatek-filogic-nokia_ea0326gmp-bl31-uboot.fip
再百度上找了tftpd64下载后打开设置好



随后按ENTER键重回菜单选择7,进入后显示Loading: T T T T T T,T到最后提示Retry count exceeded; starting again
就是找不到电脑上的IP服务器,最后TFTP救砖又没办法

心想这些救砖手段都不起作用,最后还得用编程器救砖吗
随后不停找软件,在www.right.com.cn/forum/thread-8289988-1-1.html找到NeoProgrammer并已经下载好了
在仔细阅读该贴时又随手点开了www.right.com.cn/forum/thread-8265832-1-1.html该贴关于红米AX6000刷机救砖的详细教程
从头到尾先粗略看下,然后仔细阅读救砖方面的,最后发现可以进入U-Boot console用命令操作



于是我也进入U-Boot console,进入后输入help
  1. MT7981> help
  2. ?         - alias for 'help'
  3. askenv    - get environment variables from stdin
  4. base      - print or set address offset
  5. bdinfo    - print Board Info structure
  6. boot      - boot default, i.e., run 'bootcmd'
  7. bootd     - boot default, i.e., run 'bootcmd'
  8. bootelf   - Boot from an ELF image in memory
  9. booti     - boot Linux kernel 'Image' format from memory
  10. bootm     - boot application image from memory
  11. bootmenu  - ANSI terminal bootmenu
  12. bootp     - boot image via network using BOOTP/TFTP protocol
  13. bootvx    - Boot vxWorks from an ELF image
  14. button    - manage buttons
  15. cdp       - Perform CDP network configuration
  16. cmp       - memory compare
  17. coninfo   - print console devices and information
  18. cp        - memory copy
  19. cpu       - display information about CPUs
  20. crc32     - checksum calculation
  21. dcache    - enable or disable data cache
  22. dhcp      - boot image via network using DHCP/TFTP protocol
  23. dm        - Driver model low level access
  24. dns       - lookup the IP of a hostname
  25. echo      - echo args to console
  26. editenv   - edit environment variable
  27. env       - environment handling commands
  28. eraseenv  - erase environment variables from persistent storage
  29. exit      - exit script
  30. false     - do nothing, unsuccessfully
  31. fdt       - flattened device tree utility commands
  32. go        - start application at address 'addr'
  33. gpio      - query and control gpio pins
  34. gpt       - GUID Partition Table
  35. guid      - GUID - generate Globally Unique Identifier based on random UUID
  36. gzwrite   - unzip and write memory to block device
  37. hash      - compute hash message digest
  38. help      - print command description/usage
  39. icache    - enable or disable instruction cache
  40. iminfo    - print header information for application image
  41. imsz      - get image total size (in bytes)
  42. imszb     - get image total size (in blocks)
  43. imxtract  - extract a part of a multi-image
  44. itest     - return true/false on integer compare
  45. led       - manage LEDs
  46. license   - print GPL license text
  47. linklocal - acquire a network IP address using the link-local protocol
  48. loadb     - load binary file over serial line (kermit mode)
  49. loads     - load S-Record file over serial line
  50. loadx     - load binary file over serial line (xmodem mode)
  51. loady     - load binary file over serial line (ymodem mode)
  52. loop      - infinite loop on address range
  53. lzmadec   - lzma uncompress a memory region
  54. md        - memory display
  55. mm        - memory modify (auto-incrementing address)
  56. mtd       - MTD utils
  57. mw        - memory write (fill)
  58. nand      - NAND utility
  59. net       - NET sub-system
  60. nfs       - boot image via network using NFS protocol
  61. nm        - memory modify (constant address)
  62. panic     - Panic with optional message
  63. part      - disk partition related commands
  64. ping      - send ICMP ECHO_REQUEST to network host
  65. pinmux    - show pin-controller muxing
  66. printenv  - print environment variables
  67. pstore    - Manage Linux Persistent Storage
  68. pxe       - commands to get and boot from pxe files
  69. To use IPv6 add -ipv6 parameter
  70. random    - fill memory with random pattern
  71. rarpboot  - boot image via network using RARP/TFTP protocol
  72. readmem   - get environment variable from memory address
  73. reset     - Perform RESET of the CPU
  74. run       - run commands in an environment variable
  75. saveenv   - save environment variables to persistent storage
  76. setenv    - set environment variables
  77. setexpr   - set environment variable as the result of eval expression
  78. showvar   - print local hushshell variables
  79. sleep     - delay execution for some time
  80. smc       - Issue a Secure Monitor Call
  81. sntp      - synchronize RTC via network
  82. source    - run script from memory
  83. strings   - display strings
  84. test      - minimal test like /bin/sh
  85. tftpboot  - load file via network using TFTP protocol
  86. tftpsrv   - act as a TFTP server and boot the first received file
  87. true      - do nothing, successfully
  88. ubi       - ubi commands
  89. ubifsload - load file from an UBIFS filesystem
  90. ubifsls   - list files in a directory
  91. ubifsmount- mount UBIFS volume
  92. ubifsumount- unmount UBIFS volume
  93. unlz4     - lz4 uncompress a memory region
  94. unzip     - unzip a memory region
  95. uuid      - UUID - generate random Universally Unique Identifier
  96. version   - print monitor, compiler and linker version
复制代码
从列出来的命令可以看到load(b s x y),是通过串口来传输文件的,但是不知道具体怎么用
又开始百度找相关loadb loads loadx loady资料,最后从blog.csdn.net/qq_31094099/article/details/86496888看到相关资料



知道命令是通过串口把文件下载到内存里的,但是具体哪个内存地址不敢乱尝试
虽然load命令不敢乱尝试,但其他一些指令可以按按,于是学上图那样,按了个printenv
  1. MT7981> printenv
  2. boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
  3. boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
  4. boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
  5. boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
  6. boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
  7. boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
  8. boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
  9. boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
  10. boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
  11. boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
  12. boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
  13. bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
  14. bootconf=config-1
  15. bootdelay=3
  16. bootfile=immortalwrt-mediatek-filogic-nokia_ea0326gmp-initramfs-recovery.itb
  17. bootfile_bl2=immortalwrt-mediatek-filogic-nokia_ea0326gmp-preloader.bin
  18. bootfile_fip=immortalwrt-mediatek-filogic-nokia_ea0326gmp-bl31-uboot.fip
  19. bootfile_upg=immortalwrt-mediatek-filogic-nokia_ea0326gmp-squashfs-sysupgrade.itb
  20. bootled_pwr=green:power
  21. bootled_rec=green:power
  22. bootmenu_0=Run default boot command.=run boot_default
  23. bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
  24. bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
  25. bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
  26. bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
  27. bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
  28. bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return
  29. bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
  30. bootmenu_8=Reboot.=reset
  31. bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
  32. bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
  33. bootmenu_default=0
  34. bootmenu_delay=3
  35. bootmenu_title=      ( ( ( OpenWrt ) ) )       U-Boot 2023.07.02-ImmortalWrt-r27674-a0c4e698e4 (Apr 19 2024 - 14:40:26 +0000)
  36. console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
  37. ethaddr=e2:bc:ae:e6:33:11
  38. ipaddr=192.168.1.1
  39. loadaddr=0x46000000
  40. mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
  41. mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
  42. reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
  43. serverip=192.168.1.254
  44. ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 || run ubi_format
  45. ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
  46. ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
  47. ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
  48. ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
  49. ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
  50. ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize
  51. ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize
  52. ver=U-Boot 2023.07.02-ImmortalWrt-r27674-a0c4e698e4 (Apr 19 2024 - 14:40:26 +0000)

  53. Environment size: 4531/126971 bytes
复制代码
结果从里面发现了
loadaddr=0x46000000
mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
mtd_write_fip=mtd erase fip && mtd write fip $loadaddr

这个loadaddr=0x46000000莫不是内存地址,而且 mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
mtd_write_fip=mtd erase fip && mtd write fip $loadaddr 就是擦除和刷写bl2和fip的命令
仔细找找又发现了
bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return

run boot_tftp_write_fip 是运行boot_tftp_write_fip命令,往上又发现
boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory

最后凑起来不就是
  1. boot_tftp_write_fip=tftpboot 0x46000000 $bootfile_fip && mtd erase fip && mtd write fip 0x46000000 && run reset_factory
复制代码

既然前面试过tftp模式不起作用,那可以把 tftpboot 0x46000000 $bootfile_fip 命令改为 load* 0x46000000 命令执行,然后串口传文件进去
在Xshell上查了下,文件—传输 里也有X和Y两种传输模式



开始尝试X模式,输入命令loadx 0x46000000 回车执行,然后Xshell选择X模式传输uboot,结果失败了
接着尝试Y模式,输入命令loady 0x46000000 回车执行,然后Xshell选择Y模式传输uboot,传输速度8KB左右



等文件传输完成后,关闭传输窗口,输入命令 mtd erase fip && mtd write fip 0x46000000 开始刷写uboot
输出如下
  1. MT7981> loady 0x46000000
  2. ## Ready for binary (ymodem) download to 0x46000000 at 115200 bps...
  3. End of file
  4. ## Binary (ymodem) download aborted
  5. MT7981> mtd erase fip && mtd write fip 0x46000000
  6. Erasing 0x00000000 ... 0x001fffff (16 eraseblock(s))
  7. Writing 2097152 byte(s) (1024 page(s)) at offset 0x00000000
  8. MT7981>
复制代码
最后断电,按住MESH WPS按键通电5秒后松开,输入192.168.1.1,uboot web控制台又回来



后记:几天后,当我想把该过程重新复现时,又是不同的结果:

结果1:mtk_uartboot救砖时,第一次命令操作跑完后,立即按住reset键5秒松开后,可以进入192.168.1.1

断电后又重新开始mtk_uartboot命令,跑完后不理,不按任何按键,过了一会儿也是可以进入192.168.1.1,跟我当时救砖时不同,怎么尝试都打不开192.168.1.1


在进入192.168.1.1后,刷写了237大的immortalwrt固件,自动重启后,隔一会儿断电,又mtk_uartboot操作一次命令,隔一会儿后wifi和lan灯亮了
这时打开192.168.1.1可以进入immortalwrt后台,所以这时也可以上传uboot后刷写禁FIP分区
然后再次复现时又不这样了,只能进入uboot web控制台,没有正常启动运行immortalwrt固件

结果2mtk_uartboot命令操作跑完后,串口软件立马访问,即我用Xshell访问COM21串口,然后快速按键盘上下键,出来的bootmenu是mtk_uartboot命令传进去的uboot的
而我当初在用mtk_uartboot命令救砖时,不管怎么尝试出来的bootmenu,都是我刷进去的immortalwrt官方的

结果3:Tftpd64打开后,uboot启动选项里又能正常访问到192.168.1.254这个IP,并下载固件进行刷写,原以为是我误勾防火墙选项把Tftpd64给禁了,结果这么多天没关过电脑,现在试又正常

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

相关帖子

大佬,能总结一下吗!根据https://www.right.com.cn/forum/thread-8371833-1-1.html,到刷uboot指令mtd write /tmp/mt7981_nokia_ea0326gmp-fip-fixed-parts.bin FIP,总是提示出错,好像是什么网络问题。但是可以正常上网重启,重启后放在tmp的uboot文件不在。
后来找到https://www.right.com.cn/forum/thread-8302668-1-1.html,下载里面mt7981_cmcc_rax3000m-fip-fixed-parts.bin,上传到tmp开刷,还是出现之前一样的提示。这时候上网没问题的,就想着会不会uboot已经刷进去了呢!重开之后电源灯亮,mesh灯微亮,一直这状态。长按reset开机mesh灯会长亮,但是也无法访问192.168.10.1。估计变砖了。
买了340TTL在等待到货,该怎么救砖呢?
回复

使用道具 举报

 楼主| | 显示全部楼层
kosaki 发表于 2024-4-26 16:27
大佬,能总结一下吗!根据https://www.right.com.cn/forum/thread-8371833-1-1.html,到刷uboot指令mtd wri ...

TTL接好线后插电脑,看设备管理器,出来com端口后就用串口访问软件访问这个新出来的com口,然后开机,软件上面就会显示一些开机过程,此时点进去里面按键盘上下键可以截停开机过程,停留在bootmenu
回复

使用道具 举报

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

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

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

GMT+8, 2024-5-9 07:25

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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