Summary:
I am having a bootloader issue ( I think ) with the mega328p. I'll load the bootloader and set fuses using a STK500 and avrstudio ( 4.16sp1 with bootloader upload fix ) and also tried the latest avrdude. Put the 328p on my board, bootloader comes up as expected. Upload a sketch and I never see the bootloader again. The reported upload size looks correct ( 30xxx something, not in front of that computer right now ).
Details:
This isn't an "arduino" board. This is a module called the midi2sds, which is opensource. It happened to have a mega8 but the available code was written in codevisionavr and would be difficult to backport to avrgcc so I figured making this more arduino-like would be fun and useful. I added a breakout board with a TTL serial port and reset button.
If I just put a bootloader on a mega8 and install it, I can upload a sketch repeatedly just fine however I'm afraid I'll be a little tight on space with the Mididuino libraries and everything so why not put in the 328p...
I actually got the 328's preprogrammed with the bootloader and of course immediately wiped it upon test sketch upload.
My immediate first thought was that bootloader protection was off, but I've double checked that many times using info from the web as well as the fuse calculator, avrstudio, and finally from the datasheet.
i've read that symptom posted here before but don't recall what the fix(s) was if any. I assumed it was a fuse thing but can't recall for sure. Maybe trying a search of past posts would bring something back.
I never found the topic hiding in the forum but I did manage to solve my problem.
I was unable to get the Arduino bootloader in 0016 to work on the 328p, however the latest Adaboot works perfectly. Note : Same fuse settings for both.
In case anyone is curious, here are my avrdude lines used to burn the bootloader :
Used that for both the stock bootloader ( shown above ) and Adaboot. I forget what webpage it came from, but I verified the fuses in avrstudio just to make certain.
Anyhow, don't know why I was having trouble, but I'm up and working now and thats all I care about at the moment.
Thats what I assumed my problem was, so I paid particular attention to the lock fuses. I can use the above avrdude lines and the stock 328 bootloader, and the bootloader dies after one sketch upload, or I can use adaboot with the same avrdude lines and it works repeatedly.
I tried to use a USBtiny to load a bootloader into my atmega328p's. My method was based on an older post on this forum by brunolatortue. I had a similar problem in that after I burned the bootloader, I could load a sketch into the device only once. Subsequent attempts to reprogram failed.