Skip to main content

Show Posts

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

Messages - nyc863

1
AVRDude / Re: Re: avrdude: initialization failed, rc=-2
when I typed "it was using" I meant to say "I was using'.

So I was using the sandbox electronics bus pirate, and getting that error so I just connected to it and used the command (I forget which) to dump the cable colors and wires, then followed those, ignoring the particular instructions i had in front of me which showed a picture of the dangerous prototypes bus pirate and its included ribbon cable colors and how they hooked up to the device in question.
The end result was very different to someone using the authentic bus pirate and I can't remember the details but it wasn't the case of a swapped color or anything, nearly everything, or entirely everything was different.
2
AVRDude / Re: avrdude: initialization failed, rc=-2
I had this problem and it was because of wrong wiring.

Specifically, it was using the sandboxelectronics bus pirate with its included ribbon cable and assuming the colors matched. They don't. You need to look at the pin out for the sandboxelectronics bus pirate (also available from serial connection to it and issue a command, I forget which, to show the pin outs and colors)..

If Initialization failed rc=-2 it means the target chip could not be put into programming mode, which usually means the wiring is not correct.
3
Bus Pirate Support / Re: bricked my bus pirate. I think.
Never mind, I solved it. My Mac PL2303 USB driver had become wedged.

After I was told by sandbox electronics you can't brick the 2303, even if you can brick the bus pirate, so a device should always be created, I tried harder and got to the boot loader again.

I still could not use pirate_loader as delivered though.

in the end I found that the code to open and configure the serial port does not work correctly under OSX 10.6

I revised it as below, using hints a stackoverflow question (# 6947413) on how to read/write to FTDI serial port.
and it works now:

#else
        struct termios g_new_tio;
        memset(&g_new_tio, 0x00 , sizeof(g_new_tio));
        tcgetattr(fd, &g_new_tio);
        cfsetispeed (&g_new_tio, baudrate);
        cfsetospeed (&g_new_tio, baudrate)

        g_new_tio.c_lflag = 0;
        g_new_tio.c_oflag = 0;
        g_new_tio.c_cflag = (g_new_tio.c_cflag & ~CSIZE) | CS8;
        g_new_tio.c_iflag &=  ~(IXON | IXOFF | IXANY | IGNBRK);
        g_new_tio.c_cflag |=  (CLOCAL | CREAD);
        g_new_tio.c_cflag &= ~(PARENB | PARODD | CSTOPB | CRTSCTS);

        g_new_tio.c_cc[VTIME] = 5;
        g_new_tio.c_cc[VMIN] = 0;
        int i = tcsetattr(fd, TCSANOW, &g_new_tio);
        tcflush(fd, TCIOFLUSH);
        return i;
#endif
4
Bus Pirate Support / bricked my bus pirate. I think.
I purchased a buspirate off of ebay
http://dangerousprototypes.com/2011/08/ ... ate-sales/

It has a silk screen "sandbox electronics" on it and was in a plastic housing.
It uses the large LEDs not the SMD ones.

It had this on it. Unfortunately for what I needed it for I required the STK500v2 firmware.

Detecting BusPirate...
** 
**  Bus Pirate v3b
**  Firmware v5.10 (r559)  Bootloader v4.4
**  DEVID:0x044F REVID:0x3003 (24FJ64GA002 A3)
**  http://dangerousprototypes.com
**

When I used the console, it would reply BP4+ when the jumper was on the board, and the yellow LED was glowing.

However, using

./pirate-loader_mac --dev=/dev/tty.PL2303-00001004 --hex=BPv3&v2go/BPv3-STK500v2-v0c.hex --verbose

would fail repeatedly:
+++++++++++++++++++++++++++++++++++++++++++
  Pirate-Loader for BP with Bootloader v4+ 
  Loader version: 1.0.1  OS: Darwin
+++++++++++++++++++++++++++++++++++++++++++

Parsing HEX file [BPv3&v2go/BPv3-STK500v2-v0c.hex]
Found 21502 words (64506 bytes)
Fixing bootloader/userprogram jumps
Opening serial device /dev/tty.PL2303-00001004...OK
Configuring serial port settings...OK
Sending Hello to the Bootloader...ERROR
No reply from the bootloader, or invalid reply received: 4
Please make sure that PGND and PGC are connected, replug the devide and try again

Note that it receives 4 characters. Could it be receiving BP4+? But not the magic "K"? When I wrote the HELLO character to the bootloader via just printing it into the serial port, it did reply K in the console.

After restart arduino serial console a few times, and then re-running the firmware update program several times, it succeeded, sort of:

Parsing HEX file [BPv3-STK500v2-v0c.hex]
Found 21502 words (64506 bytes)
Fixing bootloader/userprogram jumps
Opening serial device /dev/tty.PL2303-00001004...OK
Configuring serial port settings...OK
Sending Hello to the Bootloader...OK

Device ID: PIC24FJ64GA002 [d4]
Bootloader version: 1,02
00 00 00 01 01 FE
Erasing page 0, 0000...OK
Writing page 0 row 0, 0000...OK
00 00 00 02 C1 04 00 A8 00 00 00 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 51
Writing page 0 row 1, 0080...OK
00 00 80 02 C1 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 00 D0 10 BD
Writing page 0 row 2, 0100...ERROR

At this point when I plug it into USB, yellow LED on, or off. no device gets created anymore :(

What did I do wrong?

Why couldn't the update program see the bootloader response, and why after writing one page then failing, is it no longer talking over USB at least to the bootloader?

Sad face. I feel like I'm in a shave the yak scenario.. like I got the bus pirate to fix something, which should fix something, which should (I forget the chain it goes up so high) ... and now i need a bus pirate to fix my bus pirate?

( ! ) 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.01322306200session_write_close ( )...(null):0
20.01352437776ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01352438552Database_MySQL->query( ).../DatabaseHandler.php:119
40.05912577272Database_MySQL->error( ).../Db-mysql.class.php:273