[EMAIL PROTECTED] wrote:
> 
> I've written a small program to download firmware to a device (according
> to the USB DFU specs). This generates several timeouts on the control
> pipe, which kinda kills the firmware upgrade. I've tried several packet
> sizes (100, 500, 512, 1024, the interface descriptor says 1024 byte max),
> with the same result.
Your style is better than my hack, so I fixed yours instead. Looked like you
were using the firmware block without malloc'ing it first, so I added some
code for this too.
 
> Can anyone give me a hand with this? I've got to use DFU to load up the
> firmware in my Wireless USB adapter. I've included my little program
> for good measure. If you see anything that might be causing timeouts,
> please let me know.
Setting timeout parameter too short :) 100 is probably overkill, but time
isn't really critical with this sort of application, so crude and working
beats optimal and flakey.

> If anyone can shed some light on this, I'd appreciate it.
See attached. This produces the following:

[root@leon atmel-download]# ./dfu-new 
Start FW Downloading...
DFU IDLE
DOWNLOADING 1024 Bytes (Block = 0)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 1)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 2)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 3)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 4)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 5)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 6)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 7)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 8)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 9)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 10)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 11)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 12)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 13)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 14)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 15)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 16)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 17)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 18)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 19)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 1024 Bytes (Block = 20)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 504 Bytes (Block = 21)
STATE_DFU_DOWNLOAD_SYNC
DOWNLOAD DFU IDLE
DOWNLOADING 0 Bytes (Block = 22)
Write FW Block 22 failed (No error)!


I am trying to get back to working on the AT76C503A, since it seems we have a
few interested people.

Brad

dfu-new.c

Reply via email to