Chinaunix首页 | 论坛 | 博客
  • 博客访问: 713756
  • 博文数量: 104
  • 博客积分: 4320
  • 博客等级: 上校
  • 技术积分: 1948
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-30 14:42
文章分类

全部博文(104)

文章存档

2012年(4)

2011年(65)

2010年(35)

分类: LINUX

2011-03-10 18:09:48

RealTek1073方案采用集成了MIPS处理单元和多媒体解码单元的1073DD处理器,使用linux作为其OS,构成了一个完整的嵌入式应用系统。


本人购入MP800H已有数月,从工艺水平来看,MP800H还是不错的,打开机盖(小心你的保修标贴*_*)可以看到PCB布局合理,印刷质量好,主芯片1073DD处理器覆有铝片散热,整个内部空间气流通畅。

在主板上可以看到一个6针接口,接口旁标有“GND RX0 TX0 RX1 TX1 3V3”字样。其中:
“GND”是接地
“RX0”是接收端0
“TX0”是发送端0
“RX1”是接收端1
“TX1”是发送端1
“3V3”是3.3V电源供电接口
鉴于一般的嵌入式系统只有“GND TX RX VCC”四个接口,所以MP800H的第二组数据接口“TX1 RX1”应当是空置的(后文已证实)。

先普及一下串口通讯的基本知识:

通常情况下,嵌入式系统采用TTL接口和计算机的串口进行通讯。计算机的串口信号电平取决于电源电平,一般是+12V和-12V,分别表示“1”和“0”;而嵌入式系统的TTL接口一般是±5V或±3.3V,为了能使计算机和嵌入式系统进行通讯,必须将计算机串口输出的 高电平信号拉低为TTL接口可以接收的低电平信号。为此,可以使用MAX232系列转换芯片来完成电压的匹配工作,232系列芯片常用的有232、 3232和3243。MP800H的TTL电平是3.3V,也就是说,“3V3”接口将提供3.3V电源供电(即给你的转换电路供电),“RX0”和 “TX0”也将使用3.3V电平信号进行数据通讯。

本文面向的是一般高清用户,所以我不会教你如何制作串口转TTL电路。为了实现计算机和MP800H高清播放器的通讯,你需要从网上购买一根串口转TTL线(或者USB转TTL线,本文以串口转TTL线为例重点讲解。USB转TTL线的注意事项在本文末尾)。具体的网店链接我就不发了,以免有广告嫌疑,呵呵。


购买串口转TTL线的时候请注意:
1TTL电平必须是3.3V,否则可能会烧毁你的播放器的1073DD芯片。 MAX3232和MAX3243芯片的特点就是驱动输入电压是多少,信号输出电压就是多少,因此,使用MAX3232或MAX3243芯片的串口转TTL 线是可以放心购买的。使用其他芯片的串口转TTL线在购买的时候一定要问明TTL端的电平是多少,是否兼容3.3V电平信号,切不可使用TTL端是5V电 平的串口转TTL线。

2串口转TTL线的TTL端一定不要买组合插针的,要买独立插针的,也就是1P的,因为你买到的串口转TTL线的接头线序和MP800H的TTL接头线序肯定不一样。
3、MP800H的6针TTL插槽的间距是小间距,可不是2.54MM的间距!如果你不幸买到了拥有2.54MM间距的杜邦插头的串口转TTL线,那你可有的忙了,你得把杜邦头一个个拆下来,然后用胶带或者热缩管对母型插针进行绝缘处理!

典型的串口转TTL线的外观如下(图片来源于淘宝):

这是一根使用MAX3232芯片的RS232电平转换连接线,一端为DB-9的插头,可直接与PC机的串口相连接;另一端为TTL电平(±5V 或±3.3V)的杜邦插头,四根线分别是:VCC、TXD、RXD、GND,对应接入MP800H的“3V3 RX0 TX0 GND”。


请注意:一定要在播放器断电关机的情况下接线!VCC接3V3、GND接GND、TXD接RX0、RXD接TX0,插头接错有烧机的风险!

