CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PROBLEM: A segment or the program is too large!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
gcataldo



Joined: 16 Aug 2005
Posts: 3

View user's profile Send private message

PROBLEM: A segment or the program is too large!
PostPosted: Tue Aug 16, 2005 7:34 pm     Reply with quote

Hi,

I�m using a CCS C Compiler to program a PIC16F877. I use that thorough MPLAB Plug-in from CCS in order to use my PICStart Plus Programmer. But when the code starts grow this error appears.


MPLAB Output Screen:
++++++++++++++

main
Seg 00800-00FFF, 0555 left, need 0829
0001
Seg 01000-017FF, 0800 left, need 0829
0001
Seg 01800-01FFF, 0800 left, need 0829
0001
Seg 00000-00003, 0000 left, need 0829
0001
Seg 00004-00032, 0000 left, need 0829
0001
Seg 00033-007FF, 002C left, need 0829
0001

@goto12216

*** Error 71 "C:\temp\c14-f2\main_filename.c" Line 203(0,1): Out of ROM, A segment or the program is too large
Halting build on first failure as requested.
BUILD FAILED: Tue Aug 16 21:12:40 2005

++++++++++++++


Can you help me?.



Thanks.


Giancarlos
Guest








PostPosted: Tue Aug 16, 2005 7:43 pm     Reply with quote

te jodiste,pues no se nada de eso pero solo te digo que tienes que hacerlo mas CORTO.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Aug 16, 2005 7:53 pm     Reply with quote

You function is too big. Try breaking it up into smaller pieces. If you only call a function once then try adding #separate before the function or else the compiler will place the code "inline" and your function will be larger than expected.
gcataldo



Joined: 16 Aug 2005
Posts: 3

View user's profile Send private message

Problem Solve !
PostPosted: Tue Aug 16, 2005 9:20 pm     Reply with quote

Mark:

I follow your recomendation and make it work success Very Happy .


Thanks a lot.

Giancarlos
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Thu Aug 18, 2005 9:30 am     Reply with quote

Hi,

Will writing #SEPERATE before a large function solve the problem, I have faced this problem quite frequently, what I usually do is to break the large function/procedure into smaller ones.

I did'nt know #SEPERATE could solve this problem...

thanks
arun
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 18, 2005 12:00 pm     Reply with quote

It won't "break up" a large function. For example:

Code:

void funcA(void
{
....
}
void funcB(void
{
....
}
void funcC(void
{
....
}

void funcD(void)
{
  funcA(); 
  funcB(); 
  funcC();
}


In the above example, if we only call the functions once, funcD will be one big function. That is, the compiler will place the A,B,C functions "inline" as an optimization technique. By adding #separate before functions A,B, and C, the compiler will treat these as individual functions which would be smaller and have a better chance of fitting into a code page.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 18, 2005 12:06 pm     Reply with quote

If you're using #separate with the 16F series, read this thread for
the limitations:
http://www.ccsinfo.com/forum/viewtopic.php?t=12384
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group