simavr icon indicating copy to clipboard operation
simavr copied to clipboard

cores: Add support for ATmega328PB

Open thelazt opened this issue 5 years ago • 6 comments

Adding support for the the ATmega328PB (more peripheral features compared to ATmega328[P] like additional timers, SPI, TWI).

Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/40001906A.pdf

thelazt avatar Dec 01 '19 12:12 thelazt

Hi, thanks for the PR -- however I can't include Atmel/Microchip headers, please resubmit without it -- normally if you have a separate install of avr-libc, that header will be present; if not, the 328PB core won't be compiled on that machine until avr-libc is updated.

buserror avatar Dec 01 '19 12:12 buserror

I'm still running into this issue -- avr/iom328pb.h not found, causing lacking ATMega328PB support. Once I copy the missing file into simavr/cores/avr, and update my toolchain accordingly (https://stuvel.eu/post/2021-04-27-atmega328pb-on-gcc/), it works. Is there an issue with the Apache 2.0 license of the header file?

maxgerhardt avatar Jul 21 '21 09:07 maxgerhardt

Sorry I'm still not going to merge atmel's files into simavr. You can easily keep a copy out of tree and add a -I to the makefile so it finds it. It's not just the licence difference, it's also the fact that I don't want to have to "maintain" these files into my tree, and there'll be no end to it

buserror avatar Jul 21 '21 09:07 buserror

GPL3, which I read in the simavr source files is the license of the project, is compatible with Apache 2.0 per https://www.gnu.org/licenses/license-list.html.en#apache2 as a free software license.

All the other other iox.h files are here in the core too already. What maintance are you afraid must be done to this static device register definition file? o_o

maxgerhardt avatar Jul 21 '21 09:07 maxgerhardt

Actually I had forgotten completely I had given up on system headers being up to date.

But you can see the problem it created, we actually need to do a merge from their tree, for all I know there are bug fixes and other parts that weren't merged since 2017!

buserror avatar Jul 21 '21 09:07 buserror

I just did a diff with the version of avr-libc in debian linux, and the diff is massive. Not just "forward" but there are files that are older! I think instead of this PR, I need a patch that goes a merge from the "official" avrlibc, just the 8 bits cores to bring us up to date.

buserror avatar Jul 21 '21 10:07 buserror

I did some serious 'meld' merge to the header files, so they are more 'up to date' however I have 3 copies from 3 different source, and they are all different, so really, it's a massive mess...

buserror avatar Aug 11 '23 19:08 buserror