串口转TTL线接好播放器后,将DB-9的插头与PC机的串口相连接(如果你要接笔记本,那得看你的笔记本有没有串口,现在的笔记本都没有串口)。接下来的操作在PC机上进行:

执行“开始-->所有程序-->附件-->通讯-->超级终端”,你会看到如下窗口:



输入你的区号,点击“确定”,然后会出现如下窗口:



为你的连接起个名字,例如“MP800H”,之后点击“确定”,会出现下面的窗口,选择你的COM口:



选择好COM口之后点击“确定”,接下来是设置串口属性,请按下图所示进行设置:



点击“确定”之后,将显示超级终端的主窗口界面,此时连接已建立,如下图所示:



现在请将MP800H播放器加电,你将在超级终端窗口中看到ROM Monitor的启动信息(请注意,2秒内按下“ESC”将进入ROM Monitor模式):

  1. ?hello world!
  2. 5280 wai5t280 waiA
  3. REALTEK ROM Monitor, Revision 0000.0202.0012.
  4. Copyright (c) Realtek Semiconductor Corp. - All Rights Reserved.

  5. For a list of available commands, type 'help'.

  6. Compilation time /version= May 22 2009 13:44:54 /0000.0202.0012

  7. MAC address = 00.1a.95.c7.b8.f0

  8. Processor Company ID/options = 0x01 (MIPS Technologies, Inc.) / 0x00

  9. Processor ID/revision = 0x93 / 0x78

  10. Endianness = Little
  11. Flash memory size = 16 MByte

  12. SDRAM size = 128 MByte

  13. First free SDRAM address = 0x800fc000


  14. Press 'ESC' to Monitor mode

  15. OS kernel in FLASH 0xbed00120 , to 0xa1000000, size=0xf13df

  16. PAL logo

  17. OS kernel in memory 0xa1000000, to 0xa0100000, size=0xf13df

  18. lzma finished

  19. OS kernel in FLASH 0xbedf14ff, to 0x81b00000, size=0xc29b0

  20. lzma finished

  21. OS kernel in FLASH 0xbeeb3eaf, to 0x81d80000, size=0x9a84f

  22. lzma finished

  23. 5280Go 5280Go linux param = go 803bc000 rootfstype=squashfs root=31:01 mtdparts=

  24. go 80100000 rootfstype=squashfs root=31:01 mtdparts=VenusSFC:4696k,10024k,384k,1280k

  25. Reset Ethernet Mac.




  26. Address = 0x80100000


  27. Realtek LINUX (DC ALIAS) started...
  28. Venus setting:
  29. ROSs have 2621440 bytes RAM.
  30. System CPU has 2 UARTs.
  31. System CPU uses external timer interrupt.
  32. Bootloader version: 0000.0202.0012. This version string is of new format.
  33. The information of this board: Company ID:0x0 CPU ID: 0x12 Board ID: 0x202
  34. Ethernet Mac address: 00.1A.95.C7.B8.F0
  35. Model Config length=0
  36. Config serial console: console=ttyS0,115200n8r
  37. prom_flashsize = 0x01000000
  38. Linux version 2.6.12.6-VENUS (root@138_korsen) (gcc version 3.4.4 mipssde-6.03.01-20051114) #4 Mon Sep 21 15:11:30 CST 2009

  39. audio addr: 1b00000

  40. CPU revision is: 00019378

  41. Determined physical RAM map:

  42. memory: 00100000 @ 00000000 (usable)

  43. memory: 0047a000 @ 00100000 (reserved)

  44. memory: 01586000 @ 0057a000 (usable)

  45. memory: 00500000 @ 01b00000 (reserved)

  46. memory: 06000000 @ 02000000 (usable)

  47. show info: max_low_pfn:32768

  48. show info: min_low_pfn:1402

  49. Built 1 zonelists

  50. Kernel command line: rootfstype=squashfs root=31:01 mtdparts=VenusSFC:4696k,10024k,384k,1280k console=ttyS0,115200n8r ip=192.168.0.9::192.168.0.254:255.0.0.0:::

  51. Primary instruction cache 32kB, physically tagged, 4-way, linesize 32 bytes.

  52. Primary data cache 32kB, 4-way, linesize 32 bytes.

  53. Synthesized TLB refill handler (20 instructions).

  54. Synthesized TLB load handler fastpath (32 instructions).

  55. Synthesized TLB store handler fastpath (32 instructions).

  56. Synthesized TLB modify handler fastpath (31 instructions).

  57. Cache parity protection disabled

  58. PID hash table entries: 256 (order: 8, 4096 bytes)

  59. Estimate value: CPU frequency 405.02 MHz

  60. Using 27.000 MHz high precision timer.

  61. Console: colour dummy device 80x25

  62. Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

  63. Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

  64. Memory: 119192k/121368k available (3257k kernel code, 2112k reserved, 554k data, 144k init, 0k highmem)

  65. Warning! Unknown board id.

  66. ==================== Warning! The calculated loops_per_jiffy is not similar to the default one. ====================

  67. Mount-cache hash table entries: 512

  68. Checking for 'wait' instruction... available.

  69. ========== board id: 202 ==========

  70. [INFO] neptune mode...

  71. boot_param value: bfcff800

  72. mode: 1

  73. size: 1809

  74. color1: 0x808010

  75. color2: 0x8080eb

  76. color3: 0xb34a9c

  77. color4: 0x3f8e6a

  78. NET: Registered protocol family 16

  79. SCSI subsystem initialized

  80. usbcore: registered new driver usbfs

  81. usbcore: registered new driver hub

  82. se init module major number = 254

  83. size of RPC_POLL_Dev 52 and RPC_INTR_Dev 52...

  84. Hello, Realtek TLB Mapper

  85. squashfs: version 3.1 (2006/08/19) Phillip Lougher

  86. devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)

  87. devfs: boot_options: 0x1

  88. JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.

  89. YAFFS Driver Rev:168240 (2009-03-05)

  90. YAFFS Driver is successfully installing.

  91. Initializing Cryptographic API

  92. Generic RTC Driver v1.07

  93. Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled

  94. ttyS0 at MMIO 0x0 (irq = 3) is a 16550A

  95. ttyS1 at MMIO 0x0 (irq = 3) is a 16550A

  96. io scheduler noop registered

  97. RAMDISK driver initialized: 1 RAM disks of 128K size 1024 blocksize

  98. loop: loaded (max 8 devices)

  99. this MARS eth RX_OFFSET = 0x0

  100. 8139cplus: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)

  101. MAC address = 0x00.1A.95.C7.B8.F0

  102. eth0: RTL-8139C+ at 0xb8016000, 00:1a:95:c7:b8:f0, IRQ 2

  103. VenusSFC MTD init

  104. VenusSFC MTD: MXIC MX25L12805 detected.

  105. VenusSFC MTD: Enable VenusSFC MD PP callback function.

  106. cp_hotplug

  107. 4 cmdlinepart partitions found on MTD device VenusSFC

  108. Venus SFC: using dynamic partition <5>Creating 4 MTD partitions on "VenusSFC":

  109. 0x00000000-0x00496000 : "Partition_000"

  110. mtd: partition "Partition_000" doesn't end on an erase block -- force read-only

  111. 0x00496000-0x00e60000 : "Partition_001"

  112. mtd: partition "Partition_001" doesn't start on an erase block boundary -- force read-only

  113. 0x00e60000-0x00ec0000 : "Partition_002"

  114. 0x00ec0000-0x01000000 : "Partition_003"

  115. 0x00000000-0x01000000 : "disc"

  116. Venus SFC: (for SST/SPANSION/MXIC SPI Flash)

  117. physmap flash device: 1000000 at 1ed00000

  118. Realtek NAND Flash Driver Rev:257157 (2009-07-30)

  119. NAND Flash Controller detects 4 dies

  120. Warning: Lookup Table do not have this nand flash !!

  121. rtk_nand_profile: Error, cannot do nand_scan(on-board)

  122. Initializing USB Mass Storage driver...

  123. usbcore: registered new driver usb-storage

  124. USB Mass Storage support registered.

  125. i2c /dev entries driver

  126. =========================

  127. = VER : 1.8

  128. =========================

  129. = PHY : 0

  130. = MODE: MARS

  131. = SPD : 1

  132. = SAR : 0x024 (7 bits)

  133. = TX FIFO DEPTH : 8

  134. = RX FIFO DEPTH : 8

  135. = FIFO THRESHOLD: 4

  136. = BUS JAM RECORVER : ON

  137. = NON STOP WRITE : ON

  138. = SP PROTECT : ON

  139. =========================

  140. FATAL : I2C 1 pins have been occupied by PCI

  141. Trying to free free IRQ3

  142. NET: Registered protocol family 2

  143. IP: routing cache hash table of 1024 buckets, 8Kbytes

  144. TCP established hash table entries: 8192 (order: 4, 65536 bytes)

  145. TCP bind hash table entries: 8192 (order: 3, 32768 bytes)

  146. TCP: Hash tables configured (established 8192 bind 8192)

  147. NET: Registered protocol family 1

  148. NET: Registered protocol family 17

  149. Realtek Venus Power Management, (c) 2006 Realtek Semiconductor Corp.

  150. cp_open

  151. alloc rings cp->rxdesc_buf =0xa07c9000 , cp->ring_dma=0x7c9000

  152. init_hw

  153. init_hw finished

  154. IP-Config: Complete:

  155. device=eth0, addr=192.168.0.9, mask=255.0.0.0, gw=192.168.0.254,

  156. host=192.168.0.9, domain=, nis-domain=(none),

  157. bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=

  158. VFS: Mounted root (squashfs filesystem) readonly.

  159. Mounted devfs on /dev

  160. Freeing prom memory: 0kb freed

  161. Reclaim bootloader memory from 80020000 to 80100000

  162. Freeing unused kernel memory: 144k freed

  163. RTK rtc cannot work.

  164. Welcome to Realtek Linux

  165. Please press Enter to activate this console. ------flush priority: 10

  166. flush_page_cache: do flush...

  167. ------flush priority: 10

  168. flush_page_cache: do flush...

  169. ------flush priority: 10

  170. flush_page_cache: do flush...

  171. ------flush priority: 10

  172. flush_page_cache: do flush...

  173. Starting INET services....
  174. ------flush priority: 10

  175. flush_page_cache: do flush...

  176. libata version 1.12 loaded.

  177. sata driver initial...2009/09/03

  178. sata dma reset

  179. Running dvdplayer with RootApp
  180. RootApp AVHDD version...
  181. enter 2nd case...
  182. ================================================
  183. ================================================
  184. root execute DvdPlayer...
  185. ================================================
  186. ================================================

  187. ............
