Firstly please don't ask why I am doing this exercise on this chip as it is perfectly able to connect via USB. It is the only mega I have around at the moment and so I am using it.
While trying to adapt the STK500v2 compatible bootloader to use on the ATmega32U4 I came across this code. I understand what the code does, one macro uses LPM the other uses ELPM but it gives an error for this chip. According to the datasheet the ELPM instruction is available.
#if (defined(RAMPZ) data = pgm_read_word_far(address); #else data = pgm_read_word_near(address); #endif
Error: illegal opcode elpm for mcu atmega32u4
Both the AS6 Toolchain and WinAVR give the same error.
Is this an error in the compiler or the data sheet?
Also, what are the specific differences between the two instructions?
EDIT: Moderator I couldn't, at first, decide whether this belonged in the AVR forum or the GCC forum. Please move it to the GCC forum as it clearly looks like it should be there.
EDIT2: Maybe EDIT above is wrong. You decide.