Pages: [1]   Go Down
Author Topic: 128K program limit  (Read 1183 times)
0 Members and 1 Guest are viewing this topic.
USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49372
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34210
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: March 22, 2010, 05:45:48 pm by retrolefty » Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: