Hi all,
First, I apologize if I've missed a duplicate post with discussions/solutions. I honestly tried searching, but please direct me to a relevant post if needed.
I'm having a problem uploading my sketch to an Arduino UNO board on Win 7 32-bit. The code can be "verified" successfully, but the error occurs when I actually push the Upload button. The error text (with verbose output enabled) I get is shown below. I intentionally left out a lot of the text with the verbose output option because there was a ton of it. If you want to see it all, just let me know. The three starred (*) lines are the lines I get with verbose output disabled.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Binary sketch size: 28908 bytes (of a 32256 byte maximum).
...
* avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
# | 100% 10.62s
* avrdude: failed to write flash memory, rc=-4
avrdude: Send: Q [51] [20]
avrdude: Recv:
* avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
avrdude done. Thank you.
Now, it is important to note that with a sketch size of 28652 bytes (256 bytes less than the sketch that throws the error), everything works fine. Those 256 bytes come from an unsigned char array in a massive data table I'm using. So essentially I've narrowed down the problem such that when the size of the table pushes the sketch size above 28652 bytes, the above error is thrown. Because I'm not hitting the 32256 byte maximum, my question is why?
Here's another important thing to note » Because of the amount of space I needed to include this table, it is declared in a header file (.h) in the program memory with the following statement:
PROGMEM prog_uchar frames[] = {0,0,540,250,43, ... // LOTS of data
The rest of my code is driving an 8x8 LED matrix over SPI. The massive data table I use is for the look up of the frames I display on the LED matrix. What the code actually does is grab a byte at a time and sends it out the SPI data out port to my hardware. When 4 bytes have been sent, a pulse is sent to my hardware that "latches" the frame in place. This process continually loops through the frames[] array forever and ever. (When it works it looks awesome, I might add Very pleased thus far)
I've tried looking through the troubleshooting guide the error message mentions, but because my code works fine with sketch sizes below 28652 bytes, I really wasn't able to find anything useful in the guide. Can anyone shed some light into why this problem occurs? I imagine that there is some kind of limit in the amount of program memory I can use or perhaps the size of my frames[] array, but I just don't know what. By the way, I am more than willing to do some leg work on my side, and all I'm looking for is a little nudge in the right direction.
Thanks!
-Rory