So I would like a general purpose sketch that can fill the flash memory on a sketch to near maximum size just to test reliablity of uploading large sketches. So I though maybe just a modified blink sketch with just a array defined with different sizes for the various AVR chips, see code comments below. I know the exact size has to take into consideration the size of the bootloader so it doesn't have to be exactly full size minus bootloader size, just use numbers that allow for a maximum size bootloader perhaps?
However I need to force the array to be created and initilized in flash and I've not done that before, so can someone show me how to create the array declaration such that it gets stored into Flash? Thanks.
Lefty
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// make size = to xxxx for 328 chip, yyyy for 1280 chip, zzzz for 2560 chip, etc.
const int size= 6000; // value to fill avalible flash capacity
long myInts[size]; // How to force array to be stored in flash?
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}