Help create maxSize sketch

retrolefty:
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?

Try the attached program. It's a 32.1K PROGMEM array of text strings that print to the serial port. To test larger boards, just add more lines.

This is what the program looks like (not showing ALL the lines of course):

// crazy test of full program memory

void setup(void)
{

        Serial.begin(115200);

        const char *testData[324] = {
                PSTR("This is line 0000 in a text string living in program memory AKA PROGMEM.\r\n"),
                PSTR("This is line 0001 in a text string living in program memory AKA PROGMEM.\r\n"),
                PSTR("This is line 0002 in a text string living in program memory AKA PROGMEM.\r\n"),
---------- snip! ----------
                PSTR("This is line 0321 in a text string living in program memory AKA PROGMEM.\r\n"),
                PSTR("This is line 0322 in a text string living in program memory AKA PROGMEM.\r\n"),
                PSTR("This is line 0323 in a text string living in program memory AKA PROGMEM.\r\n")
        };

        char buffer[128];
        uint16_t x;
        for (x = 0; x < 324; x++) {
                sprintf_P(buffer, testData[x]);
                Serial.print(buffer);
        }
}

void loop(void) { ; }

test.zip (1.28 KB)