"Reprint"--Using DNW for USB download under Linux

Source: Internet
Author: User
Tags dmesg

Development Board is a friendly arm mini2440

PC OS Ubuntu 10.10

A while ago in Windows familiar with the Development Board, and now began to switch to Ubuntu, has been dnw, so with WIN7, now try to do a good job.

The premise is that your minicom to be installed, this does not understand their own search, it is easy to configure, here the main DNW configuration, because there are a lot of network configuration can not use, here I refer to the next http://hi.baidu.com/go_it/blog/item/ 35e457880a5253bd0f244458.html.

Say something about the use of DNW for Linux.
First go to the Internet to search DNW for Linux.

I'm uploading a http://download.csdn.net/source/3326087.

Download back unzip.
The directory is as follows:

dnw_linux/
dnw_linux/secbulk/
Dnw_linux/secbulk/makefile
Dnw_linux/secbulk/secbulk.c
dnw_linux/dnw/
Dnw_linux/dnw/dnw.c

Where SECBULK.C is the PC-side USB driver, DNW.C is the Write tool

2.2 Compiling and loading the SECBULK.C kernel module
$CD Secbulk
$make-C/lib/modules/' uname-r '/build m= ' pwd ' modules

After the compilation is successful, you can see the Secbulk.ko in the current directory

Load the module with the Insmod command, which requires root privileges
$sudo Insmod./secbulk.ko

Compiling the DNW write tool
$CD DNW
$GCC-O dnw dnw.c
Build executable file after successful compilation DNW

This will allow you to download the program.

is a bin file that I downloaded via USB

Since sometimes the post-DNW can be problematic, here are some common questions and more detailed actions, as follows: http://shundacao.blog.163.com/blog/static/1340404812010102123259108/

I've been doing this since we finished, there are three options, DNW and DNW2 and Usb2ram

The first need to load the driver, the following two need to install Libusb-dev. The second type of burning is fast, and I can hear the sound of the current. But it's also very unstable. The frequently occurring hints are:

"Usb_bulk_write Failed:resource temporarily Unavailable"

The message from the tip is that the burned file is larger than the capacity. But the actual situation is not, the reason is unclear. Some people say that every time you write, you need to reseat the USB.

Usb2ram tip information is not found on the device, unexplained
========================================
The error hints that are frequently used with DNW2 are:

Target USB Device found!
Cannot claim Interface:device or resource busy

========================================================
I later still used the first method of loading the drive:
The method is:
1. Download the PC-side USB drive and write tool for Linux under DNW
File name: Dnw_linux.zip
After downloading, change the suffix name to. tgz
# or search for Linux DNW
2. Compiling PC-side USB drive and write tools
2.1 Decompression
$ tar xzvf/path/to/dnw_linux.tgz
dnw_linux/
dnw_linux/secbulk/
Dnw_linux/secbulk/makefile
Dnw_linux/secbulk/secbulk.c
dnw_linux/dnw/
Dnw_linux/dnw/dnw.c

Where SECBULK.C is the PC-side USB driver, DNW.C is the Write tool

2.2 Compiling and loading the SECBULK.C kernel module
$CD Secbulk
$make-C/lib/modules/' uname-r '/build m= ' pwd ' modules

After the compilation is successful, you can see the Secbulk.ko in the current directory
[Email protected]:~/project3/qq2440/dnw_linux/dnw_linux/secbulk$ ls
Makefile

Module.symvers secbulk.c Secbulk.ko secbulk.mod.c secbulk.mod.o SECBULK.O

Load the module with the Insmod command, which requires root privileges
$sudo Insmod./secbulk.ko

After loading, use the DMESG command to see that the module has been successfully loaded
[238.007970] Secbulk:secbulk loaded
[238.009101] usbcore:registered new Interface driver Secbulk

2.3 Compiling the DNW write tool
$CD DNW
$GCC-O dnw dnw.c
Build executable file after successful compilation DNW

==========================
It is important to use DMESG to see if the driver is successfully loaded, and if this is not the case, you will be prompted to say "Can not open/dev/secbulk0"


3 Download using DNW
3.1 Start the Development Board, enter the Supervivi, and connect the Development Board and the PC with a USB cable, at which point the DMESG command can be used to see the Secbulk driver loading:
[283.677772] USB 1-1: New full speed USB device using UHCI_HCD and address 2
[284.084835] USB 1-1: Configuration #1 chosen from 1 choice
[284.140430] secbulk:secbulk probing ...
[284.140482] Secbulk:bulk out endpoint found!

3.2 At this time can be used to download USB supervivi, Vivi on the steps please refer to the user manual, when the "USB host is Connected" appears. Waiting a download. " , use the DNW tool to write files to download on PC-side Linux
$sudo./dnw/path/to/what/you/want/download
# Use command writing here, no interface

Prompt success After write completion
100% xxxxxxx Bytes OK


$sudo insmod./secbulk.ko to load the module into the kernel
when the boot is not automatically loaded, so that each time to load before you can use, at this time to join the boot script,
Make it automatically loaded, edit/etc/init.d/rc.local at the end plus Insmod/location/secbulk.ko.


# when calling DNW, you can only use./DNW in the current directory, and in this case, add DNW to/usr/local/sbin so that you can
Any directory, using sudo dnw filename to invoke

(another) increase the download speed

The SECBULK.C in the
#define BULKOUT_BUFFER_SIZE 32
Switch
#define BULKOUT_BUFFER_SIZE 512
Can be found a lot faster.

"Reprint"--Using DNW for USB download under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.