本文主要是介绍Linux DNW烧写实例,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、安装linux DNW
http://blog.csdn.net/sanlinux/archive/2010/04/09/5465012.aspx
2、在u-boot中选择需烧写的项,如内核、文件系统等。
##### Boot for Nand Flash Main Menu #####
[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash
[2] Download Eboot to Nand Flash
[3] Download Linux Kernel to Nand Flash
[5] Download CRAMFS image to Nand Flash
[6] Download YAFFS image to Nand Flash
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it
[8] Boot the system
[9] Format the Nand Flash
[0] Set the boot parameters
[a] Download User Program (eg: uCOS-II or TQ2440_Test)
[b] Download LOGO Picture (.bin) to Nand Flash
[l] Set LCD Parameters
[r] Reboot u-boot
[q] quit from menu
Enter your selection: 6
USB host is connected. Waiting a download.
Now, Downloading [ADDRESS:30000000h,TOTAL:55866634]
RECEIVED FILE SIZE:55866634 (443KB/S, 123S)
NAND erase: device 0 offset 0x400000, size 0x3c00000
Skipping bad block at 0x01798000
Skipping bad block at 0x02504000
Erasing at 0x3ffc000 -- 100% complete.
OK
3、在PC端使用dnw传送需烧写的文件。
sudo dnw root_qtopia_2.2.0_2.6.30.4_64MB.bin
file name : root_qtopia_2.2.0_2.6.30.4_64MB.bin
file size : 55866624 bytes
Writing data...
23% 55866634 bytes OK
4、说明:如果要了解整个烧写的过程,重点还是要分析uboot烧写的实现源码。
common目录下包含了uboot的内嵌命令(如usbslave, loady等),需分析研究。
5、在烧写文件系统时,我们往往会烧写文件系统的实际大小,而不是分配的最大值。获取文件大小,并转化为十六进制的sh表达式为:
du -b file | awk '{printf "%x", $1}'
这篇关于Linux DNW烧写实例的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!