复制代码
危险:在ROM Monitor模式下的操作失误,往往会对播放器造成致命的伤害,此方面的更多尝试尚未进行,请谨慎操作!

默认情况下,ROM Monitor会对LINUX进行引导。以上是启动信息的前353行,事实上,完整的启动信息有将近1900行,启动完成后,串口终端将持续提示如下信息:
  1. watchdog test pid 152, threshold: 50
  2. watchdog test pid 152, threshold: 50
  3. watchdog test pid 152, threshold: 50
  4. watchdog test pid 152, threshold: 50
  5. watchdog test pid 152, threshold: 50
  6. watchdog test pid 152, threshold: 50
  7. watchdog test pid 152, threshold: 50
  8. watchdog test pid 152, threshold: 50
  9. watchdog test pid 152, threshold: 50
  10. watchdog test pid 152, threshold: 50
  11. watchdog test pid 152, threshold: 50
  12. watchdog test pid 152, threshold: 50
  13. watchdog test pid 152, threshold: 50
  14. watchdog test pid 152, threshold: 50
  15. watchdog test pid 152, threshold: 50
复制代码
至此,系统进入待机状态,等候遥控器的输入信号。

有了串口终端,就可以进行正常更新失败后的“刷砖机”(即文中所说的强制刷机)工作了。强制刷机需要BootLoader的参与,1073方案是有公开的源代码可以参考的。本文参考的是“CM3PVRxx_2.00.004_Bootcode.tar.gz”源代码,找到其中涉及到“Rescue Linux”的配置部分,如下:

  1. # ********************************************************************
  2. # Rescue Linux attribute
  3. # ********************************************************************
  4. # flag value
  5. # ********************************************************************

  6. ##Rescue Linux included modules will be configured by Linux Makeconfig,
  7. ##not by boot config. If rescue is included into flash image,
  8. ##user must specify Rescue_Flash_File_Name to identify which
  9. ##rescue should be merged into flash image

  10. ##Rescue_Source = [FLASH | NULL]
  11. Rescue_Source = FLASH
  12. ##Rescue_Install_Key = [0x09(TAB) | 0x20(SPACE) | GPIO]
  13. ## if GPIO is set, please also set below 'Rescue_Install_GPIO value
  14. Rescue_Install_Key = 0x09
  15. ##Rescue_Install_With_GPIO_Address = [value]
  16. ##Rescue_Install_With_GPIO_Mask = [value]
  17. ##Rescue_Install_With_GPIO = 0x00000100
  18. ##Rescue_Install_With_GPIO_Value = [value]
  19. ##Rescue_Loader_Param = [rescue loading parameters]
  20. Rescue_Loader_Param = ""
  21. ##Rescue_File_Name = [rescue loading parameters]
  22. Rescue_File_Name = vmlinux.rescue.bin.lzma.1261_avhdd
