Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - WalrusDickenson

1
AVRDude / Re: avrdude: initialization failed, rc=-2
I've tried again with avrdude-6.1. Still not working:

Code: [Select]
$ avrdude  -c buspirate -P /dev/ttyUSB0 -p t13 -v -v

avrdude: Version 6.1, compiled on Jan 22 2015 at 01:13:43
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2014 Joerg Wunsch

        System wide configuration file is "/etc/avrdude.conf"
        User configuration file is "/home/dzhus/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/ttyUSB0
        Using Programmer              : buspirate
        AVR Part                      : ATtiny13
        Chip Erase delay              : 4000 us
        PAGEL                        : P00
        BS2                          : P00
        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        65    5    4    0 no        64    4      0  4000  4000 0xff 0xff
          flash        65    6    32    0 yes      1024  32    32  4500  4500 0xff 0xff
          signature      0    0    0    0 no          3    0      0    0    0 0x00 0x00
          lock          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0    0    0    0 no          2    0      0    0    0 0x00 0x00
          lfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00

        Programmer Type : BusPirate
        Description    : The Bus Pirate

Attempting to initiate BusPirate binary mode...
avrdude: buspirate_send_bin():
0x0a 0x0a
avrdude: buspirate_send_bin():
0x00 0x00 0x00 0x00  0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00  0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 
avrdude: buspirate_recv_bin():
0x42 0x42 0x49 0x4f  0x31
BusPirate binmode version: 1
avrdude: buspirate_send_bin():
0x01
avrdude: buspirate_recv_bin():
0x53 0x50 0x49 0x31 
BusPirate SPI version: 1
avrdude: buspirate_send_bin():
0x05 0x00 0x00 0x00  0x00
avrdude: buspirate_recv_bin():
0x01
avrdude: Paged flash write enabled.
avrdude: buspirate_send_bin():
0x49
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x60
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x8a
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x06
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x01
avrdude: buspirate_recv_bin():
0x01 0x00 0x01
AVR Extended Commands version 1
avrdude: buspirate_send_bin():
0x48
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x13
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0xac 0x53 0x00 0x00 
avrdude: buspirate_recv_bin():
0x00 0x00 0x00 0x00 
avrdude: initialization failed, rc=-2
        Double check connections and try again, or use -F to override
        this check.

avrdude: buspirate_send_bin():
0x40
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x00
avrdude: buspirate_send_bin():
0x0f
avrdude: buspirate_recv_bin():
0x42 0x42 0x49 0x4f  0x31 0x01 0x0d 0x0a
0x42
avrdude: buspirate_recv_bin():
0x75 0x73 0x20 0x50  0x69 0x72 0x61 0x74
0x65
avrdude: buspirate_recv_bin():
0x20 0x76 0x33 0x2e  0x62 0x20 0x63 0x6c
0x6f
avrdude: buspirate_recv_bin():
0x6e 0x65 0x20 0x77  0x2f 0x64 0x69 0x66
0x66
avrdude: buspirate_recv_bin():
0x65 0x72 0x65 0x6e  0x74 0x20 0x50 0x49
0x43
avrdude: buspirate_recv_bin():
0x0d 0x0a 0x46 0x69  0x72 0x6d 0x77 0x61
0x72
avrdude: buspirate_recv_bin():
0x65 0x20 0x76 0x36  0x2e 0x33 0x2d 0x62
0x65
avrdude: buspirate_recv_bin():
0x74 0x61 0x31 0x20  0x72 0x32 0x30 0x38
0x38
avrdude: buspirate_recv_bin():
0x20 0x20 0x42 0x6f  0x6f 0x74 0x6c 0x6f
0x61
avrdude: buspirate_recv_bin():
0x64 0x65 0x72 0x20  0x76 0x34 0x2e 0x34
0x0d
avrdude: buspirate_recv_bin():
0x0a 0x44 0x45 0x56  0x49 0x44 0x3a 0x30
0x78
avrdude: buspirate_recv_bin():
0x30 0x34 0x34 0x46  0x20 0x52 0x45 0x56
0x49
avrdude: buspirate_recv_bin():
0x44 0x3a 0x30 0x78  0x33 0x30 0x30 0x33
0x20
avrdude: buspirate_recv_bin():
0x28 0x32 0x34 0x46  0x4a 0x36 0x34 0x47
0x41
avrdude: buspirate_recv_bin():
0x30 0x30 0x34 0x20  0x41 0x33 0x29 0x0d
0x0a
avrdude: buspirate_recv_bin():
0x68 0x74 0x74 0x70  0x3a 0x2f 0x2f 0x64
0x61
avrdude: buspirate_recv_bin():
0x6e 0x67 0x65 0x72  0x6f 0x75 0x73 0x70
0x72
avrdude: buspirate_recv_bin():
0x6f 0x74 0x6f 0x74  0x79 0x70 0x65 0x73
0x2e
avrdude: buspirate_recv_bin():
0x63 0x6f 0x6d 0x0d  0x0a 0x48 0x69 0x5a
0x3e
BusPirate is back in the text mode

avrdude done.  Thank you.
3
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
I've installed v6.3-beta1 r2088 firmware (from viewtopic.php?t=5052) on my BP.

It's all the same:

Code: [Select]
$ ./avrdude -C avrdude.conf -c buspirate -P /dev/ttyUSB0 -p t2313 -v -v

avrdude: Version 5.11svn, compiled on Apr  7 2013 at 03:02:38
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "avrdude.conf"
        User configuration file is "/home/dzhus/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/ttyUSB0
        Using Programmer              : buspirate
        AVR Part                      : ATtiny2313
        Chip Erase delay              : 9000 us
        PAGEL                        : PD4
        BS2                          : PD6
        RESET disposition            : possible i/o
        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        65    6    4    0 no        128    4      0  4000  4500 0xff 0xff
          flash        65    6    32    0 yes      2048  32    64  4500  4500 0xff 0xff
          signature      0    0    0    0 no          3    0      0    0    0 0x00 0x00
          lock          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          lfuse          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          hfuse          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          efuse          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          calibration    0    0    0    0 no          2    0      0    0    0 0x00 0x00

        Programmer Type : BusPirate
        Description    : The Bus Pirate

Attempting to initiate BusPirate binary mode...
avrdude: buspirate_send_bin():
0x0a 0x0a
avrdude: buspirate_send_bin():
0x00 0x00 0x00 0x00  0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00  0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 
avrdude: buspirate_recv_bin():
0x42 0x42 0x49 0x4f  0x31
BusPirate binmode version: 1
avrdude: buspirate_send_bin():
0x01
avrdude: buspirate_recv_bin():
0x53 0x50 0x49 0x31 
BusPirate SPI version: 1
avrdude: buspirate_send_bin():
0x05 0x00 0x00 0x00  0x00
avrdude: buspirate_recv_bin():
0x01
avrdude: Paged flash write enabled.
avrdude: buspirate_send_bin():
0x49
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x60
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x8a
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x06
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x01
avrdude: buspirate_recv_bin():
0x01 0x00 0x01
AVR Extended Commands version 1
avrdude: buspirate_send_bin():
0x48
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x13
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0xac 0x53 0x00 0x00 
avrdude: buspirate_recv_bin():
0x00 0x00 0x00 0x00 
avrdude: initialization failed, rc=-2
        Double check connections and try again, or use -F to override
        this check.

