DNW_for_linux 下载:
免费下载地址在
用户名与密码都是www.linuxidc.com
具体下载目录在
1.首先解压缩文件:
# tar xvf dnw_for_linux.tar.gz
另:在Ubuntu下右键解压也很方便
目录如下:
dnw_linux/
dnw_linux/secbulk/
dnw_linux/secbulk/Makefile
dnw_linux/secbulk/secbulk.c
dnw_linux/dnw/
dnw_linux/dnw/dnw.c
其中secbulk.c是PC端USB驱动,dnw.c是写入工具
2编译并加载secbulk.c内核模块
$cdsecbulk$make -C/lib/modules/`uname -r`/build M=`pwd` modules
编译成功后在当前目录下可以看到secbulk.ko
3.编译完成后,会生成secbulk.ko文件:
# ls
Makefile
modules.order
4.加载模块到Linux内核:
# sudo insmod./secbulk.ko
#dmesg
secbulk:secbulk loaded
usbcore: registered new interface driversecbulk
开机的时候不会自动加载.ko文件,这样每次都要先加载才可以使用,此时将其加入开机脚本,
使其得到自动加载,编辑/etc/init.d/rc.local 在最后加上 insmod/所在路径/secbulk.ko。
5.下面开始编译dnw工具
# cd ../dnw
# gcc -o dnw dnw.c
(编译完成,会看到dnw可执行文件)
6.将文件copy到/usr/local/bin目录
# sudo cp dnw /usr/local/bin
(这样就可以在shell下面直接使用dnw命令了)
使用方法如下:
1.在minicom下,从NorFlash启动TQ2440,选择a功能:
关于串口通信的设置常见
####
#####
[1] Download u-boot or STEPLDR.nb1 or other bootloader to NandFlash
[2] Download Eboot (eboot.nb0) to NandFlash
[3] Download Linux Kernel (zImage.bin) to NandFlash
[5] Download CRAMFS image to NandFlash
[6] Download YAFFS image (root.bin) to NandFlash
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Runit
[8] Boot thesystem
[9] Format the NandFlash
[0] Set the bootparameters
[a] Download User Program (eg: uCOS-II orTQ2440_Test)
[b] Download LOGO Picture (.bin) toNand
[l] Set LCDParameters
[n] Enter TFTP download modemenu
[o] Download u-boot to NorFlash
[r] Rebootu-boot
[t] Test Linux Image(zImage)
[q] quit frommenu
Enter your selection:a
USB host is connected. Waiting adownload.
minicom的输出信息
Enter your selection:a
USB host is connected. Waiting adownload.
2.此时,打开另一个终端:
# sudo dnw 1.bin
libing@Ubuntu:~$sudo dnw 1.bin
file name : 1.bin
file size : 1214004 bytes
Writing data...
100%
重启ARM,是不是程序已经下载进去啊。
DNW_for_linux 下载:
免费下载地址在
用户名与密码都是www.linuxidc.com
具体下载目录在
原文地址:http://www.linuxidc.com/Linux/2011-12/48966.htm