View previous topic :: View next topic |
Author |
Message |
gcataldo
Joined: 16 Aug 2005 Posts: 3
|
PROBLEM: A segment or the program is too large! |
Posted: Tue Aug 16, 2005 7:34 pm |
|
|
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
|
|
Posted: Tue Aug 16, 2005 7:43 pm |
|
|
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
|
|
Posted: Tue Aug 16, 2005 7:53 pm |
|
|
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
|
Problem Solve ! |
Posted: Tue Aug 16, 2005 9:20 pm |
|
|
Mark:
I follow your recomendation and make it work success .
Thanks a lot.
Giancarlos |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Thu Aug 18, 2005 9:30 am |
|
|
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
|
|
Posted: Thu Aug 18, 2005 12:00 pm |
|
|
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
|
|
|
|