SD卡自动更新Linux系统
Ø 根据前面的章节制作好SD启动卡之后,在SD卡boot分区根目录下新建名为“images”的目录(如果已经存在请您跳过这一步),如下图所示:

Ø 在images目录下存放自动烧写脚本“EmbedSky.ini”文件:

Ø 根据您的SD卡下的实际路径编辑“EmbedSky.ini”的内容(光盘里面提供的“EmbedSky.ini”文件的框架仅供参考,实际路径以您的SD卡的目录结构为准)
建议您直接复制TQ3358配套光盘里面的EmbedSky.ini文件到您的SD卡的images目录下,然后根据您实际的目录结构做修改即可。下面是笔者修改用于自动下载的EmbedSky.ini文件的内容,您一定要根据您的实际情况来做修改。下面是笔者根据自己SD卡中保存镜像路径修改的:
以下是Embedsky.ini内容
#### This is TQ3358 SD config files ####
operating condition=install #注释1
OS Type=Linux #注释2
LED indicator=on
Beep=on
#### Others ####
bootloader=images\\bootloader\\u-boot.img #注释3
LOGO=
#### Others end ####
#### Linux ####
kernel=images\\linux\\uImage #注释4
rootfs=images\\linux\\root.bin#注释 5
#### Linux end ####
#### Windows CE ####
stepldr=images\\wince\\MLC256MB_A104\\block0img.nb0
eboot=images\\wince\\MLC256MB_A104\\EBOOT.bin
NK=images\\wince\\MLC256MB_A104\\NK.bin
#### Windows CE end ####
#### Android ####
kernel=
rootfs=#### Android end ####
#### uCOS-II ####
uCOS-II Image=images\\uCOS-II\\TQ3358_UCOS-II.bin
#### uCOS-II end ####
#### User Application ####
Application Image=images\\UserAPPS\\TQ3358_Test.bin
#### User Application end 6###
注释1:此处应设置为install。
注释2:此处填写烧写的系统类型为Linux。
注释3:指定需要下载的bootloader镜像路径。
注释4:指定需要下载的内核镜像。
注释5:指定需要下载的文件系统镜像,如果文件系统类型是UBI,后缀名为img,文件系统类型是yaffs则后缀名为bin。(暂不支持ubi)
Ø 自动烧写linux时修改Embedsky.ini范例
以下是笔者的sd卡自动启动的过程。这里路径与上面讲的有点不同,这是为了说明,在images文件夹中镜像具体放哪里没有关系,只要路径设置对了就可以了。但是有一个大前提是镜像要在images文件夹中。
EmbedSky.ini文件:
这里烧写的是linux所以其它Linux,WinCE,UCOS之类的可以完全不去理会它,只要注意下面红色字体灰色底纹的就可以了。
#### This is TQ3358 SD config files ####
operating condition=install
OS Type=linux
LED indicator=on
Beep=on
#### Others ####
bootloader=images\\u-boot_release_0718.img
LOGO=
#### Others end ####
#### Linux ####
kernel=images\\ulmage
rootfs=images\\root.bin
#### Linux end ####
#### Windows CE ####
stepldr=images\\wince\\MLC\\block0img.nb0
eboot=images\\wince\\MLC\\EBOOT.bin
NK=images\\wince\\MLC\\NK.bin
#### Windows CE end ####
#### Android ####
kernel=images\\uImage
rootfs=images\\rootfs_dir_release_0713.bin
#### Android end ####
#### uCOS-II ####
uCOS-II Image=images\\uCOS-II\\TQ3358_UCOS-II.bin
#### uCOS-II end ####
#### User Application ####
Application Image=images\\UserAPPS\\TQ3358_Test.bin
#### User Application end #####
下面是SD卡启动的打印:
Welcome to use TQ3358 Board!
boot from SD card... 从SD卡启动
##### EmbedSky BIOS for TQ3358 #####
This Board: SDRAM is 512MB; LCD display size is: 800X480
Hit any key to stop autoboot: 0
reading images\EmbedSky.ini 读取SD卡自动烧写的配置文件
575 bytes read
condition=INSTALL
OSType=LINUX
beep state=ON
bootloader=images\\bootloader\\u-boot.img uboot路径
reading MLO 更新MLO,从SD卡boot分区的根目录下读MLO
38616 bytes read
HW ECC BCH8 Selected
NAND erase: device 0 offset 0x0, size 0x20000
Erasing at 0x0 -- 100% complete.
OK 擦除MLO所在的SPL分区
NAND write: device 0 offset 0x0, size 0x96d8
Writting at 0x8800 -- 100% complete. 38616 bytes written: OK 将MLO写进NAND
reading images\bootloader\u-boot.img 读uboot
451072 bytes read
HW ECC BCH8 Selected
NAND erase: device 0 offset 0x80000, size 0x1e0000
Erasing at 0x240000 -- 100% complete.
OK 擦除uboot分区
NAND write: device 0 offset 0x80000, size 0x6e200
Writting at 0xed800 -- 100% complete. 451072 bytes written: OK 将uboot写入nand
logodir=
Don't need to download logo image.
Linux uImage=uImage
reading uImage 从SD卡读取内核到内存
3646816 bytes read
HW ECC Hamming Code selected
NAND erase: device 0 offset 0x280000, size 0x500000
Erasing at 0x760000 -- 100% complete.
OK 擦除nand的kernel分区
NAND write: device 0 offset 0x280000, size 0x37a560
Writting at 0x5f9800 -- 100% complete. 3646816 bytes written: OK 将内核写入nand
Linux rootfs=images\\linux\\root.bin
reading images\\linux\\root.bin 从SD卡读文件系统到内存
160400064 bytes read
HW ECC Hamming Code selected
NAND erase: device 0 offset 0x780000, size 0xf880000
Skipping bad block at 0x02980000
Skipping bad block at 0x05f20000
Skipping bad block at 0x0ca20000
Skipping bad block at 0x0e3e0000
Skipping bad block at 0x0ef80000 跳过NAND坏块
Erasing at 0xffe0000 -- 100% complete.
OK 擦除NAND的root分区
NAND write: device 0 offset 0x780000, size 0x98f82c0
Writting at 0x2860000 -- 22% complete.Skip bad block 0x02980000
Writting at 0x5de0000 -- 58% complete.Skip bad block 0x05f20000
Writting at 0x9c16000 -- 100% complete. 160402176 bytes
written: OK 将文件系统镜像写入NAND
setting bootargs ...
bootargs=console=ttyO0,115200n8 root=/dev/mtdblock8 rootfstype=yaffs2 rw rootwait=1 init=/init ip=off lcd=X800Y480 uart1_d_can=uart1 uart2_i2c2=uart2
HW ECC Hamming Code selected
NAND read: device 0 offset 0x280000, size 0x500000
5242880 bytes read: OK
## Booting kernel from Legacy Image at 80007fc0 ...
Image Name: Linux-3.2.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3646752 Bytes = 3.5 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 3.2.0 (root@hxs-tq-1501) (gcc version 4.4.6 (for TQ3358 EmbedSky Tech) ) #4 Tue Oct 16 16:19:53 CST 2012
[ 0.000000] AM335X ES1.0 (sgx neon )
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mtdblock8 rootfstype=yaffs2 rw rootwait=1 init=/init ip=off lcd=X800Y480
[ 0.000000] user X800Y480 lcd.
[ 0.000000] uart1_d_can, user select uart1.
[ 0.000000] uart2_i2c2, user select uart2.//以下的省略
如果没有找到对应的镜像会出现
Linux rootfs=images\\linux\\root.bin
reading images\\linux\\root.bin
** Unable to read "images\\linux\\root.bin" from mmc 0:1 **
run command error!
can not find images\\\linux\\\root.bin in sd card or can not find SD card!
don't download Linux rootfs
这样的错误提示,此时您可以看下对应镜像的路径有没有对
Ø 根据前面的章节制作好SD启动卡之后,在SD卡boot分区根目录下新建名为“images”的目录(如果已经存在请您跳过这一步),如下图所示:

