avrdudes / avr-libc

The AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
https://avrdudes.github.io/avr-libc/
Other
250 stars 54 forks source link

[bug #30499] Wrong register names for atmega324pa #443

Open avrs-admin opened 2 years ago

avrs-admin commented 2 years ago

Tue 20 Jul 2010 06:49:13 PM CEST

iom324pa.h has registers like SPCR0, SPSR0, SPDR0 and their bits, that have a different name in the datasheet. When compiling with avr-gcc 4.3.4 and avr-libc 1.7.0, and using the correct register names from datasheet (SPCR, SPSR, SPDR, ...), I get the "SPDR undeclared" as expected, since they are defined in the io header as a different name. Maybe there are more wrong names in the file.

This issue was migrated from https://savannah.nongnu.org/bugs/?30499

avrs-admin commented 2 years ago

Eric Weddington Tue 20 Jul 2010 10:08:44 PM CEST

The ATmega324P.xml device file from AVR Studio has duplicate tags with different data in them. This is Atmel bug #11908. When this bug is fixed, separate header files need to be generated for the ATmega324P and ATmega324A and included in avr-libc (currently they use a single iom324.h header file), and io.h modified accordingly.

avrs-admin commented 2 years ago

rr Wed 21 Jul 2010 11:45:12 AM CEST

You're right about that, but I'm mentioning the problem in the iom324pa.h file. There are 3 different signatures: atmega324p  :0x1e9508 atmega324a  :0x1e9515 atmega324pa :0x1e9511 When the Atmel bug is fixed, don't forget to update atmega324pa too, looking for those register names wrongly defined. BTW, the Atmel bug link is wrong.

avrs-admin commented 2 years ago

Eric Weddington Wed 21 Jul 2010 02:42:17 PM CEST

Yes, really all three variants need to have updated header files. I'll make sure and do that after the Atmel bug is fixed.

The link to the bug was automatically put in by Savannah, and it thinks that it's a bug on this system, which it is not. This is an Atmel-internal bug number. Sorry for any confusion.