avrdude: buspirate_send_bin():
0x40
avrdude: buspirate_recv_bin():
0x01
avrdude: buspirate_send_bin():
0x00
avrdude: buspirate_send_bin():
0x0f
avrdude: buspirate_recv_bin():
0x42 0x42 0x49 0x4f  0x31 0x01 0x0d 0x0a
0x42
avrdude: buspirate_recv_bin():
0x75 0x73 0x20 0x50  0x69 0x72 0x61 0x74
0x65
avrdude: buspirate_recv_bin():
0x20 0x76 0x33 0x2e  0x62 0x20 0x63 0x6c
0x6f
avrdude: buspirate_recv_bin():
0x6e 0x65 0x20 0x77  0x2f 0x64 0x69 0x66
0x66
avrdude: buspirate_recv_bin():
0x65 0x72 0x65 0x6e  0x74 0x20 0x50 0x49
0x43
avrdude: buspirate_recv_bin():
0x0d 0x0a 0x46 0x69  0x72 0x6d 0x77 0x61
0x72
avrdude: buspirate_recv_bin():
0x65 0x20 0x76 0x36  0x2e 0x33 0x2d 0x62
0x65
avrdude: buspirate_recv_bin():
0x74 0x61 0x31 0x20  0x72 0x32 0x30 0x38
0x38
avrdude: buspirate_recv_bin():
0x20 0x20 0x42 0x6f  0x6f 0x74 0x6c 0x6f
0x61
avrdude: buspirate_recv_bin():
0x64 0x65 0x72 0x20  0x76 0x34 0x2e 0x34
0x0d
avrdude: buspirate_recv_bin():
0x0a 0x44 0x45 0x56  0x49 0x44 0x3a 0x30
0x78
avrdude: buspirate_recv_bin():
0x30 0x34 0x34 0x46  0x20 0x52 0x45 0x56
0x49
avrdude: buspirate_recv_bin():
0x44 0x3a 0x30 0x78  0x33 0x30 0x30 0x33
0x20
avrdude: buspirate_recv_bin():
0x28 0x32 0x34 0x46  0x4a 0x36 0x34 0x47
0x41
avrdude: buspirate_recv_bin():
0x30 0x30 0x34 0x20  0x41 0x33 0x29 0x0d
0x0a
avrdude: buspirate_recv_bin():
0x68 0x74 0x74 0x70  0x3a 0x2f 0x2f 0x64
0x61
avrdude: buspirate_recv_bin():
0x6e 0x67 0x65 0x72  0x6f 0x75 0x73 0x70
0x72
avrdude: buspirate_recv_bin():
0x6f 0x74 0x6f 0x74  0x79 0x70 0x65 0x73
0x2e
avrdude: buspirate_recv_bin():
0x63 0x6f 0x6d 0x0d  0x0a 0x48 0x69 0x5a
0x3e
BusPirate is back in the text mode

avrdude done.  Thank you.

No luck in ASCII mode either:
Code: [Select]
$ ./avrdude -C avrdude.conf -c buspirate -P /dev/ttyUSB0 -p t2313 -x ascii -B 32 -v -v

avrdude: Version 5.11svn, compiled on Apr  7 2013 at 03:02:38
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "avrdude.conf"
        User configuration file is "/home/dzhus/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/ttyUSB0
        Using Programmer              : buspirate
        Setting bit clk period        : 32.0
        AVR Part                      : ATtiny2313
        Chip Erase delay              : 9000 us
        PAGEL                        : PD4
        BS2                          : PD6
        RESET disposition            : possible i/o
        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        65    6    4    0 no        128    4      0  4000  4500 0xff 0xff
          flash        65    6    32    0 yes      2048  32    64  4500  4500 0xff 0xff
          signature      0    0    0    0 no          3    0      0    0    0 0x00 0x00
          lock          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          lfuse          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          hfuse          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          efuse          0    0    0    0 no          1    0      0  9000  9000 0x00 0x00
          calibration    0    0    0    0 no          2    0      0    0    0 0x00 0x00

        Programmer Type : BusPirate
        Description    : The Bus Pirate