Ø 在images目录下存放自动烧写脚本“EmbedSky.ini”文件:

Ø 根据您的SD卡下的实际路径编辑“EmbedSky.ini”的内容(光盘里面提供的“EmbedSky.ini”文件的框架仅供参考,实际路径以您的SD卡的目录结构为准)
建议您直接复制TQ3358配套光盘里面的EmbedSky.ini文件到您的SD卡的images目录下,然后根据您实际的目录结构做修改即可。下面是笔者修改用于自动下载的EmbedSky.ini文件的内容,您一定要根据您的实际情况来做修改。下面是笔者根据自己SD卡中保存镜像路径修改的:
以下是Embedsky.ini内容
#### This is TQ3358 SD config files ####
operating condition=install #注释1
OS Type=Linux #注释2
LED indicator=on
Beep=on
#### Others ####
bootloader=images\\bootloader\\u-boot.img #注释3
LOGO=
#### Others end ####
#### Linux ####
kernel=images\\linux\\uImage #注释4
rootfs=images\\linux\\root.bin#注释 5
#### Linux end ####
#### Windows CE ####
stepldr=images\\wince\\MLC256MB_A104\\block0img.nb0
eboot=images\\wince\\MLC256MB_A104\\EBOOT.bin
NK=images\\wince\\MLC256MB_A104\\NK.bin
#### Windows CE end ####
#### Android ####
kernel=
rootfs=#### Android end ####
#### uCOS-II ####
uCOS-II Image=images\\uCOS-II\\TQ3358_UCOS-II.bin
#### uCOS-II end ####
#### User Application ####
Application Image=images\\UserAPPS\\TQ3358_Test.bin
#### User Application end 6###
注释1:此处应设置为install。
注释2:此处填写烧写的系统类型为Linux。
注释3:指定需要下载的bootloader镜像路径。
注释4:指定需要下载的内核镜像。
注释5:指定需要下载的文件系统镜像,如果文件系统类型是UBI,后缀名为img,文件系统类型是yaffs则后缀名为bin。(暂不支持ubi)
Ø 自动烧写linux时修改Embedsky.ini范例
以下是笔者的sd卡自动启动的过程。这里路径与上面讲的有点不同,这是为了说明,在images文件夹中镜像具体放哪里没有关系,只要路径设置对了就可以了。但是有一个大前提是镜像要在images文件夹中。
EmbedSky.ini文件:
这里烧写的是linux所以其它Linux,WinCE,UCOS之类的可以完全不去理会它,只要注意下面红色字体灰色底纹的就可以了。
#### This is TQ3358 SD config files ####
operating condition=install
OS Type=linux
LED indicator=on
Beep=on
#### Others ####
bootloader=images\\u-boot_release_0718.img
LOGO=
#### Others end ####
#### Linux ####
kernel=images\\ulmage
rootfs=images\\root.bin
#### Linux end ####
#### Windows CE ####
stepldr=images\\wince\\MLC\\block0img.nb0
eboot=images\\wince\\MLC\\EBOOT.bin
NK=images\\wince\\MLC\\NK.bin
#### Windows CE end ####
#### Android ####
kernel=images\\uImage
rootfs=images\\rootfs_dir_release_0713.bin
#### Android end ####
#### uCOS-II ####
uCOS-II Image=images\\uCOS-II\\TQ3358_UCOS-II.bin
#### uCOS-II end ####
#### User Application ####
Application Image=images\\UserAPPS\\TQ3358_Test.bin
#### User Application end #####
下面是SD卡启动的打印:
Welcome to use TQ3358 Board!
boot from SD card... 从SD卡启动
##### EmbedSky BIOS for TQ3358 #####
This Board: SDRAM is 512MB; LCD display size is: 800X480
Hit any key to stop autoboot: 0
reading images\EmbedSky.ini 读取SD卡自动烧写的配置文件
575 bytes read
condition=INSTALL
OSType=LINUX
beep state=ON
bootloader=images\\bootloader\\u-boot.img uboot路径
reading MLO 更新MLO,从SD卡boot分区的根目录下读MLO
38616 bytes read
HW ECC BCH8 Selected
NAND erase: device 0 offset 0x0, size 0x20000
Erasing at 0x0 -- 100% complete.
OK 擦除MLO所在的SPL分区
NAND write: device 0 offset 0x0, size 0x96d8
Writting at 0x8800 -- 100% complete. 38616 bytes written: OK 将MLO写进NAND
reading images\bootloader\u-boot.img 读uboot
451072 bytes read
HW ECC BCH8 Selected
NAND erase: device 0 offset 0x80000, size 0x1e0000
Erasing at 0x240000 -- 100% complete.
OK 擦除uboot分区
NAND write: device 0 offset 0x80000, size 0x6e200
Writting at 0xed800 -- 100% complete. 451072 bytes written: OK 将uboot写入nand
logodir=
Don't need to download logo image.
Linux uImage=uImage
reading uImage 从SD卡读取内核到内存
3646816 bytes read
HW ECC Hamming Code selected
NAND erase: device 0 offset 0x280000, size 0x500000
Erasing at 0x760000 -- 100% complete.
OK 擦除nand的kernel分区
NAND write: device 0 offset 0x280000, size 0x37a560
Writting at 0x5f9800 -- 100% complete. 3646816 bytes written: OK 将内核写入nand
Linux rootfs=images\\linux\\root.bin
reading images\\linux\\root.bin 从SD卡读文件系统到内存
160400064 bytes read
HW ECC Hamming Code selected
NAND erase: device 0 offset 0x780000, size 0xf880000
Skipping bad block at 0x02980000
Skipping bad block at 0x05f20000
Skipping bad block at 0x0ca20000
Skipping bad block at 0x0e3e0000
Skipping bad block at 0x0ef80000 跳过NAND坏块
Erasing at 0xffe0000 -- 100% complete.
OK 擦除NAND的root分区
NAND write: device 0 offset 0x780000, size 0x98f82c0
Writting at 0x2860000 -- 22% complete.Skip bad block 0x02980000
Writting at 0x5de0000 -- 58% complete.Skip bad block 0x05f20000
Writting at 0x9c16000 -- 100% complete. 160402176 bytes
written: OK 将文件系统镜像写入NAND
setting bootargs ...
bootargs=console=ttyO0,115200n8 root=/dev/mtdblock8 rootfstype=yaffs2 rw rootwait=1 init=/init ip=off lcd=X800Y480 uart1_d_can=uart1 uart2_i2c2=uart2
HW ECC Hamming Code selected
NAND read: device 0 offset 0x280000, size 0x500000
5242880 bytes read: OK
## Booting kernel from Legacy Image at 80007fc0 ...
Image Name: Linux-3.2.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3646752 Bytes = 3.5 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 3.2.0 (root@hxs-tq-1501) (gcc version 4.4.6 (for TQ3358 EmbedSky Tech) ) #4 Tue Oct 16 16:19:53 CST 2012
[ 0.000000] AM335X ES1.0 (sgx neon )
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mtdblock8 rootfstype=yaffs2 rw rootwait=1 init=/init ip=off lcd=X800Y480
[ 0.000000] user X800Y480 lcd.
[ 0.000000] uart1_d_can, user select uart1.
[ 0.000000] uart2_i2c2, user select uart2.//以下的省略
如果没有找到对应的镜像会出现
Linux rootfs=images\\linux\\root.bin
reading images\\linux\\root.bin
** Unable to read "images\\linux\\root.bin" from mmc 0:1 **
run command error!
can not find images\\\linux\\\root.bin in sd card or can not find SD card!
don't download Linux rootfs
这样的错误提示,此时您可以看下对应镜像的路径有没有对