bootloading the atmega328-pu

When you install a bootloader on the 328-PU (Non PicoPower) you have to create a new 328 entry in avrdude.conf with the correct signature. You then create a new 328 boards.txt entry pointing to the new 328 device in avrdude.conf, but otherwise using the same details (bootloader, fuses etc) as the 328P entry.

So, this allows you to burn a bootloader and set fuses for 16Mhz external crystal etc, just like for the 328P.

The problem is then when you come to upload a sketch, whether via Upload (Serial and bootloader) or Upload via Progammer (ISP programmer gia ICSP/SPI). If you leave the board type in IDE set to 328 (non P) then you'll find you can't compile and upload.

What you have to do is switch back to telling IDE/avr-gcc/avrdude that it's the normal Uno 328P.

So, you burn bootloader with 328 set as board, but upload with Uno as the board.

Don't forget if it's barebones then you need to do a manual reset after the compile has completed (if using serial via the bootloader).

I think the issue is actually with the (older) version of avr-gcc compiler that Arduino IDE uses. For some reason it doesn't handle the non-P 328 uC, so you have to lie and say it's a 328P.

When you burn the bootloader/set fuses etc, then the signature of the chip is actually read and has to match the signature of a device that avrdude/IDE knows about, to match a bootloader via boards.txt, hence adding a 328 entry to avrdude.conf and boards.txt to get last that hardware check and allow you to get the Uno bootloader into the chip, even if you just use it to set fuses and then reveret to ISP programming afterwards (where you just tell everything it's a normal Uno).