复制代码

可以看到,“##Rescue_Install_Key = [0x09(TAB) | 0x20(SPACE) | GPIO]”即是可选的刷机键,在此源代码中定义的是“Rescue_Install_Key = 0x09”,即“TAB”键。好了,到此为止,强制刷机所需要明确的信息都已经完备了。


下面开始讲解正常更新失败后的强制刷机方法:

1、播放器断电
2、将install.img文件复制到U盘根目录,并将U盘连接至播放器。
3、将串口转TTL线连接至计算机和播放器
4、打开超级终端,配置并进入连接状态
5、按住键盘的“TAB”键,将播放器加电
6、当看到超级终端出现“Rescue kernel in FLASH,...”信息后,松开“TAB”键
(如果你的眼睛跟不上超级终端的信息显示速度,播放器加电2秒后松开“TAB”键即可)

至此,系统进入强制升级过程,整个过程不需要人工干预。




以下是串口终端输出的前67行:

  1. ?hello world!
  2. 5280 w5ai28t0 waiA
  3. REALTEK ROM Monitor, Revision 0000.0202.0012.
  4. Copyright (c) Realtek Semiconductor Corp. - All Rights Reserved.

  5. For a list of available commands, type 'help'.

  6. Compilation time /version= May 22 2009 13:44:54 /0000.0202.0012

  7. MAC address = 00.1a.95.c7.b8.f0

  8. Processor Company ID/options = 0x01 (MIPS Technologies, Inc.) / 0x00

  9. Processor ID/revision = 0x93 / 0x78

  10. Endianness = Little
  11. Flash memory size = 16 MByte

  12. SDRAM size = 128 MByte

  13. First free SDRAM address = 0x800fc000


  14. Press 'ESC' to Monitor mode

  15. Rescue kernel in FLASH, total size = 0xea2f4



  16. seg.1 addr 0xbfc3a000, size = 0xc5000



  17. seg.2 addr 0xbfbca000, size = 0x252f4

  18. copy rescue0: from bfc3a000 to a1000000, len = c5000

  19. copy rescue1: from bfbca000 to a10c5000, len = 252f4

  20. decompressing rescue: from a1000000 to a0100000: size = ea2f4

  21. lzma finished

  22. decompressing rescue done

  23. PAL logo

  24. Reset Ethernet Mac.




  25. Address = 0x80100000


  26. Realtek LINUX (DC ALIAS) started...
  27. Venus setting:
  28. ROSs have 2621440 bytes RAM.
  29. System CPU has 1 UART.
  30. System CPU uses external timer interrupt.
  31. Bootloader version: 0000.0202.0012. This version string is of new format.
  32. The information of this board: Company ID:0x0 CPU ID: 0x12 Board ID: 0x202
  33. Ethernet Mac address: 00.1A.95.C7.B8.F0
  34. Model Config length=0
  35. Config serial console: console=ttyS0,115200n8r
  36. prom_flashsize = 0x01000000
  37. Linux version 2.6.12.6-VENUS (alan@localhost.localdomain) (gcc version 3.4.4 mipssde-6.03.01-20051114) #159 Mon Apr 20 15:26:28 CST 2009
