"Protocol error" uploadind a large sketch

Today I wrote and compiled a very large sketch:

Bynary sketch size: 32152 byte (of a 32256 byte maximum)

When I've tried to upload it, I have seen the RX/TX LEDs blinking for a couple of seconds with the message "uploading..." into the IDE. Then LEDs have stopped blinking and I've got this error:

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64 avrdure: failed to write flash memory, rc=4 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I've tried to upload the example sketch "Blinking" and it did: it have been uploaded with no errors. I tried another sketch and no problems found. But if I try this huge sketch I get that error. Arduino Uno - IDE 0021 - Windows XP I didn't try under Linux and/or IDE 0022.

Same issue with Arduino IDE 0022 under Linux, with a little bit difference in size (32196) and error codes:

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00 avrdure: failed to write flash memory, rc=-4 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

I have the same issue with Arduino 021 under windows 7 =(

With a large sketch? How big is your code?

almost 30000 bytes I have found this http://code.google.com/p/optiboot/issues/detail?id=23 Seems a known problem ... need to upgrade bootloader =(

But using my Arduino 2009 as programmer for Arduino UNO doesn't work ... get avrdude: stk500_getsync(): not in sync: resp=0x15 :((

Finally got it working but using IDE 0021 . With 0022 cannot update bootloader of uno board using 2009 board as ISP . Don't know why it works with 0021, but now it's ok. I have uploaded a sketch large 29980 bytes.