-
Download ATmega's support pack from Microchip's website
-
Unzip the relevant files
unzip -j Atmel.ATmega_DFP.x.y.zzz.atpack \ gcc/dev/atmega328pb/avr5/crtatmega328pb.o \ gcc/dev/atmega328pb/avr5/libatmega328pb.a \ include/avr/iom328pb.h
-
Place the
.o
and.a
files in/usr/avr/lib/avr5/
-
Place the
.h
file in/usr/avr/include/avr/
-
Add the following to
/usr/avr/include/avr/io.h
#elif defined (__AVR_ATmega328PB__) || defined (__AVR_ATmega328__) # include <avr/iom328pb.h>
All set. Ready to compile.
Add the following to /etc/avrdude.conf
, right below the definition for ATmega328P
.
part parent "m328"
id = "m328pb";
desc = "ATmega328PB";
signature = 0x1e 0x95 0x16;
ocdrev = 1;
;
Happy flashing!
Thanks for this!
I found it really helpful. I've subsequently found a cleaner way for users to provide the pack files to the compiler without modifying the /usr/... directories maintained by the package manager.
If you're interested, I've documented the process here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930195#60
My examples are for the new 0-series and 1-series chips but I have been using atmega328pb recently as well and there's a note about how it applies to that.