Go Down

Topic: 128K program limit (Read 1 time) previous topic - next topic

Mark S

Is there any reason within the Arduino environment why a program greater than 128K wont run properly.  

specs
          Arduino IDE   version 018
          Hardware      Liquidware TouchSlide with 2560 (256k memory)

I have had this same problem back as far as version 012.

The program downloads OK but doesnt do anything.

Thanks

Mark

PaulS

What Arduino are you mounting the shield on? It doesn't matter how much memory the shield has.

Grumpy_Mike

Quote
Is there any reason within the Arduino environment why a program greater than 128K wont run properly.  


I would have thought that anything over 64K won't run because it is an 8 bit processor and so it has a 16 bit absolute address field. That only leaves you with 64K to play in.

retrolefty

#3
Mar 22, 2010, 11:43 pm Last Edit: Mar 22, 2010, 11:45 pm by retrolefty Reason: 1
Quote
I would have thought that anything over 64K won't run because it is an 8 bit processor and so it has a 16 bit absolute address field. That only leaves you with 64K to play in.


I do belive the large AVR chips can address much more then 64kB of program memory. The AVR Mega1280 has 128kB of flash and some go to 256kB I think. The GCC compiler uses sepecial instructions for accessing the larger flash memory on those chips that have extended program space.

Recall that the AVR chips use a Harvard design where the program memory is separate from data memory and hence can and is of a different buss width as well as length.

Lefty

Senso

Maybe it is a problem of your actual avr-gcc version...


Atmega 2560:
Flash (Kbytes)        256
EEPROM (Kbytes)       4
EEPROM (Bytes)       4096
SRAM (Bytes)       8192
Max I/O Pins       86
F.max (MHz)       16
Packages          CBGA 100
Pb-Free Packages          TQFP 100

BenF

When programming flash on an AtMega, the offset address is specified as a word offset. This will overflow at 128K and programming beyond this limit requires setting a higher order register. Many implementations of the STK500 (v1 and v2) protocol (bootloaders, programmers) use 16 bit address offsets and uploads greater than this size will wrap around and overwrite your startup code.

To overcome this limitation you need a programmer (or bootloader) that supports address offsets beyond 16 bits.

Mark S

BenF

Thats what I thought, I am trying to get the source for the boot loader. I imagine the problem is in there. I am fast learning the guts of the AVR and hopefully in another month or two I will be able to write a boot loader or at least modify an existing one.

PaulS, I am programming the Slide itself which is where I am having the problem. The touchSlide is programmed just like an Arduino with a much more extensive library. It uses the 2560 which has 256 K of flash.

As far as the 64K limit, the JMP instruction has a 21 bit argument refer to page 83 of the Atmel document doc0856.pdf
http://www.atmel.com/atmel/acrobat/doc0856.pdf

Thanks for the comments

Mark

Go Up