Attempting to initiate BusPirate ASCII mode...
avrdude: buspirate_send_bin():
0x23 0x0a
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RE
avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC
avrdude: buspirate_readline(): Firmware v6.3-beta1 r2088  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
avrdude: buspirate_readline(): http://dangerousprototypes.com
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): HiZ>
**
BusPirate: using ASCII mode
avrdude: buspirate_send(): m
avrdude: buspirate_readline(): m
avrdude: buspirate_readline(): 1. HiZ
avrdude: buspirate_readline(): 2. 1-WIRE
avrdude: buspirate_readline(): 3. UART
avrdude: buspirate_readline(): 4. I2C
avrdude: buspirate_readline(): 5. SPI
avrdude: buspirate_readline(): 6. 2WIRE
avrdude: buspirate_readline(): 7. 3WIRE
avrdude: buspirate_readline(): 8. LCD
avrdude: buspirate_readline(): x. exit(without change)
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (1)>
avrdude: buspirate_send(): 5
avrdude: buspirate_readline(): 5
avrdude: buspirate_readline(): Set speed:
avrdude: buspirate_readline():  1. 30KHz
avrdude: buspirate_readline():  2. 125KHz
avrdude: buspirate_readline():  3. 250KHz
avrdude: buspirate_readline():  4. 1MHz
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (1)>
avrdude: buspirate_send():
avrdude: buspirate_readline():
avrdude: buspirate_readline(): Clock polarity:
avrdude: buspirate_readline():  1. Idle low *default
avrdude: buspirate_readline():  2. Idle high
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (1)>
avrdude: buspirate_send():
avrdude: buspirate_readline():
avrdude: buspirate_readline(): Output clock edge:
avrdude: buspirate_readline():  1. Idle to active
avrdude: buspirate_readline():  2. Active to idle *default
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (2)>
avrdude: buspirate_send():
avrdude: buspirate_readline():
avrdude: buspirate_readline(): Input sample phase:
avrdude: buspirate_readline():  1. Middle *default
avrdude: buspirate_readline():  2. End
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (1)>
avrdude: buspirate_send():
avrdude: buspirate_readline():
avrdude: buspirate_readline(): CS:
avrdude: buspirate_readline():  1. CS
avrdude: buspirate_readline():  2. /CS *default
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (2)>
avrdude: buspirate_send():
avrdude: buspirate_readline():
avrdude: buspirate_readline(): Select output type:
avrdude: buspirate_readline():  1. Open drain (H=Hi-Z, L=GND)
avrdude: buspirate_readline():  2. Normal (H=3.3V, L=GND)
avrdude: buspirate_readline():
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): (1)>
avrdude: buspirate_send(): 2
avrdude: buspirate_readline(): 2
avrdude: buspirate_readline(): Clutch disengaged!!!
avrdude: buspirate_readline(): To finish setup, start up the power supplies with command 'W'
avrdude: buspirate_readline():
avrdude: buspirate_readline(): Ready
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): SPI>
BusPirate is now configured for SPI
avrdude: buspirate_send(): W
avrdude: buspirate_readline(): W
avrdude: buspirate_readline(): POWER SUPPLIES ON
avrdude: buspirate_readline(): Clutch engaged!!!
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): SPI>
avrdude: warning: did not get a response to PowerUp command.
avrdude: warning: Trying to continue anyway...
avrdude: buspirate_send(): {
avrdude: buspirate_readline(): {
avrdude: buspirate_readline(): /CS ENABLED
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): SPI>
avrdude: buspirate_send(): 0xac 0x53 0x00 0x00
avrdude: buspirate_readline(): 0xac 0x53 0x00 0x00
avrdude: buspirate_readline(): WRITE: 0xAC READ: 0x00
avrdude: buspirate_readline(): WRITE: 0x53 READ: 0x00
avrdude: buspirate_readline(): WRITE: 0x00 READ: 0x00
avrdude: buspirate_readline(): WRITE: 0x00 READ: 0x00
avrdude: initialization failed, rc=-2
        Double check connections and try again, or use -F to override
        this check.

avrdude: buspirate_send(): w
avrdude: buspirate_readline(): w
avrdude: buspirate_readline(): Clutch disengaged!!!
avrdude: buspirate_readline(): POWER SUPPLIES OFF
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): SPI>
avrdude: warning: did not get a response to PowerDown command.
avrdude: buspirate_send(): #
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RE
avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC
avrdude: buspirate_readline(): Firmware v6.3-beta1 r2088  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
avrdude: buspirate_readline(): http://dangerousprototypes.com
avrdude: ser_recv(): programmer is not responding
avrdude: buspirate_readline(): HiZ>

