dioannidis / usbasp

usbasp improved firmware
GNU General Public License v2.0
73 stars 11 forks source link

usbasp v1.11 atmega8 not working under Linux #32

Closed storepeter closed 2 weeks ago

storepeter commented 7 months ago

using: Ubuntu-22.04, with avrdude 6.3-20171130

Flashed one usbasp (atmega8) with another usbasp (v1.02), this went fine, When I plug this new usbasp-1.11 into an USB port I get this:


lsusb -d 16c0:05dc -v

Bus 001 Device 066: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.01
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x16c0 Van Ooijen Technische Informatica
  idProduct          0x05dc shared ID for use with libusb
  bcdDevice            1.11
  iManufacturer           1 www.fischl.de
  iProduct                2 USBasp
  iSerial                 3 0000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0012
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              2 USBasp
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0021
  bNumDeviceCaps          1
  Platform Device Capability:
    bLength                28
    bDescriptorType        16
    bDevCapabilityType      5
    bReserved               0
    PlatformCapabilityUUID    {d8dd60df-4589-4cc7-9cd2-659d9e648a9f}
    CapabilityData[0]    0x00
    CapabilityData[1]    0x00
    CapabilityData[2]    0x03
    CapabilityData[3]    0x06
    CapabilityData[4]    0x9e
    CapabilityData[5]    0x00
    CapabilityData[6]    0x5d
    CapabilityData[7]    0x00
Device Status:     0x0000
  (Bus Powered)

so the USB side seems to work.

Now using the newly flashed usbasp (v1.11) to flash the other (v1.02) I get

make flash
avrdude -c usbasp -p atmega8 -P usb -U flash:w:main.hex:i -U eeprom:w:main.eep.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9307 (probably m8)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: writing flash (3940 bytes):

Writing |                                                    | 0% 0.00savrdude: error: usbasp_transmit: error sending control message: Value too large for defined data type
avrdude: error: wrong count at writing ffffffff
Writing | ################################################## | 100% 3.44s

avrdude: 3940 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex contains 3940 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.22s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x9b
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK (E:FF, H:D9, L:9F)

avrdude done.  Thank you.

make: *** [Makefile:97: flash] Error 

UPS - now I have two dysfunctional usbasp devices ;-(

The output of make without arguments is:


 make
Usage: make                same as make help
       make help           same as make
       make main.hex       create main.hex
       make clean          remove redundant data
       make disasm         disasm main
       make flash          upload main.hex into flash
       make fuses          program fuses
       make avrdude        test avrdude
Current values:
       TARGET=atmega8
       LFUSE=0xDF
       HFUSE=0xC9
       CLOCK=12000000
       TPI=Off
       HIDUART=Off
       ISP=usbasp
       PORT=usb

So I checkout v1.08 (commit 8f4beb08c61112a071f5b445cdffcdafbe25eccf by Nerd Ralph - Mar 24 2021) This works as expected, and fixes my initial problem which was reading atmega2560 with an usbasp.

If you discover what was wrong I would be happy to give it a try.

Best Regards StorePeter

dioannidis commented 7 months ago

Hi @storepeter,

please try the 1.11 Release ( source or bin ).

The master is broken at the moment, as I didn't find the time to finish refactoring for conditional compilation reg. HIDUART, TPI, etc .

PS: Sorry for the late reply . I'll try to finish it this weekend .

regards,