webpad 发表于 2016-12-9 15:54

DM1001系列 PB.30.31.20~ 30.31.51 TTL降级方法 ,无需编程器

本帖最后由 webpad 于 2017-3-18 23:56 编辑

新方法直接线刷,请见线刷贴~https://www.znds.com/tv-610313-1-1.html

整个过程的终端记录


背景:
大麦盒子DM1001、1004、1005、1102 升级到官方固件PB.30.01.20 之后,将无法使用recovery降级到低版本固件,
刷机过程出错比如会提示UTC错误信息, 原因是新固件更新了主板bootloader和recovery分区,使得降级失败。

下面以一台升级到了PB.30.31.20的DM1004为目标进行降级,
主要方法就是 TTL进入uboot环境后烧录低版本bootloader,运行旧版recovery刷入旧版固件,直至刷入石头rom。

本方法不需要拆下主板上的spi flash芯片用编程器改写bootloader,仅运行uboot环境中的烧录指令即可。

工具设备:
PC电脑一台、PL2303 TTL-USB板一块、杜邦线三条、4GB优盘一个、拆机工具若干;
软件有SecureCRT、PL2303驱动。

一、前期准备:
主角,DM1004一台,拆机只有三个螺丝,左下角脚垫不用拆;

拆开时注意wifi天线粘在上壳一面,别扯断了;


已自动联网升级到了 PB.30.31.20,理论上 PB.30.31.51 都可如此操作;


一个fat32格式U盘(4GB容量最好)、杜邦线三条

、一台winxp系统电脑

、USB-TTL模块(PL2303,因其winxp驱动较稳定,所以用的是winxp系统电脑);



TTL接线:
DM1004主板上的J9插座,贴心的印刷了针脚定义,从靠电源口开始依次为 GND、TX、RX、5V ,仅需使用GND、TX、RX三根针,对应连接PL2303模块上的GND、RX、TX;


插线有技巧,因2.54mm的杜邦线头间距太宽,所以可以把三根线中间的那根去掉插头塑料壳,这样三根可以方便的并排插入主板J9插;

U盘上的几个文件,bootimg、recoveryimg、bootloader三个镜像文件都来自于PB300114 升级包,shitouupdate来自于石头rom包,
注意!!!:不要放入自动刷机配置文件 factory_update_param.aml



二、uboot操作:
1.在电脑上安装好PL2303驱动后插入模块会出现新的com端口,例如COM3;

2.运行SecureCRT,新建连接打开COM3,115200 8 1 ,


接好TTL线,大麦盒子通电,SecureCRT中会有类似如下的输出,表示bootloader启动成功,按回车键打断启动进入uboot环境,以下是部分输出信息:EEEE I400000004294_M6_BL1_3431
TE : 174280
BT : 19:35:44 Aug 27 2016J
CPU clock is 1200MHz

wait pll-0x03 target is 0204 now it is 0x00000203

DDR clock is 516MHz with 2T mode

DDR training :
HHH
BootFrom SPI
0x12345678
Boot from int dev 1stSPI

TE : 708066

System Started


U-boot-00000-gae7538e(m6_mbx_th8_secure@ae7538ea) (Aug 27 2016 - 19:35:40)

nand 2 ret:1

Hit Enter key to stop autoboot -- :1

 0

exit abortboot: 1

m6_mbx_th8_secure#


进入uboot环境后会出现这样的提示符m6_mbx_th8_secure# ,
注意这一行 U-boot-00000-gae7538e(m6_mbx_th8_secure@ae7538ea)(Aug 27 2016 - 19:35:40) ,说明bootloader已经被更新到2016年的版本;

跟帖再续

人见百态 发表于 2016-12-9 16:07

{znds6}{znds6}{znds6}这个厉害   正需要这个呢! 感谢楼主的分享!

webpad 发表于 2016-12-9 16:29

手机uc上图,流量跑了不少,一张图都没上去,都是几兆大小的照片啊~~~55555

fahu 发表于 2016-12-9 17:23

请楼主用电脑上图吧,快呀,在线等,多谢多谢........{znds8}{znds8}{znds8}

webpad 发表于 2016-12-11 23:53

