NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Program too big for MCU?

September 18, 2012
by jlaskowski
jlaskowski's Avatar

I had a problem where my program was too big for the MCU. I decreased its size, but it still won't load. The error is different than what I got for the reduced size. I generated a .ass file and its last line, indicating size is:

00003c20 <__stop_program>:
    3c20:   ff cf           rjmp    .-2         ; 0x3c20 <__stop_program>

Hex 3c20 equals decimal 15392. Isn't that small enough to fit?

Here's the error:

C:\Documents and Settings\Administrator\My Documents\Nerdkit\Code\WiFi>make
avrdude -c avr109 -p m168 -b 115200 -P COM5 -U flash:w:wifi.hex:a

Connecting to programmer: .
Found programmer: Id = "FDL v02"; type = S
    Software Version = 0.2; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x35

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "wifi.hex"
avrdude: input file wifi.hex auto detected as Intel Hex
avrdude: writing flash (15394 bytes):

Writing | ###############################################    | 93% 2.30savrdude: error: programmer did not respond to command: write block
make: *** [wifi-upload] Error 1
September 18, 2012
by jlaskowski
jlaskowski's Avatar

FYI, other apps, like led_blink still write to the flash with no problem.

September 18, 2012
by jlaskowski
jlaskowski's Avatar

I got it down to 14258 and it finally writes successfully. I read that 2K is for the bootloader, so I'm basically maxed out on this MCU. I ordered the ATMega328.

Post a Reply

Please log in to post a reply.

Did you know that you can read diagnostic data from some cars with a NerdKit? Learn more...