In Linux, do not use jlink to directly write | in Linux, dnw)

Source: Internet
Author: User

From http://shundacao.blog.163.com/blog/static/1340404812010102123259108/ (people are also transferred)


The method is:
1. Download the PC-side USB driver and write tool for dnw in Linux

Dnw_linux.zip ~
)

After the download, change the suffix to. tgz (it doesn't matter if you don't change it, just decompress it)


2. Compile the PC-side USB driver and write Tool
2.1 decompress
$ Tar xzvf/path/to/dnw_linux.tgz
Dnw_linux/
Dnw_linux/secbulk/
Dnw_linux/secbulk/makefile
Dnw_linux/secbulk. c
Dnw_linux/dnw/
Dnw_linux/dnw. c
Secbulk. C is a PC-side USB driver, and dnw. C is a write tool.

2.2 compile and load the secbulk. c kernel module
$ CD secbulk
$ Make-C/lib/modules/'uname-R'/build M = 'pwd' modules

After compilation, You can see secbulk. KO in the current directory.
Alex @ Alex-desktop :~ /Project3/qq2440/dnw_linux/secbulk $ ls
Makefile

Module. symvers Secbulk. c Secbulk. Ko Secbulk. Mod. c Secbulk. Mod. o Secbulk. o

Use the insmod command to load the module. This requires the root permission.
$ Sudo insmod./secbulk. Ko

After loading, run the dmesg command to check that the module has been successfully loaded.
[238.007970] secbulk: secbulk loaded
[238.009101] usbcore: registered new interface driver secbulk

2.3 compile the dnw Writing Tool
$ CD dnw
$ Gcc-O dnw. c
After compilation is successful, the executable file dnw is generated.

======================================
It is important to use dmesg to check whether the driver is successfully loaded. If this step is not completed, the system will prompt "can not open/dev/secbulk0"

3 download with dnw
3.1 start the Development Board, enter supervivi, and connect the Development Board and PC with a USB cable. Then, run the dmesg command 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, you can use supervivi for USB download. For more information about Vivi, see the user manual. waiting a download. ", write the file to be downloaded using the dnw tool on PC Linux
$ Sudo./dnw/path/to/what/you/want/download
# Use commands to write data here, with no interface

A success prompt is displayed after the write is complete.
100%Xxxxxxx bytesOK

$ Sudo insmod./secbulk. Ko loads modules into the kernel
It will not be automatically loaded when it is started, so that it can be used only after it is loaded every time. In this case, add it to the boot script,
Make it loaded automatically. edit/etc/init. d/rc. Local and add the insmod/path/secbulk. Ko at the end.

# When calling dnw, you can only use./dnw in the current directory. In this case, add dnw to/usr/local/sbin.
Any directory, use Sudo dnw filename to call.

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.