AVR Invalid instruction
Quote from czarusGG on December 14, 2023, 11:47 amHello everyone!
I wanted to report the following BUG:
"ERROR: AVR Invalid instruction: ELPM with no RAMPZ"
SimulIDE:
1.1.0 rev 2068
1.1.0 rev 1909Version:
WINDOWS 64Microcontroller:
ATMEGA 1284The error occurs when trying to use a class in C++
I'M GOING:
MICROCHIP STUDIO 7.0.2594Compiler:
AVR-GCCThe same HEX file loaded into the physical microcontroller works properly. It also runs correctly in the MICROCHIP STUDIO simulator and debugs correctly.
Regards...
PS. Sorry for any mistakes (google translate)
Hello everyone!
I wanted to report the following BUG:
"ERROR: AVR Invalid instruction: ELPM with no RAMPZ"
SimulIDE:
1.1.0 rev 2068
1.1.0 rev 1909
Version:
WINDOWS 64
Microcontroller:
ATMEGA 1284
The error occurs when trying to use a class in C++
I'M GOING:
MICROCHIP STUDIO 7.0.2594
Compiler:
AVR-GCC
The same HEX file loaded into the physical microcontroller works properly. It also runs correctly in the MICROCHIP STUDIO simulator and debugs correctly.
Regards...
PS. Sorry for any mistakes (google translate)
Uploaded files:Quote from arcachofo on December 14, 2023, 12:07 pmHi.
Seems that RAMPZ register is missing from atmega1284.
Please try this and let me know if the program is working:
Edit file data/AVR/mega1284 and add this at line 7:<regblock name="I/O_REG" start="0x003B" end="0x003B" offset="32"> <register name="RAMPZ" addr="0x003B" bits="" /> </regblock>
The file should look like this:
<!DOCTYPE SimulIDE> <mcu name="mega1284" core="AVR" data="16640" prog="131072" progword="2" eeprom="4096" inst_cycle="1" freq="16000000" > <include file="avr/avr_gpr.xml" /> <include file="megaxx4/mxx4_regs.xml" /> <regblock name="I/O_REG" start="0x003B" end="0x003B" offset="32"> <register name="RAMPZ" addr="0x003B" bits="" /> </regblock> <datablock name="RAM" start="0x0100" end="0x40FF"/> <include file="megaxx4/mxx4_int.xml" /> <include file="megaxx4/mxx4_perif.xml" /> </mcu>
Hi.
Seems that RAMPZ register is missing from atmega1284.
Please try this and let me know if the program is working:
Edit file data/AVR/mega1284 and add this at line 7:
<regblock name="I/O_REG" start="0x003B" end="0x003B" offset="32">
<register name="RAMPZ" addr="0x003B" bits="" />
</regblock>
The file should look like this:
<!DOCTYPE SimulIDE>
<mcu name="mega1284" core="AVR" data="16640" prog="131072" progword="2" eeprom="4096" inst_cycle="1" freq="16000000" >
<include file="avr/avr_gpr.xml" />
<include file="megaxx4/mxx4_regs.xml" />
<regblock name="I/O_REG" start="0x003B" end="0x003B" offset="32">
<register name="RAMPZ" addr="0x003B" bits="" />
</regblock>
<datablock name="RAM" start="0x0100" end="0x40FF"/>
<include file="megaxx4/mxx4_int.xml" />
<include file="megaxx4/mxx4_perif.xml" />
</mcu>
Quote from czarusGG on December 14, 2023, 12:46 pmSUCCESS!
Works in both versions of SimulIDE 🙂
Thank you very much!
Now, you need to remember to add the entry to the MCU definition 🙂
Thank you very much for your help.
SUCCESS!
Works in both versions of SimulIDE 🙂
Thank you very much!
Now, you need to remember to add the entry to the MCU definition 🙂
Thank you very much for your help.