自从学习嵌入式Linux开发以来,一直在使用Windows下的DNW工具。每次下载u-boot到NandFlash都必须要切换到Windows下面,比较的麻烦,今天发现了一个在Linux下也很好用的DNW工具。就以usb2ram,其具体的安装和使用方法记录如下:
必须先下载该安装文件。下载下来的文件必须再从新编译一下才能使用,不过要确保你安装了下面的两个文件:
libusb和libusb-dev。我的操作系统是Ubuntu,可以使用命令
sudo apt-get install libusb-dev
|
我只安装了libusb-dev就可以使用了。
然后,在Makefile文件中第一行后面添加一行
其整个Makefile文件修改后的内容如下:
#!/usr/bin/make CC=gcc LDFLAGS=-lusb -lm
all: usb2ram
clean: -rm -f *.o usb2ram
usb2ram: usb2ram.o $(CC) $(LDFLAGS) -o $@ $<
boot_usb.o: boot_usb.c $(CC) $(CFLAGS) -o $@ -c $<
.PHONEY: all clean
|
然后,在make一下,
生成了usb2ram的执行文件。
使用方法,当在NorFlash启动supervivi时,可以像在windows下面使用DNW一样,选择a
##### FriendlyARM BIOS 2.0 for 2440 ##### [x] format NAND FLASH for Linux [v] Download vivi [k] Download linux kernel [y] Download root_yaffs image [a] Absolute User Application [n] Download Nboot for WinCE [l] Download WinCE boot-logo [w] Download WinCE NK.bin [d] Download & Run [z] Download zImage into RAM [g] Boot linux from RAM [f] Format the nand flash [b] Boot the system [s] Set the boot parameters [u] Backup NAND Flash to HOST through USB(upload) [r] Restore NAND Flash from HOST through USB [q] Goto shell of vivi [i] Version: 0945-2K Enter your selection:
|
出现USB host is connected. Waiting a download.
就可以使用usb2ram了。
sudo ./usb2ram 地址 文件名
这样就可以下载到NandFlash中了。文件放在usb2ram目录下面。