Linux Fedora14下利用DNW燒寫檔案

2021-05-24 12:12:47 字數 4999 閱讀 5963

買了一套友善的板子 micro2440

由於win下面的dnw不是很好用

於是便裝了fc14下面的dnw for linux ,很好用,也很方便

2 安裝

2.1 解壓

$tar xzvf dnw_linux.tar.gz

dnw_linux/

dnw_linux/secbulk/

dnw_linux/secbulk/makefile

dnw_linux/secbulk/secbulk.c

dnw_linux/dnw/

dnw_linux/dnw/dnw.c

其中secbulk.c是linux的usb驅動, dnw.c 是寫入工具的源**

2.2 驅動模組的編譯與載入

$cd secbulk

$make -c /lib/modules/`uname -r`/build m=`pwd` modules

如果編譯出錯,差東西,可能是沒有裝核心的東西

[ty@tiany dnw]$ ll

total 352

-rw-rw-r-- 1 ty ty 42 oct 25 2008 makefile

-rw-r--r-- 1 root root 55 mar 9 15:46 modules.order

-rw-r--r-- 1 root root 0 mar 9 15:46 module.symvers

-rw-rw-r-- 1 ty ty 4530 jan 6 2009 secbulk.c

-rw-r--r-- 1 root root 164268 mar 9 15:46 secbulk.ko

-rw-r--r-- 1 root root 497 mar 9 15:46 secbulk.mod.c

-rw-rw-r-- 1 root root 45328 mar 9 15:46 secbulk.mod.o

-rw-r--r-- 1 root root 120112 mar 9 15:46 secbulk.o

insmod 載入模組,注意 root 許可權

$sudo insmod secbulk.ko

成功載入後用 dmesg 命令檢視日誌, 通過grep過濾

[ty@tiany dnw]$ dmesg | grep secbulk

[ 1882.227272] secbulk:secbulk loaded

[ 1882.227305] usbcore: registered new inte***ce driver secbulk

2.3 編譯 dnw 工具

$cd dnw

$gcc -o dnw dnw.c

編譯成功後生成可執行dnw

3 使用

我是fc14系統,核心版本為

[ty@tiany dnw]$ uname -a

linux tiany.lab2202 2.6.35.6-45.fc14.i686 #1 smp mon oct 18 23:56:17 utc 2010 i686 i686 i386 gnu/linux

連上裝置,用dmesg可以看到usb鏈結的資訊

[ 1152.956029] usb 7-2: new full speed usb device using uhci_hcd and address 4

[ 1153.115268] usb 7-2: new usb device found, idvendor=5345, idproduct=1234

[ 1153.115271] usb 7-2: new usb device strings: mfr=1, product=2, serialnumber=0

[ 1153.115274] usb 7-2: product: sec s3c2410x test b/d

[ 1153.115275] usb 7-2: manufacturer: system mcu

[ 1824.500201] usb 7-2: usb disconnect, address 4

[ 1882.227272] secbulk:secbulk loaded

[ 1882.227305] usbcore: registered new inte***ce driver secbulk

[ 2061.736044] usb 7-2: new full speed usb device using uhci_hcd and address 5

[ 2061.897086] usb 7-2: new usb device found, idvendor=5345, idproduct=1234

[ 2061.897092] usb 7-2: new usb device strings: mfr=1, product=2, serialnumber=0

[ 2061.897097] usb 7-2: product: sec s3c2410x test b/d

[ 2061.897100] usb 7-2: manufacturer: system mcu

[ 2061.900170] secbulk:secbulk probing...

[ 2061.900174] secbulk:bulk out endpoint found!

[ty@tiany dnw]$ sudo ./dnw 2440test_n35.bin

[sudo] password for ty:

file name : 2440test_n35.bin

file size : 4033684 bytes

writing data...

100% 4033694 bytes ok

ok,安裝測試完畢,使用很方便

筆記發現乙個奇怪的問題,我用的mirco2440sdk這塊板子,

更換核心板後,dnw老是用不起,不知道為什麼

secbulk.ko

可以載入成功,但是連線上usb後 dmesg檢視訊息 輸出以下錯誤

611.547551] usbcore: registered new inte***ce driver secbulk

[  637.539046] usb 7-1: new full speed usb device using uhci_hcd and address 10

[  637.653055] usb 7-1: device descriptor read/64, error -71

[  637.868175] usb 7-1: device descriptor read/64, error -71

[  638.071186] usb 7-1: new full speed usb device using uhci_hcd and address 11

[  638.185052] usb 7-1: device descriptor read/64, error -71

[  638.399067] usb 7-1: device descriptor read/64, error -71

[  638.602053] usb 7-1: new full speed usb device using uhci_hcd and address 12

[  639.011046] usb 7-1: device not accepting address 12, error -71

[  639.164052] usb 7-1: new full speed usb device using uhci_hcd and address 13

[  639.573154] usb 7-1: device not accepting address 13, error -71

[  639.573180] hub 7-0:1.0: unable to enumerate usb device on port 1

不知道為什麼

然後我換回之前除錯的核心板

又可以使用了

[  756.766161] usb 7-1: new full speed usb device using uhci_hcd and address 14

[  756.926082] usb 7-1: new usb device found, idvendor=5345, idproduct=1234

[  756.926089] usb 7-1: new usb device strings: mfr=1, product=2, serialnumber=0

[  756.926093] usb 7-1: product: sec s3c2410x test b/d

[  756.926097] usb 7-1: manufacturer: system mcu

[  756.929177] secbulk:secbulk probing...

[  756.929181] secbulk:bulk out endpoint found!

[  848.500086] usb 7-1: usb disconnect, address 14

[  848.500157] secbulk:secbulk disconnected!

[  849.456052] usb 7-1: new full speed usb device using uhci_hcd and address 15

[  849.615259] usb 7-1: new usb device found, idvendor=5345, idproduct=1234

[  849.615265] usb 7-1: new usb device strings: mfr=1, product=2, serialnumber=0

[  849.615270] usb 7-1: product: sec s3c2410x test b/d

[  849.615273] usb 7-1: manufacturer: system mcu

[  849.618335] secbulk:secbulk probing...

[  849.618339] secbulk:bulk out endpoint found!

真實奇怪

linux fedora 15 下常用軟體安裝

1.gvim yum search vim yum install vim x11.i686 2.五筆輸入法 yum search wubi 然後選擇乙個yum install 5.eclipse yum search eclipse yum install eclipse platform.i68...

嘔吐 噦 下利病

一 嘔吐 一 成因與脈證 1 飲邪致嘔 2 2 誤治致嘔 3 3 胃反病機與脈證 4 5 主症 朝食暮吐,暮食朝吐,宿谷不化,名曰胃反 病機 脾胃虛寒,氣血不足,不能腐熟水谷,胃氣上 逆 寸口脈微而數,微則無氣 營虛 血不足 胸中冷 4 二 治則與禁忌 1 6 嘔家有癰膿,不可治嘔,膿盡自癒。病人欲...

14 高階物件導向(下)

注 部落格中內容主要來自 狄泰軟體學院 部落格僅當私人筆記使用。測試環境 ubuntu 10.10 gcc版本 4.4.5 一 物件導向基本概念 1 類之間的基本關係 繼承 從已存在類 細分出來的類 子類 和原類 父類 之間具有繼承關係 is a 繼承的類 子類 擁有原類 父類 的所有屬性和行為 個...