avrdude done.  Thank you.
5
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
I've rechecked my AVR chips using my Arduino acting as a
STK500v1-compatible programmer and they all respond just fine,
producing expected device signatures. I hear clicking noise on SPI
lines when using BusPirate (I use a piezo buzzer as a poor man's
oscilloscope), though the pattern differs from that when using Arduino
as an ISP.

I noticed this in the avrdude manpage:

Quote
It may be a good idea to decouple the BusPirate and the AVR's SPI
buses from each other using a 3-state bus buffer. For example 74HC125
or 74HC244 are some good candidates with the latches driven by the
appropriate reset pin (cs, aux or aux2). Otherwise the SPI traffic in
one active circuit may interfere with programming the AVR in the other
design.

What is this all about and what other traffic appear on SPI line when
I simply connect my BP to a bare AVR chip?

I also tried falling back to ascii mode of BP, it fails as well:
Code: [Select]
Detecting BusPirate...
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RE
avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC
avrdude: buspirate_readline(): Firmware v6.1 r1676  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
avrdude: buspirate_readline(): http://dangerousprototypes.com
avrdude: buspirate_readline(): HiZ>
**
avrdude: buspirate_send(): W
avrdude: buspirate_readline(): W
avrdude: buspirate_readline(): Command not used in this mode
avrdude: buspirate_readline(): HiZ>
avrdude: warning: did not get a response to PowerUp command.
avrdude: warning: Trying to continue anyway...
avrdude: buspirate_send(): {
avrdude: buspirate_readline(): {
avrdude: buspirate_readline(): ERROR: command has no effect here
avrdude: buspirate_readline(): Syntax error at char 1
avrdude: buspirate_readline(): HiZ>
avrdude: buspirate_send(): 0xac 0x53 0x00 0x00
avrdude: buspirate_readline(): 0xac 0x53 0x00 0x00
avrdude: buspirate_readline(): WRITE: 0xACERROR: command has no effect here
avrdude: buspirate_readline(): 
avrdude: buspirate_readline(): Syntax error at char 4
avrdude: buspirate_readline(): HiZ>
avrdude: error: SPI has not read 4 bytes back
avrdude: initialization failed, rc=-2
        Double check connections and try again, or use -F to override
        this check.

avrdude: buspirate_send(): w
avrdude: buspirate_readline(): w
avrdude: buspirate_readline(): Command not used in this mode
avrdude: buspirate_readline(): HiZ>
avrdude: warning: did not get a response to PowerDown command.
avrdude: buspirate_send(): #
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RE
avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC
avrdude: buspirate_readline(): Firmware v6.1 r1676  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
avrdude: buspirate_readline(): http://dangerousprototypes.com
avrdude: buspirate_readline(): HiZ>

avrdude done.  Thank you.

But I suspect it's just avrdude not switching BusPirate to SPI mode
properly.

The whole problem persists with avrdude built from current SVN trunk (r1139) too.
6
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
I'm already using v6.1 firmware for Bus Pirate.

It doesn't work even if I apply power to the chip from external source instead of BP.

I tried switching to STK500 firmware (BPv3-STK500v2-v0b.hex).
Using it gives unstable results:
Code: [Select]
$ avrdude -B 32 -c stk500 -P /dev/ttyUSB0 -p t13 -v

avrdude: Version 5.11.1, compiled on Jul  1 2012 at 15:16:59
        Using Port                    : /dev/ttyUSB0
        Using Programmer              : stk500
        Setting bit clk period        : 32.0
        AVR Part                      : ATtiny13
        Chip Erase delay              : 4000 us
        PAGEL                        : P00
        BS2                          : P00
        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        65    5    4    0 no        64    4      0  4000  4000 0xff 0xff
          flash        65    6    32    0 yes      1024  32    32  4500  4500 0xff 0xff
          signature      0    0    0    0 no          3    0      0    0    0 0x00 0x00
          lock          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0    0    0    0 no          2    0      0    0    0 0x00 0x00
          lfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00

        Programmer Type : STK500V2
        Description    : Atmel STK500
        Programmer Model: AVRISP
        Hardware Version: 2
        Firmware Version Master : 2.10
        Vtarget        : 5.0 V
        SCK period      : 108.6 us

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.09s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
        Double check connections and try again, or use -F to override
        this check.


avrdude done.  Thank you.

and sometimes (4 times out of 5) it fails with yet another error:

Code: [Select]
         Programmer Type : STK500V2
        Description    : Atmel STK500
        Programmer Model: AVRISP
        Hardware Version: 2
        Firmware Version Master : 2.10
        Vtarget        : 5.0 V
        SCK period      : 199.7 us

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.


avrdude done.  Thank you.
I tried with various values of -B but it never reads device signature properly. Same when using BP firmware.

Since MISO/MOSI and CS pins are confirmed to work on my BP,
it's either SCK pin or my wires being just too long.
7
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
This is because using avrdude is no success either
Code: [Select]
$ avrdude -F -c buspirate -P /dev/ttyUSB0 -p t13 -v

avrdude: Version 5.11.1, compiled on Jul  1 2012 at 15:16:59
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "/etc/avrdude.conf"
        User configuration file is "/home/dzhus/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/ttyUSB0
        Using Programmer              : buspirate
        AVR Part                      : ATtiny13
        Chip Erase delay              : 4000 us
        PAGEL                        : P00
        BS2                          : P00
        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        65    5    4    0 no        64    4      0  4000  4000 0xff 0xff
          flash        65    6    32    0 yes      1024  32    32  4500  4500 0xff 0xff
          signature      0    0    0    0 no          3    0      0    0    0 0x00 0x00
          lock          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0    0    0    0 no          2    0      0    0    0 0x00 0x00
          lfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00

        Programmer Type : BusPirate
        Description    : The Bus Pirate

Detecting BusPirate...
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RE
avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC
avrdude: buspirate_readline(): Firmware v6.1 r1676  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
avrdude: buspirate_readline(): http://dangerousprototypes.com
avrdude: buspirate_readline(): HiZ>
**
BusPirate: using BINARY mode
BusPirate binmode version: 1
BusPirate SPI version: 1
avrdude: initialization failed, rc=-2
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATtiny13 is 1E 90 07
BusPirate is back in the text mode

avrdude done.  Thank you.
I tried this with ATtiny13A, ATtiney 2313 and several ATmega 328P's.
Still I can burn these chips using ArduinoISP programmer, so it looks like the problem is really with connections.
8
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
I'm trying to find out if my circuit is correct.
Datasheets on AVR chips I have (ATmega 328P, ATtiny 2313 and 13A) all describe similar procedure for serial programming:

Quote
1. Power-up sequence:
Apply power between VCC and GND while RESET and SCK are set to “0”. In some sys-
tems, the programmer can not guarantee that SCK is held low during power-up. In this
case, RESET must be given a positive pulse after SCK has been set to “0”. The pulse
duration must be at least tRST (miniumum pulse widht of RESET pin, see Table 18-4 on
page 120 and Figure 19-58 on page 153) plus two CPU clock cycles.

2. Wait for at least 20 ms and enable serial programming by sending the Programming
Enable serial instruction to pin MOSI.

3. The serial programming instructions will not work if the communication is out of syn-
chronization. When in sync. the second byte (0x53), will echo back when issuing the
third byte of the Programming Enable instruction. Whether the echo is correct or not, all
four bytes of the instruction must be transmitted. If the 0x53 did not echo back, give
RESET a positive pulse and issue a new Programming Enable command.
So I switch to SPI mode, power the chip with 'W', enable pull-ups on SPI lines 'P',
then issue a reset pulse by pulling reset pin up with 'A' and then low with 'a' (AUX pin of BP is connected to RESET).
Now I try to send the byte enable command and see if it echoes back:
Code: [Select]
SPI>v
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND    3.3V    5.0V    ADC    VPU    AUX    CLK    MOSI    CS      MISO
P      P      P      I      I      I      O      O      O      I     
GND    3.26V  5.02V  0.00V  5.02V  H      L      L      H      H     
SPI>A
AUX HIGH
SPI>a
AUX LOW
SPI>0xAC 0x53 r 0x0
WRITE: 0xAC
WRITE: 0x53
READ: 0xFF
WRITE: 0x00
SPI>
I take it as no success. It always reads back 0xFF instead of 0x53. What could possibly go wrong?
9
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
Yes, it works as expected in Transparent bridge mode. When RX/TX are disconnected, nothing appears on the console but random garbage; shorting the pins makes it echo typed characters back.
10
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
[quote author="Sjaak"]You could use the uart mode and connect mosi and miso together. It should echo everything you send.
[/quote]
I tried connecting mosi and miso, leaving other wires unconnected, switched to UART mode in BP console, but after I send any string it reads rubbish:
Code: [Select]
Bus Pirate v3.b clone w/different PIC
Firmware v6.1 r1676  Bootloader v4.4
DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3)
http://dangerousprototypes.com
HiZ>m3
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value

(1)>
Data bits and parity:
 1. 8, NONE *default
 2. 8, EVEN
 3. 8, ODD
 4. 9, NONE
(1)>
Stop bits:
 1. 1 *default
 2. 2
(1)>
Receive polarity:
 1. Idle 1 *default
 2. Idle 0
(1)>
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>
Ready
UART>0xDE 0xAD 0XBE 0xEF rrrr
WRITE: 0xDE
WRITE: 0xAD
WRITE: 0xBE
WRITE: 0xEF
READ: -f 0x38
READ: 0x3C
READ: -f 0x18
READ: 0x3C
UART>0xDEr
WRITE: 0xDE
READ: -f 0x0C
UART>0xDEADBEEF
WRITE: 0xEF
UART>0xDE 0xAD 0xBE 0xEF rrrr
WRITE: 0xDE
WRITE: 0xAD
WRITE: 0xBE
WRITE: 0xEF
READ: -f 0x00
READ: -f 0xE2
READ: -f 0x40
READ: -f 0x3C

Quote
You are sure you are using the correct pinout? There are two cables, one is backwards regarding the pinout printed by the terminal
My manufacturer says that cables match.
12
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
I'm not sure how self-test works without actually querying any SPI device but it gives OK result on all SPI lines:
Code: [Select]
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
13
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
How can I check that my MISO pin works? I suspect that I could somehow burn it.

Can ribbon cable affect signal crosstalk increase resulting in SPI not working even on lowest frequency possible?
15
AVRDude / Re: avrdude: initialization failed, rc=-2
I'm so confused. When I type 'v' my BP from Sandbox electronics shows the exact same pinout as the original BP:
Code: [Select]
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND    3.3V    5.0V    ADC    VPU    AUX    CLK    MOSI    CS      MISO
That's what I used to wire up to my AVR chips, too.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01562535752session_write_close ( )...(null):0
20.01592667368ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01602668144Database_MySQL->query( ).../DatabaseHandler.php:119
40.06202806904Database_MySQL->error( ).../Db-mysql.class.php:273