ddleed / dnw-linux Goto Github PK
View Code? Open in Web Editor NEWThis project forked from torchwoods/dnw-linux
Linux下的dnw工具(命令行版),包括依赖驱动的dnw和不用驱动的dnw2(使用libusb)
This project forked from torchwoods/dnw-linux
Linux下的dnw工具(命令行版),包括依赖驱动的dnw和不用驱动的dnw2(使用libusb)
1、源码说明: 1.1起因 由于本人最近要做一个嵌入式的项目,涉及到开发板的调试,按照开发板商提供的文档都 是要求在winxp下用dnw和xshell来调试,xshell还好说,关键是dnw usb驱动在win7下 无法安装,而且我工作环境都是linux,在linux下编译调试开发板本就是天经地义的事儿, 却被这些开发板商教导成在win下用虚拟机装linux系统作为编译环境,在win下用dnw来烧 写调试开发板,win系统还得是xp的,这不是坑爹吗? 1.2说明 本源代码收集自网络,经过整理和加入宏定义,使其适用于OK6410/EZ6410/FS2410和 UT-Exynos4412(我当前使用的)开发板;对源码进行了适当的注释和错误纠正,同时加 了dnw2源代码(利用libusb而不需内核驱动);同样以GPL协议发布; 2、使用说明: 2.1 编译 安装libusb sudo apt-get install libusb-dev git clone [email protected]:hechaoyuyu/dnw-linux.git cd dnw-linux make make install 安装的文件为: dnw --- 用于传输数据的软件(依赖secbulk.ko),用法:dnw filename secbulk.ko --- 识别下载用USB的驱动; dnw.rules --- 自动加载secbulk.ko; dnw2 --- 基于libusb而不用内核模块的数据传输程序,用法:dnw2 filename 2.1 使用 首先用串口线连好PC与开发板(我用的是usb转串口线),并设置好kermit或minicom( 用dmesg查看串口设备文件),启动开发板进入u-boot,输入dnw <下载地址>,如我要 下载bootloader,则在开发板上输入dnw 0x40008000,u-boot会提示你连接usb otg 线,连接好usb线后,u-boot会提示已经连接完毕,可以进行数据传输,则在PC端输入 dnw file_name或dnw2 file_name,我这里是输入sudo dnw2 bootloader_mmc.bin, 数据传输完毕即可进行烧写操作。 2.2 注意 关于dnw中指定的下载地址,请按自己开发板中记录的地址为准,再去改dnw2.c或dnw.c 中对应的RAM_BASE。连好usb线后,先在PC上用lsusb查看刚连接的usb设备ID号,再去 改dnw2.c或secbulk.c中VENDOR_ID/PRODUCT_ID或secbulk_table。 3、后续开发 如有必要和时间,打算开发一个类似于win下的dnw图形界面版,集kermit/minicom与 dnw下载功能如一体,用pygtk或qt来做界面,如果谁有兴趣,可以与我联系: [email protected] 。 以下是针对OK6410开发板的使用流程: 1. build and install ===================== $ make $ sudo make install 2. dnw tool usage ===================== Connect board to PC and open minicom. Boot board and enter U-Boot command line mode. Then run command "dnw <download address>" in U-Boot. U-Boot may print bellow message: Insert a OTG cable into the connector! OTG cable Connected! Now, Waiting for DNW to transmit data Now, you can download your file to board by follow command on PC end: $ sudo dnw <file_to_download> Note: If your board isn't FL Ok6410, please set right load-address via "a" option. Above steps have only download file to board's RAM, so you need flash it to nand via U-Boot command "nand write". If above doesn't work, pls check if you can see bellow message in `dmesg`. usb 1-1: new full speed USB device using uhci_hcd and address 2 usb 1-1: configuration #1 chosen from 1 choice secbulk:secbulk probing... secbulk:bulk out endpoint found! =============================================== some U-Boot commands special for FL Ok6410 (1) download U-Boot $dnw 50008000 $nand erase 0 100000 $nand write.uboot 50008000 0 100000 #dnw default load address is 0xc0000000 all in one: $dnw 50008000 && nand erase 0 100000 && nand write.uboot 50008000 0 100000 (2) download kernel $dnw 50008000 $nand erase 100000 500000 $nand write.e 50008000 100000 500000 all in one: $dnw 50008000 && nand erase 100000 500000 && nand write.e 50008000 100000 500000 (3) download yaffs2 root file system $dnw 50008000 $nand erase 600000 #erase mtdblock2 partition $nand write.yaffs2 50008000 600000 8000000 #instead 8000000 of real image size all in one: $dnw 50008000 && nand erase 600000 && nand write.yaffs2 50008000 600000 8000000 (4) download ubifs/cramfs root file system $dnw 50008000 $nand erase 600000 #erase mtdblock2 partition $nand write.e 50008000 600000 8000000 #instead 8000000 of real image size all in one: $dnw 50008000 && nand erase 600000 && nand write.e 50008000 600000 8000000 (5) download jffs2 root file system $dnw 50008000 $nand erase 600000 #erase mtdblock2 partition $nand write.jffs2 50008000 600000 8000000 #instead 8000000 of real image size all in one: $dnw 50008000 && nand erase 600000 && nand write.jffs2 50008000 600000 8000000 (6) deal with bad blocks $nand scrub (7) set kernel arguments $setenv bootargs "root=/dev/mtdblock2 rootfstype=yaffs2 console=ttySAC0,115200" $save $reset (8) boot from NFS $setenv bootargs "root=/dev/nfs nfsroot=192.168.0.231:/FileSystem-Yaffs2 \ ip=192.168.0.232:192.168.0.231:192.168.0.201:255.255.255.0:8.8.8.8:eth0:off \ console=ttySAC0,115200" $save # "192.168.0.231" is your host ip; "192.168.0.232" is your board's ip; # "192.168.0.201" is gateway; "255.255.255.0" is mask.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.