simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Support for atmega2560?


From: Markus Hitter
Subject: Re: [Simulavr-devel] Support for atmega2560?
Date: Fri, 06 Mar 2015 20:44:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Am 06.03.2015 um 19:05 schrieb ThomasK:
> 
>> My impression is, 1284p implementation works up to 64 kB, only. Running the 
>> very same code compiled for ATmega644 works, when compiling and running for 
>> ATmega1284P I get such warnings:
>> WARNING: file rwmem.cpp: line 231: Invalid write access to IO[0x90]=0x1, 
>> PC=0x3ba6
>> WARNING: file rwmem.cpp: line 231: Invalid write access to IO[0x91]=0x9, 
>> PC=0x3bac
>> WARNING: file rwmem.cpp: line 231: Invalid write access to IO[0x71]=0x0, 
>> PC=0x3bb0
> 
> Hm ... this io addresses point to some timer peripheral things. And in 
> simulavr
> mega644 and mega1284 habe the same code (especially for io assignment) except
> sizes of RAM, Flash and EEPROM. So, for me int not plausible, that this should
> work on mega 644 and not on mega1284.

You assume here these addresses are reported correctly. However, the 1284 needs 
16 bit addresses while the 644 gets away with 15 bit ones. What if the 16 bit 
ones are assumed to be 15 bit?

The exact binary size for 644 is 17418 bytes, for 1284 and 1284p it's 17552 
bytes. Apparently gcc produces slightly different code. What the exact 
difference may be is a bit unclear when reading both data sheets, each reads 
"The program counter is 16 bits wide, thus addressing the 64K memory locations" 
(page 16/18).

> Code exclusion or inclusion, if compiled for 644/1284? (some #ifdef stuff?)

Nope, no such #ifdefs other than the -mmcu flag for gcc.

> Maybe a bug in register description?

That's done by gcc.


Markus

-- 
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. (FH) Markus Hitter
http://www.jump-ing.de/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]