复制代码
升级完毕后,系统将自行重启,以下是重启前的最后36行终端输出(重启后串口终端将重新输出启动过程):
  1. .Install completed
  2. release address: 8053a460

  3. release address: 807ee9c0

  4. release address: 87000000

  5. release address: 87400000

  6. clear pli setting....

  7. [total time] t=186.440
  8. In my system...

  9. Starting pid 430, console /dev/console: '/bin/umount'
  10. BusyBox v1.1.3 (2009.04.20-07:25+0000) multi-call binary

  11. Usage: umount [flags] FILESYSTEM|DIRECTORY


  12. The system is going down NOW !!

  13. The system is going down NOW !!

  14. Sending SIGTERM to all processes.

  15. Sending SIGTERM to all processes.

  16. Sending SIGKILL to all processes.

  17. Sending SIGKILL to all processes.

  18. Please stand by while rebooting the system.

  19. Please stand by while rebooting the system.
  20. Restarting system.
复制代码
整个过程根据你的U盘速度可持续3-5分钟,在这里,我升级用了“[total time] t=186.440”三分钟。

至此,串口刷机结束。



下面是USB转TTL线的使用方法:


现在的笔记本是没有串口的,若想用笔记本进行刷机,一个可行的方法是采用USB转TTL线。


请注意采用USB转TTL线的时候,有几个非常重要的注意事项:

