[avrdude-dev] [bug #29913] 246 Byte Bug - AVRdude crashes

2010-06-03 Thread Andreas Schweigstill

Follow-up Comment #5, bug #29913 (project avrdude):

Perhaps we should file another bug report for not mentioning the
prerequisites regarding kernel/libusb in the AVRDUDE documentation?

Even if there is no clean solution this would help some people when they hit
this problem. It took my about two days of working power to find an
explanation; it was very important for me to figure it out because I am using
an AVRISP mkII with AVRDUDE in a production test system. Of course changing
just the file size could have solved/obfuscated the problem but I had to be
sure that the in-circuit tester works reliable.




___

Reply to this item at:

  http://savannah.nongnu.org/bugs/?29913

___
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/


___
avrdude-dev mailing list
avrdude-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avrdude-dev


Re: [avrdude-dev] [bug #29913] 246 Byte Bug - AVRdude crashes

2010-06-02 Thread Andreas Schweigstill

Hello,

I also experienced such problems and found the reason for such file
size depending behaviour. A description of what I have found out can
be read here (in German language):

http://www.mikrocontroller.net/topic/96528

The problem is related to improper handling of USB zero-length packets
(ZLP) which was introduced by the libusb 0.1 API wrapper for libusb 1.0.

Some workarounds:
- use a very old Linux system which doesn't support libusb 1.0
- use a very new Linux kernel =2.6.31 AND libusb = 1.0.3

This ZLP problem affects also many other projects which use USB bulk
communication over libusb:

http://www.libusb.org/ticket/6

With best regards
Andreas Schweigstill



Am 31.05.2010 14:37, schrieb Tobias Neumann:


Follow-up Comment #2, bug #29913 (project avrdude):

I attached a tar file of all the contents you need to see the bug. I
tested it and it still crashes.

The program isnt doing anything usefull, it is just to demonstrade the
crash. If you add or delete anything from the programm it will be burned
on the µC without any problems.

Greetings,
Tobias Neumann.

$ avrdude -v -c avrispmkII -P usb -p m16

avrdude: usbdev_open(): Found AVRISP mkII, serno: B0018759
  AVR Part  : ATMEGA16
  Chip Erase delay  : 9000 us
  PAGEL : PD7
  BS2   : PA0
  RESET disposition : dedicated
  RETRY pulse   : SCK
  serial program mode   : yes
  parallel program mode : yes
  Timeout   : 200
  StabDelay : 100
  CmdexeDelay   : 25
  SyncLoops : 32
  ByteDelay : 0
  PollIndex : 3
  PollValue : 0x53
  Memory Detail :

   Block Poll
Page   Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages
MinW  MaxW   ReadBack
---  - -  -- --  --
- - -
eeprom 410   1280 no5124  0
9000  9000 0xff 0xff
flash 33 6   1280 yes 16384  128128
4500  4500 0xff 0xff
lock   0 0 00 no  10  0
9000  9000 0x00 0x00
lfuse  0 0 00 no  10  0
9000  9000 0x00 0x00
hfuse  0 0 00 no  10  0
9000  9000 0x00 0x00
signature  0 0 00 no  30
0 0 0 0x00 0x00
calibration0 0 00 no  40
0 0 0 0x00 0x00

  Programmer Type : STK500V2
  Description : Atmel AVR ISP mkII
  Programmer Model: AVRISP mkII
  Hardware Version: 1
  Firmware Version Master : 1.13
  Vtarget : 5.0 V
  SCK period  : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ## | 100% 0.01s

avrdude: Device signature = 0x1e9403
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as 99

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as 99
avrdude: safemode: Fuses OK

avrdude done.  Thank you.





(file #20663)
 ___

Additional Item Attachment:

File name: 246_byte_crash.tgz Size:1 KB


 ___

Reply to this item at:

   http://savannah.nongnu.org/bugs/?29913

___
   Nachricht geschickt von/durch Savannah
   http://savannah.nongnu.org/


___
avrdude-dev mailing list
avrdude-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avrdude-dev


--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

___
avrdude-dev mailing list
avrdude-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avrdude-dev


[avrdude-dev] [bug #29913] 246 Byte Bug - AVRdude crashes

2010-06-02 Thread Joerg Wunsch

Update of bug #29913 (project avrdude):

  Status:   Need Info = Invalid
 Open/Closed:Open = Closed 

___

Follow-up Comment #4:

Thanks for the analysis, Andreas.  That explains why I could
never see it myself (FreeBSD using either original libusb
0.1.x, or FreeBSD 8 which provides a libusb 0.1 API wrapper
to its own libusb which is different from libusb 1.x).

Unfortunately, I don't think there's anything that can be
done about it on the AVRDUDE side.  If someone has a
suggestion for a workaround that doesn't break anything else,
I'm willing to commit it.

___

Reply to this item at:

  http://savannah.nongnu.org/bugs/?29913

___
  Message sent via/by Savannah
  http://savannah.nongnu.org/


___
avrdude-dev mailing list
avrdude-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avrdude-dev