DFU USB - can't accept the nineth packet

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I am building a DFU Bootloader.

At this point I'm able to read and erase chip, and I have some problems with writing to the xmega.

 

When I look using usbmon:

ffff8803ddf3b3c0 507570310 S Co:3:118:0 s 21 01 000e 0000 0240 576 = 0100a200 a3ff0000 00000000 00000000 00000000 00000000 00000000 00000000

I see that it receives 576 bits = 64 (USB_PACKET_SIZE) * 9  = (Flip command + 8 packets for data)

but when I try to receive each packet in the request, I am able only to get the first 8.

 

The mechanism of receiving is:

after handeling the packet content, send ACK:

	LACR16(&usb_xmega_endpoints[0].out.STATUS, USB_EP_SETUP_bm | USB_EP_BUSNACK0_bm | USB_EP_TRNCOMPL0_bm | USB_EP_OVF_bm);
[LAC - Load And Clear]

and in the end to send ZLP:

	usb_ep_start_in(0x80, ep0_buf_in, 0, false);

as in the dfu document: http://www.atmel.com/Images/doc8457.pdf Page 7 Figure 6-3

 

The problem is that I get only 7 packets of data.

 

Any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found my mistake, small bug.

Hope to be able to explain how Atmel's DFU is working ...

Last Edited: Wed. Jan 13, 2016 - 09:25 AM