Compile fails when memory only 3/4th full

Find out how to setup your programmer's software and how to solve many common problems.

Moderator: phalanx

Post Reply
60amp_relay
Posts: 44
Joined: Fri Feb 26, 2010 12:12 pm

Compile fails when memory only 3/4th full

Post by 60amp_relay » Mon Jun 28, 2010 4:00 pm

Hi guys,

I've had this problem bugging me for a while, and I'm hoping it's something you'll know how to solve. I'm using the MPLAB IDE with the free Hi-Tech C 9.70 compiler. I'm using the 16F630 with 1Kw of flash. Everything works fine until my program gets up to about 768 words, or 3/4th the size of flash memory. As soon as I hit the magic 75% mark, I start getting compiler errors like this:

Error [1359] Z:\home\PIC\lib\rs232.c; 12. no space for _printf parameters

But the program compiled just fine when it was only 767 words. I can delete a single letter from one of my printf() statements, and then it compiles again - but for some reason, the compiler refuses to use any more than 3/4th of the flash.

The exact same code compiles just fine when I select a PIC16F688 as the target device, and the compiled code size is the expected 768 words. (The PIC16F688 is similar to the 16F630, but with 4Kw of flash)

Why does the compiler fail to build a 768-word program for a 1Kw target device, but succeed in building that same program for a 4Kw target device?

waltr
Support Volunteer
Posts: 2823
Joined: Tue Sep 08, 2009 12:07 pm
Location: Philadelphia, USA

Re: Compile fails when memory only 3/4th full

Post by waltr » Mon Jun 28, 2010 5:59 pm

I can delete a single letter from one of my printf() statements, and then it compiles again
This seems to be a shortage of RAM, or know as file register, space and not program space.
How much RAM do the two PICs have?

Try compiling with the one less single letter then run the MPLAB simulator while looking at the RAM (file registers) space. I'll bet it is getting used up by the strings for the printf()s.

60amp_relay
Posts: 44
Joined: Fri Feb 26, 2010 12:12 pm

Re: Compile fails when memory only 3/4th full

Post by 60amp_relay » Mon Jun 28, 2010 6:47 pm

Interesting, I hadn't considered that. Thanks for making that suggestion, I'll check it out.

Post Reply