本帖最后由 webpad 于 2016-12-12 09:05 编辑

3. 接下来就可以输入指令help ,查询有哪些可用命令:
m6_mbx_th8_secure#help

?       - alias for 'help'
autoping- do auto ping test
autoscr - run script from memory
base    - print or set address offset
bdinfo- print Board Info structure
boardid_prefetch- boardid sub-system
boot    - SPI-NAND-COMPATIBLE
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
calc    - command for calculate
cbusreg - cbus register read/write
chpart- change active partition
clear_rebootmode- clear rebootmode
clkmsr- measure PLL clock
cmp   - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
data    - SPI-NAND-COMPATIBLE || SPI-NAND-EMMC-COMPATIBLE
dcache- enable or disable data cache
defenv- default environment
defenv_without- defenv without environment variables
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
editenv - edit environment variable
efuse   - efuse version/licence/mac/hdcp/usid read/write or dump raw efuse data commands or info(display chip efuse info)
env   - environment handling commands
ethchk- check ethernet status
ethdbg- set ethernet debug level
ethmode - set ethernet mac mode
ethrst- reset ethernet phy
exit    - exit script
false   - do nothing, unsuccessfully
fatexist- find the file from a dos filesystem
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fdt   - flattened device tree utility commands
get_img_size- get img size and save the result as a environment variable
get_rebootmode- get reboot mode
go      - start application at address 'addr'
gset    - gpio commands
hdcp    - HDCP sub-system
help    - print command description/usage
icache- enable or disable instruction cache
imxtract- extract a part of a multi-image
irkey   - irkey key_value1 key_value2 time_value
itest   - return true/false on integer compare
kgdb    - enter gdb remote debug mode
loadenv - load environment at address 'addr'
logo    - logo sub-system
loop    - infinite loop on address range
macreg- ethernet mac register read/write/dump
md      - memory display
mdc_clk - do mdc clock
mm      - memory modify (auto-incrementing address)
mmc   - MMC sub system
mmcdump - mmc data load
mmcinfo - display MMC info
msleep- delay execution for some time
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
netspd_f- enforce eth speed
nm      - memory modify (constant address)
phyreg- ethernet phy register read/write/dump
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
read_mac_sn- read_mac_sn
reset   - Perform RESET of the CPU
run   - run commands in an environment variable
saradc- saradc sub-system
saveenv - save environment variables to persistent storage
secukey - security KEY sub-system
setenv- set environment variables
sf      - SPI flash sub-system
showvar - print local hushshell variables
sleep   - delay execution for some time
source- run script from memory
ssecukey- NAND KEY sub-system
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
tiny_usbtool- start tiny USB tool for PC burner
true    - do nothing, successfully
tvdsp   - dspv sub-system
unpackimg- unpack imgpack to single
usb   - USB sub-system
usbbc   - test usb bc
usbboot - boot from USB device
usid_prefetch- usid sub-system
uuid_prefetch- uuid sub-system
version - print monitor, compiler and linker version
video   - video sub-system
printenv -----显示存储在spi flash中的env参数;

bdinfo-----显示一些硬件信息,比如网卡MAC地址,是否和外壳标签上的一致;

nand -------对NAND闪存进行读写操作,可用来查询坏块、重新检测坏块、写入recovery等分区;

sf   -------- 对spi flash闪存进行操作,刷写bootloader要用到;

version-----------   查询bootloader(uboot)版本:
m6_mbx_th8_secure#version

U-boot-00000-gae7538e(m6_mbx_th8_secure@ae7538ea) (Aug 27 2016 - 19:35:40)
arm-none-eabi-gcc (Sourcery G++ Lite 2010q1-188) 4.4.1
GNU ld (Sourcery G++ Lite 2010q1-188) 2.19.51.20090709

webpad 发表于 2016-12-12 00:26

本帖最后由 webpad 于 2016-12-12 09:07 编辑

4. 刷写bootloader:
因本机bootloader已经在升级到PB303120的过程中被改写更新,需要降级到PB300114版本的bootloader;
按顺序输入命令:
①、
sf probe 2   -----------选定spi flash,本机芯片型号为GD25Q32 4MB容量m6_mbx_th8_secure#sf probe 2


