Closed focussing closed 6 years ago
For recent chips, Atmel/Microchip is adding them via something they call "packs." To compile for 328pb, you'll need to add something like:
atmega328pb: CFLAGS += -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328pb"
atmega328pb: CFLAGS += -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include"
This is pretty awful, which is why the current 328pb build actually compiles for an ordinary 328p instead. Of course, this also means that the current source doesn't actually support 328pb "natively", so you'll get new errors even after you use the above modifications. But they won't be as overwhelmingly mysterious...
I'll check whether there is some better solution for this.
It works! Thank you very much. I need the second uart of the 328pb so cannot use the 328p, that's why I really need this.
There is a bug in the solution's Build Events Post-build command line. It should be like this cp ../bootloaders/optiboot/*.hex .
otherwise the build fails.
Also the following error occurs:
C:\develop\optiboot\AtmelStudio\makefile(515,1): error: recipe for target 'baudcheck' failed
avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega328pb -DF_CPU=16000000L -DBAUD_RATE=115200 -DLED_START_FLASHES=3 -DLED=B2 -DUART=1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328pb" -I "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include" -c -o optiboot.o optiboot.c
process_begin: CreateProcess(NULL, bash baudcheck.tmp.sh, ...) failed.
make (e=2): Het systeem kan het opgegeven bestand niet vinden.
make: [baudcheck] Error 2 (ignored)
I don't know how to fix this. Copying the baudcheck.c file to the "studio" directory does not help.
Some of this might be fixed by https://github.com/Optiboot/optiboot/commit/70bd967c3cc5e242f09cb4849e2ce396bfc60fe7 (assuming that the 328pb avr-gcc stuff is installed.) The actual request for official support of 32pb and the 2nd UART I've created a new issue for: https://github.com/Optiboot/optiboot/issues/238
My situation:
UART=1 LED=B2 AVR_FREQ=16000000L atmega328pb
which corresponds to my hardwareBuild FAILED. ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========