I've built several custom Atmega328P-based arduino boards. All of them have been flashed with the arduino bootloader via ISP and have been proven to work well except one of the boards. On the faulty board, flahing via ISP works flawless and USB comms work well too. However, with the bootloader in place, loading a new image from the Arduino IDE returns a bunch of
avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x90
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
I've checked fuses, signature and lock bits on the affected atmega and everything seems to be fine. This atmega comes from a batch purchased from eBay so I'm beginning to think that this uC is somehow faulty.
Having checked from avrstudio that the signature is correct for this atmega (0x1E 0x35 0x0F), the problem should be in the chip itself. Anyway, I can always program the faulty board from ISP