Flashing the Neo FreeRunner/zh cn

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(从NOR Flash启动FreeRunner)
(#1 烧写工具: DFU-util 或 NeoTool)
 
(2 intermediate revisions by one user not shown)
Line 33: Line 33:
 
DFU-util的不同版本如下:
 
DFU-util的不同版本如下:
  
'''Linux:''' http://downloads.openmoko.org/releases/Om2008.9/dfu-util
+
'''Linux:''' http://downloads.openmoko.org/distro/releases/Om2008.9/dfu-util
  
 
请执行命令 chmod a+x dfu-util 以保证下载文件的可执行性(Executable)。
 
请执行命令 chmod a+x dfu-util 以保证下载文件的可执行性(Executable)。
Line 94: Line 94:
 
如果你很喜欢当前已有的系统,又想试试一些新的东东,你最好先做一个备份[[Backup]].
 
如果你很喜欢当前已有的系统,又想试试一些新的东东,你最好先做一个备份[[Backup]].
  
== Using dfu-util ==
+
== 使用dfu-util ==
  
dfu-util can be used to read flash memory, write memory, and get information from the device.
+
dfu-util可以用来读写flash存储器,以及获取设备信息。
  
 +
下面是向flash存储器的一个(预定义的)分区中中写入一个image文件的通用命令格式:
 
This is the general command format to write an image file to a (predefined) "partition name" (referred to as ''altsetting'' in dfu-util help/manual) :
 
This is the general command format to write an image file to a (predefined) "partition name" (referred to as ''altsetting'' in dfu-util help/manual) :
  
Line 103: Line 104:
  
 
where:<br>
 
where:<br>
-a ''altsetting'' : Specify the altsetting of the DFU interface by name or by number<br>
+
-a ''altsetting'' : 使用名字或者数字指定DFU接口的altsetting<br>
-R  : Issue USB Reset signalling once we're finished<br>
+
-R  : 操作完成后发送重置USB信号。<br>
-D  ''file_name'' : Write firmware from ''file_name'' into device
+
-D  ''file_name'' : 向设备的flash存储器写入文件名为''file_name'' 的文件。
  
On Linux, you run dfu-util from a command shell prompt. If you have not put it somewhere on your command path you probably need to prefix it with a "./" like this '''./dfu-util'''.
+
在Linux平台上,你可以在shell中运行dfu-util,在有些系统中你可能需要root用户权限,如在ubuntu中你可能需要使用sudo。
On some systems you need to be root before this will work and on Ubuntu you must preface the command with "sudo" or you will get the following error: "Cannot claim interface: could not claim interface 2: Operation not permitted"
+
  
On Windows, you need to open a command window and run from a command line. Use Start-Run Program and type "cmd" to open a Window.
+
在Windows系统中,你可以打开一个命令行窗口来执行。
  
More detailed manual for dfu-util is available here : [[Dfu-util]]
+
关于dfu-util的更详细的信息请参考: [[Dfu-util]]
  
GUI frontend for dfu-util (and more): [[NeoTool]]
+
dfu-util的GUI 前端 (更多): [[NeoTool]]
  
 
== 烧写更新 Kernel ==
 
== 烧写更新 Kernel ==

Latest revision as of 09:08, 12 February 2009


OpenMoko会不断发布最新的根文件系统(root file system)、内核(kernel)和[[Bootloader(called U-Boot) 的二进制映像(binary image)文件。这些文件可以被烧写到Neo FreeRunner的Flash memory (NAND) 中,从而达到更新系统套件的目的。你可以通过一根USB线,连接FreeRunner到电脑上,通过OpenMoko提供的烧写工具来更新系统。

Contents

[edit] 3类软件组件and 2种存储器

FreeRunner的软件系统由3部分组成:

  • bootloader: 这是FreeRunner启动或者重启时执行的第一段小程序,它再启动其他软件系统。
  • kernel: FreeRunner采用的Linux内核。
  • root filesystem: 包括所有的应用程序和命令文件。

FreeRunner的这三类软件组件都打包成二进制映像文件进行发布。

FreeRunner有两种程序存储器:NOR flash与NAND flash。在PC机上,如果你想重装操作系统,你一般会使用一个光盘来启动系统,然后将操作系统从光盘拷贝安装到硬盘上。FreeRunner并没有光驱,但系统文件必须安装进内部的存储器(NAND flash)当中去。当然,一种可能的方式是从microSD卡来启动。

NOR flash是一个很小的程序存储器,里面存放着一段启动代码。当你需要重新安装系统,也就是需要重写NAND flash的时候,你可以从NOR flash启动来进行操作。一般来说,NOR flash是很少需要更新;如果需要,你可以从这里找到更新方法:Flashing NOR.。

NAND flash 就像PC机中的硬盘,它被分为三个分区,分别存放bootloader, kernel, 和rootfs。这三个分区分别可以独立的进行擦写更新。譬如,如果你想更新一个修改过的kernel,你只需要按照更新kernel的步骤进行操作就可以了。

注意:一般很少更新根文件系统rootfs及bootloader,因为有时只需要更新内核(kernel)文件就可以解决一些存在的问题,所以在更新之前请慎重考虑更新的必要性。

[edit] 另一种方式: 将系统安装运行在 microSD 卡上

你可以将软件系统安装在microSD卡上,这样你可以从microSD卡启动并运行系统 boot from microSD card。这样可以同时保留在NAND flash上的系统,从而达到在FreeRunner上安装双系统的目的。(譬如,假如你的FreeRunner当前已经安装了2007.2的OM系统,你想在不擦除当前系统的前提下测试2008.08的OM系统,这种在microSD卡上的方式就是一个很好的选择了)

[edit] 更新系统所需要的软件

[edit] #1 烧写工具: DFU-util 或 NeoTool

命令行工具: DFU-util, 需要安装在你的PC机上,当前有Linux, MacOS X, and Windows (参见下面的链接)多个版本. DFU-util可以帮助你通过USB连接到FreeRunner并控制bootloader。这种连接方式使用了一种特殊的bootloader接口协议,不同于USB网络,详细信息可以参考dfu-util页面。

图形界面工具: 你可以使用一个叫做NeoTool的图形界面工具来代替Dfu-util烧写FreeRunner:请参考 NeoTool 页面.

DFU-util的不同版本如下:

Linux: http://downloads.openmoko.org/distro/releases/Om2008.9/dfu-util

请执行命令 chmod a+x dfu-util 以保证下载文件的可执行性(Executable)。

Linux 64-bit: You need 64-bit version of dfu-util, which usually can be found in your distribution repository. If your destribution does not provide 64-bit dfu-util, or it consistently fails with a "-62" error, you have two ways to go:

  1. Seek for 32-bit machine and do flashing form it.
  2. Use 32-bit chroot (on amd64 debian). Worked for me --Bubak 16:54, 4 September 2008 (UTC).
  3. Just try the 32-bit dfu-util. Worked fine on my x86_64 Fedora 10 --pcfe 2009-01-16.
    • I can confirm this (Gentoo multilib x86_64) --Unlotto 14:15, 4 February 2009 (UTC)

MacOS X: MacOS_X#Graphical_Flashing_with_Openmoko_Flasher

Windows: http://projects.openmoko.org/frs/?group_id=166&release_id=162

Windows版本需要安装驱动,具体请参见 Dfu-util-windows

虚拟机 当前不支持:(

[edit] #2 需要烧写映像文件

3类软件组件都有各自的映像文件,你可以选择其中一个或者多个进行更新。大多数情况下,你需要更新kernel(uImage)和根文件系统(rootfs)。bootloader一般不需要更新,除非需要通过更新来解决某个发现的bug。

请参考Distributions 来选择你需要的软件系统,然后到Download 下载。

[edit] 从NOR Flash启动FreeRunner

Booting from NOR Flash
  1. 请先阅读本文档的其他部分,因为你只有30秒的时间来输入flash烧写命令。阅读完本文档其他部分后再来阅读这一部分。
  2. 请先"""不要"""用USB线把PC机与FreeRunner连在一起。
  3. 从NOR Flash启动你的FreeRunner
    1. on按住选择键(AUX)
    2. 按住电源键(Power)直到出现启动菜单
    3. 启动菜单显示: *** BOOT MENU (NOR) ***
    4. See also Booting the Neo FreeRunner
  4. 停留在启动菜单上,不需要选择和进入任何一项,现在你就可以通过DFU-util进行烧写FALSH, 备份以及查询你的FreeRunner设备。
  5. 如果你什么都不做,启动菜单会在30秒后关闭。
  6. 通过USB线将FreeRunner连接到你的PC机。
  7. 现在你就可以在PC机上输入dfu-util的命令了。
  8. 如果在你烧写之前启动菜单就关闭了(屏幕变黑了), 回到步骤2. 如果你在30秒内进行了烧写操作,FreeRunner就会一直不关闭.


注意dfu-util连接不是基于USB的以太网连接,所以不要在你的Linux机器上试图建立一个USB0的网络接口(在windows上,你需要一个DFU驱动,或者你可以使用LibUSB-Win32驱动Dfu-util-windows )。dfu-util工具自己会建立一个到FreeRunner的连接。事实上,在FreeRunner的启动菜单界面,你无法通过USB建立一个以太网连接,只有在FreeRunner正常启动后才能建立这种连接。

在连接建立好以后,你可以执行以下命令了测试dfu-util是否找到FreeRunner:

dfu-util -l

如果你得到出错信息,就再试一次,一般第二次就可以查找到FreeRunner了。

dfu-util使用的是DeviceFirmwareUpgrade协议,所以有可能会列出多个设备。如果出现这种情况,请拔掉其他设备,如usb鼠标;或者使用 -d 选项指定要对话的设备。 [1].

另外,在执行dfu-util命令的时候,请保证有root用户权限。

[edit] 备份

如果你很喜欢当前已有的系统,又想试试一些新的东东,你最好先做一个备份Backup.

[edit] 使用dfu-util

dfu-util可以用来读写flash存储器,以及获取设备信息。

下面是向flash存储器的一个(预定义的)分区中中写入一个image文件的通用命令格式: This is the general command format to write an image file to a (predefined) "partition name" (referred to as altsetting in dfu-util help/manual) :

dfu-util -a <altsetting> -R -D <file_name>

where:
-a altsetting : 使用名字或者数字指定DFU接口的altsetting
-R  : 操作完成后发送重置USB信号。
-D file_name : 向设备的flash存储器写入文件名为file_name 的文件。

在Linux平台上,你可以在shell中运行dfu-util,在有些系统中你可能需要root用户权限,如在ubuntu中你可能需要使用sudo。

在Windows系统中,你可以打开一个命令行窗口来执行。

关于dfu-util的更详细的信息请参考: Dfu-util

dfu-util的GUI 前端 (更多): NeoTool

[edit] 烧写更新 Kernel

提示: 本操作需要在u-boot的启动菜单界面下进行,在按电源键启动手机时同时按住选择键便可以进入启动菜单。

烧写Kernel的命令如下:

dfu-util -a kernel -R -D /path/to/uImage

如果烧写成功,会显示下面的信息:

status(0) = No error condition is present
Done!

烧写也可能出现代码为-110的错误,这表示要烧写的kernel文件太大,当前分区存放不下。可以通过修改u-boot的参数来调整默认分区的大小。当然这个错误也可能是因为你烧写错了文件,如把rootfs文件当kernel文件烧写了。

[edit] 烧写根文件系统 rootfs

跟文件系统的映像文件必须是jffs2格式的。如果你下载的是一个压缩文件,请解压缩得到jffs2格式的文件。

烧写根文件系统的命令为:

dfu-util -a rootfs -R -D rootfs_filename.jffs2

rootfs_filename.jffs2 是根文件系统映像文件的文件名。 一个70M的影响文件的烧写时间大约是15分钟,注意保证你的FreeRunner的电池有充足的电量。

如果烧写成功,会显示如下信息:

status(0) = No error condition is present
Done!

[edit] 烧写更新boogloader

NOTE: 大多数情况下,你并不需要重新烧写你的bootloader,一般在需要更新一些特定功能,或者需要解决一些bug时才有必要重新烧写你的bootloader。


烧写bootloader的命令格式为:

dfu-util -a u-boot -R -D uboot.bin

uboot.bin 是bootloader映像文件的文件名.

提示: 要更新bootloader,你需要从NOR flash启动boot from NOR first. 更新完成后,再从NAND flash启动。

[edit] 从NAND存储器重启FreeRunner

现在你应该能够启动进入到新的系统了。

注意:如果你同时也更新了bootloader,那么更新后一定要从NAND flash启动, in particular if you upgraded the boot-loader (方法: 1. 按住电源键 ,然后 2. 按选择键)

会出现启动菜单 *** BOOT MENU (NAND) *** (see booting from NAND for more detailed instructions).

[edit] 一个简化dfu-util操作的命令行脚本

DFUScript 帮助那些通过命令行使用dfu-util来操作多个设备的用户。关于DFUScript的下载和使用信息从这里可以找到:DFUScript

[edit] Alternative: using nandwrite

This approach involves writing the rootfs into nand directly on the phone from a system already running on it, not necessarily via usb from a computer.

If you have a system running from a different partition that you intend to flash (for example sd card), you can use nandwrite to do the work, which is much faster (it takes about 30s to write a 59MB jffs2 image).

Make sure you have nandwrite installed (on gentoo, it's in sys-fs/mtd-utils package)

Also make sure that the host system has received correct partition list, for example for my stock Neo Freerunner partition list:

#cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00010000 "physmap-flash.0"
mtd1: 00040000 00020000 "u-boot"
mtd2: 00040000 00020000 "u-boot_env"
mtd3: 00800000 00020000 "kernel"
mtd4: 000a0000 00020000 "splash"
mtd5: 00040000 00020000 "factory"
mtd6: 0f6a0000 00020000 "rootfs"

In this case, we're looking for 'rootfs' which according to above is mtd6. If you have it somewhere else, substitute mtd6 with whatever you have in the remainder of this section.

You can test your nand for bad blocks by issuing nandtest /dev/mtd6 (this is a destructive test !)

First, put your .jffs2 file somewhere the phone system can read it

Second, write the desired image into the nand this way:

flash_eraseall /dev/mtd6
nandwrite -p /dev/mtd6 /path/to/image.jffs2

You're all done !

[edit] 问题解决

好的,现在你应该已经更新了系统,启动画面也出现了,但u-boot可能无法加载kernel,然后就返回到了启动菜单界面。这是为什么呢?

  • 你可能把软件的image文件烧写错了位置,譬如你可能把kernel文件当作rootfs来烧写了。内核image文件名一般为uImage.bin,bootloader的image文件名为u-boot.bin。解决办法是重新烧写一次。
  • 另一种可能就是你下载image文件事出错了。重新下载一次,并用MD5检查文件的完整性。

[edit] See also

  • Qi 不同于uboot的另一个bootloader
Personal tools


OpenMoko会不断发布最新的根文件系统(root file system)、内核(kernel)和[[Bootloader(called U-Boot) 的二进制映像(binary image)文件。这些文件可以被烧写到Neo FreeRunner的Flash memory (NAND) 中,从而达到更新系统套件的目的。你可以通过一根USB线,连接FreeRunner到电脑上,通过OpenMoko提供的烧写工具来更新系统。

3类软件组件and 2种存储器

FreeRunner的软件系统由3部分组成:

  • bootloader: 这是FreeRunner启动或者重启时执行的第一段小程序,它再启动其他软件系统。
  • kernel: FreeRunner采用的Linux内核。
  • root filesystem: 包括所有的应用程序和命令文件。

FreeRunner的这三类软件组件都打包成二进制映像文件进行发布。

FreeRunner有两种程序存储器:NOR flash与NAND flash。在PC机上,如果你想重装操作系统,你一般会使用一个光盘来启动系统,然后将操作系统从光盘拷贝安装到硬盘上。FreeRunner并没有光驱,但系统文件必须安装进内部的存储器(NAND flash)当中去。当然,一种可能的方式是从microSD卡来启动。

NOR flash是一个很小的程序存储器,里面存放着一段启动代码。当你需要重新安装系统,也就是需要重写NAND flash的时候,你可以从NOR flash启动来进行操作。一般来说,NOR flash是很少需要更新;如果需要,你可以从这里找到更新方法:Flashing NOR.。

NAND flash 就像PC机中的硬盘,它被分为三个分区,分别存放bootloader, kernel, 和rootfs。这三个分区分别可以独立的进行擦写更新。譬如,如果你想更新一个修改过的kernel,你只需要按照更新kernel的步骤进行操作就可以了。

注意:一般很少更新根文件系统rootfs及bootloader,因为有时只需要更新内核(kernel)文件就可以解决一些存在的问题,所以在更新之前请慎重考虑更新的必要性。

另一种方式: 将系统安装运行在 microSD 卡上

你可以将软件系统安装在microSD卡上,这样你可以从microSD卡启动并运行系统 boot from microSD card。这样可以同时保留在NAND flash上的系统,从而达到在FreeRunner上安装双系统的目的。(譬如,假如你的FreeRunner当前已经安装了2007.2的OM系统,你想在不擦除当前系统的前提下测试2008.08的OM系统,这种在microSD卡上的方式就是一个很好的选择了)

更新系统所需要的软件

#1 烧写工具: DFU-util 或 NeoTool

命令行工具: DFU-util, 需要安装在你的PC机上,当前有Linux, MacOS X, and Windows (参见下面的链接)多个版本. DFU-util可以帮助你通过USB连接到FreeRunner并控制bootloader。这种连接方式使用了一种特殊的bootloader接口协议,不同于USB网络,详细信息可以参考dfu-util页面。

图形界面工具: 你可以使用一个叫做NeoTool的图形界面工具来代替Dfu-util烧写FreeRunner:请参考 NeoTool 页面.

DFU-util的不同版本如下:

Linux: http://downloads.openmoko.org/releases/Om2008.9/dfu-util

请执行命令 chmod a+x dfu-util 以保证下载文件的可执行性(Executable)。

Linux 64-bit: You need 64-bit version of dfu-util, which usually can be found in your distribution repository. If your destribution does not provide 64-bit dfu-util, or it consistently fails with a "-62" error, you have two ways to go:

  1. Seek for 32-bit machine and do flashing form it.
  2. Use 32-bit chroot (on amd64 debian). Worked for me --Bubak 16:54, 4 September 2008 (UTC).
  3. Just try the 32-bit dfu-util. Worked fine on my x86_64 Fedora 10 --pcfe 2009-01-16.
    • I can confirm this (Gentoo multilib x86_64) --Unlotto 14:15, 4 February 2009 (UTC)

MacOS X: MacOS_X#Graphical_Flashing_with_Openmoko_Flasher

Windows: http://projects.openmoko.org/frs/?group_id=166&release_id=162

Windows版本需要安装驱动,具体请参见 Dfu-util-windows

虚拟机 当前不支持:(

#2 需要烧写映像文件

3类软件组件都有各自的映像文件,你可以选择其中一个或者多个进行更新。大多数情况下,你需要更新kernel(uImage)和根文件系统(rootfs)。bootloader一般不需要更新,除非需要通过更新来解决某个发现的bug。

请参考Distributions 来选择你需要的软件系统,然后到Download 下载。

从NOR Flash启动FreeRunner

Booting from NOR Flash
  1. 请先阅读本文档的其他部分,因为你只有30秒的时间来输入flash烧写命令。阅读完本文档其他部分后再来阅读这一部分。
  2. 请先"""不要"""用USB线把PC机与FreeRunner连在一起。
  3. 从NOR Flash启动你的FreeRunner
    1. on按住选择键(AUX)
    2. 按住电源键(Power)直到出现启动菜单
    3. 启动菜单显示: *** BOOT MENU (NOR) ***
    4. See also Booting the Neo FreeRunner
  4. 停留在启动菜单上,不需要选择和进入任何一项,现在你就可以通过DFU-util进行烧写FALSH, 备份以及查询你的FreeRunner设备。
  5. 如果你什么都不做,启动菜单会在30秒后关闭。
  6. 通过USB线将FreeRunner连接到你的PC机。
  7. 现在你就可以在PC机上输入dfu-util的命令了。
  8. 如果在你烧写之前启动菜单就关闭了(屏幕变黑了), 回到步骤2. 如果你在30秒内进行了烧写操作,FreeRunner就会一直不关闭.


注意dfu-util连接不是基于USB的以太网连接,所以不要在你的Linux机器上试图建立一个USB0的网络接口(在windows上,你需要一个DFU驱动,或者你可以使用LibUSB-Win32驱动Dfu-util-windows )。dfu-util工具自己会建立一个到FreeRunner的连接。事实上,在FreeRunner的启动菜单界面,你无法通过USB建立一个以太网连接,只有在FreeRunner正常启动后才能建立这种连接。

在连接建立好以后,你可以执行以下命令了测试dfu-util是否找到FreeRunner:

dfu-util -l

如果你得到出错信息,就再试一次,一般第二次就可以查找到FreeRunner了。

dfu-util使用的是DeviceFirmwareUpgrade协议,所以有可能会列出多个设备。如果出现这种情况,请拔掉其他设备,如usb鼠标;或者使用 -d 选项指定要对话的设备。 [1].

另外,在执行dfu-util命令的时候,请保证有root用户权限。

备份

如果你很喜欢当前已有的系统,又想试试一些新的东东,你最好先做一个备份Backup.

Using dfu-util

dfu-util can be used to read flash memory, write memory, and get information from the device.

This is the general command format to write an image file to a (predefined) "partition name" (referred to as altsetting in dfu-util help/manual) :

dfu-util -a <altsetting> -R -D <file_name>

where:
-a altsetting : Specify the altsetting of the DFU interface by name or by number
-R  : Issue USB Reset signalling once we're finished
-D file_name : Write firmware from file_name into device

On Linux, you run dfu-util from a command shell prompt. If you have not put it somewhere on your command path you probably need to prefix it with a "./" like this ./dfu-util. On some systems you need to be root before this will work and on Ubuntu you must preface the command with "sudo" or you will get the following error: "Cannot claim interface: could not claim interface 2: Operation not permitted"

On Windows, you need to open a command window and run from a command line. Use Start-Run Program and type "cmd" to open a Window.

More detailed manual for dfu-util is available here : Dfu-util

GUI frontend for dfu-util (and more): NeoTool

烧写更新 Kernel

提示: 本操作需要在u-boot的启动菜单界面下进行,在按电源键启动手机时同时按住选择键便可以进入启动菜单。

烧写Kernel的命令如下:

dfu-util -a kernel -R -D /path/to/uImage

如果烧写成功,会显示下面的信息:

status(0) = No error condition is present
Done!

烧写也可能出现代码为-110的错误,这表示要烧写的kernel文件太大,当前分区存放不下。可以通过修改u-boot的参数来调整默认分区的大小。当然这个错误也可能是因为你烧写错了文件,如把rootfs文件当kernel文件烧写了。

烧写根文件系统 rootfs

跟文件系统的映像文件必须是jffs2格式的。如果你下载的是一个压缩文件,请解压缩得到jffs2格式的文件。

烧写根文件系统的命令为:

dfu-util -a rootfs -R -D rootfs_filename.jffs2

rootfs_filename.jffs2 是根文件系统映像文件的文件名。 一个70M的影响文件的烧写时间大约是15分钟,注意保证你的FreeRunner的电池有充足的电量。

如果烧写成功,会显示如下信息:

status(0) = No error condition is present
Done!

烧写更新boogloader

NOTE: 大多数情况下,你并不需要重新烧写你的bootloader,一般在需要更新一些特定功能,或者需要解决一些bug时才有必要重新烧写你的bootloader。


烧写bootloader的命令格式为:

dfu-util -a u-boot -R -D uboot.bin

uboot.bin 是bootloader映像文件的文件名.

提示: 要更新bootloader,你需要从NOR flash启动boot from NOR first. 更新完成后,再从NAND flash启动。

从NAND存储器重启FreeRunner

现在你应该能够启动进入到新的系统了。

注意:如果你同时也更新了bootloader,那么更新后一定要从NAND flash启动, in particular if you upgraded the boot-loader (方法: 1. 按住电源键 ,然后 2. 按选择键)

会出现启动菜单 *** BOOT MENU (NAND) *** (see booting from NAND for more detailed instructions).

一个简化dfu-util操作的命令行脚本

DFUScript 帮助那些通过命令行使用dfu-util来操作多个设备的用户。关于DFUScript的下载和使用信息从这里可以找到:DFUScript

Alternative: using nandwrite

This approach involves writing the rootfs into nand directly on the phone from a system already running on it, not necessarily via usb from a computer.

If you have a system running from a different partition that you intend to flash (for example sd card), you can use nandwrite to do the work, which is much faster (it takes about 30s to write a 59MB jffs2 image).

Make sure you have nandwrite installed (on gentoo, it's in sys-fs/mtd-utils package)

Also make sure that the host system has received correct partition list, for example for my stock Neo Freerunner partition list:

#cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00010000 "physmap-flash.0"
mtd1: 00040000 00020000 "u-boot"
mtd2: 00040000 00020000 "u-boot_env"
mtd3: 00800000 00020000 "kernel"
mtd4: 000a0000 00020000 "splash"
mtd5: 00040000 00020000 "factory"
mtd6: 0f6a0000 00020000 "rootfs"

In this case, we're looking for 'rootfs' which according to above is mtd6. If you have it somewhere else, substitute mtd6 with whatever you have in the remainder of this section.

You can test your nand for bad blocks by issuing nandtest /dev/mtd6 (this is a destructive test !)

First, put your .jffs2 file somewhere the phone system can read it

Second, write the desired image into the nand this way:

flash_eraseall /dev/mtd6
nandwrite -p /dev/mtd6 /path/to/image.jffs2

You're all done !

问题解决

好的,现在你应该已经更新了系统,启动画面也出现了,但u-boot可能无法加载kernel,然后就返回到了启动菜单界面。这是为什么呢?

  • 你可能把软件的image文件烧写错了位置,譬如你可能把kernel文件当作rootfs来烧写了。内核image文件名一般为uImage.bin,bootloader的image文件名为u-boot.bin。解决办法是重新烧写一次。
  • 另一种可能就是你下载image文件事出错了。重新下载一次,并用MD5检查文件的完整性。

See also

  • Qi 不同于uboot的另一个bootloader