1、USB转TTL线(内含USB转TTL电路)使用电脑USB接口的+5V供电,不需要从播放器的VCC端口取电!所以切勿连接播放器的VCC端口!否则会烧毁USB转TTL线。

2、需要设置信号输出电平为3.3V!因为播放器的TTL电平是3.3V的。这需要你的USB转TTL线本身支持3.3V和5V电平信号的切换!典型情况下是通过跳线设置。

总之,USB转TTL线的VCC端不要接播放器的VCC端;USB转TTL线必须跳线至3.3V电平信号。切记!


关于驱动程序和COM口号:USB转TTL线是需要驱动的,你的卖家会给你提供驱动。驱动的安装非常简单,安装完毕建议重启计算机。USB转TTL线有一个特点,根据你插入的USB口不同,它映射成的串口号也不同,可能是COM1/COM2/COM3/COM4/COM5等等,可以在设备管理器中看到。在超级终端中选择相应串口即可。


根据目前的实验结果,USB转TTL线在兼容性上存在一定问题,这是由其驱动引起的,主要表现在:
1、对接线顺序敏感。有的USB转TTL线必须先连接USB端,再连接TTL端,才可正常通讯;有的则不必。
2、不同驱动版本表现不同。有些驱动版本无法建立通讯连接;有些驱动版本虽可建立通讯连接,但是超级终端无任何回显。


正是因为USB转TTL线的方式注意事项多、风险稍大、兼容性不完美,所以目前不推荐使用USB转TTL线的方式进行刷机。

阅读(3961) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~