SPI NOR Flash have write protect!!!
4096 KiB GD25Q32 at 0:2 is now current device②、
usb start----------- 启动usb模块,先插上U盘再输入这个命令m6_mbx_th8_secure#usb start

(Re)start USB...
USB:   dwc_usb driver version: 2.94 6-June-2012
USB (0) peri reg base: c1108400
USB (0) use clock source: XTAL input
USB (0) PHY Clock not detected!
USB (0) base addr: 0xc9040000
Force id mode: Host
dwc_otg: Highspeed device found !

scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found③、
fatload usb 0 82000000 bootloader.img   -----加载U盘上的镜像文件到内存m6_mbx_th8_secure#fatload usb 0 82000000 bootloader.img

reading bootloader.img
....................................

377072 bytes read
④、
sf erase 0 60000--------------------- 擦除spi flash

⑤、
sf write 82000000 0 60000--------- 写入镜像文件m6_mbx_th8_secure#sf erase 0 60000

m6_mbx_th8_secure#sf write 82000000 0 60000

Amlogic log : SPI write 393216 bytes data used about 845285 us

webpad 发表于 2016-12-12 00:31

本帖最后由 webpad 于 2016-12-12 10:20 编辑

5. 加载并运行14版recovery,手工刷入PB300114固件:

fatload usb 0 82000000 recovery.img-------------------- 加载U盘上的镜像到内存;m6_mbx_th8_secure#fatload usb 0 82000000 recovery.img

reading recovery.img
..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

5226720 bytes readbootm 82000000   ------------- 启动内存中的recovery;m6_mbx_th8_secure#bootm 82000000

## ANDROID Format IMAGE
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.0.50+
   Image Type:   ARM Linux Kernel Image (lzma compressed)
   Data Size:    3382752 Bytes = 3.2 MiB
   Load Address: 80008000
   Entry Point:80008000
   Verifying Checksum ... OK
    Ramdisk start addr = 0x8233a800, len = 0x1c10b8
board_usb_stop cfg: 0
   Uncompressing Kernel Image ... OK
uboot time: 1604722975 us.
machid from environment: 0x4e27
EFUSE machid is not set.
Using machid 0x4e27 from environment

Starting kernel ...
运行recovery后,切换到盒子连接的电视画面,在recovery界面用遥控器操作:

recovery菜单有6项:Android system recovery <3e>

reboot system now   ------------重启
apply update from ADB   -------从ADB实施刷机
apply update from EXT   -------从外置存储选择刷机包
apply uodate from cache-----从cache分区选择刷机包
wipe data/factory reset-------双清
wipe cache partition----------清除cache分区
运行第三项, apply update from EXT ---> from Udisk    -----------------选择U盘上的 PB300114 版固件包刷机

切记U盘根目录中不要有factory_update_param.aml 文件,避免自动刷机;
刷机文件最好重命名,不要用默认的 update.zip 文件名。


webpad 发表于 2016-12-12 00:39

本帖最后由 webpad 于 2017-3-13 02:40 编辑

6. 刷入PB300111固件:
降级到 PB300114 后,不要插网线,保持U盘插入,重启盒子的同时不停按遥控器菜单键(四横杠键),直至再次进入recovery:

运行第五项, wipe data/factory reset----------------------恢复出厂设置,抹除data和cache(双清);
运行第三项,apply update from EXT-> from Udisk      ----------------手工从U盘选择 PB300111固件刷机;

降级到PB300111后:第三方桌面刷机---->https://www.znds.com/tv-599758-1-1.html ;
石头rom刷机,参考 https://www.znds.com/tv-560200-1-1.html 帖子中的步骤。



相关资源下载:
链接:
http://pan.baidu.com/s/1nvPldlZ
密码:
**** Hidden Message *****





voody 发表于 2016-12-12 07:58

感谢分享,ZNDS有你更精彩:)

webpad 发表于 2016-12-12 10:11

终于完成,经历各种发帖上图失败....
继续填另外一个坑
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: DM1001系列 PB.30.31.20~ 30.31.51 TTL降级方法 ,无需编程器