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

Program Build Failed

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



Joined: 10 Aug 2013
Posts: 13
Location: bangalore

View user's profile Send private message

Program Build Failed
PostPosted: Thu Dec 04, 2014 6:01 am     Reply with quote

Hi All,
I am working with PIC 1938 and C compiler V4.114.

I successfully verified my code up %39 of ROM, after that even if I included a single statement it is not successfully building.

I have seen this type of problem when ROM is full, but I never saw this problem even if I am not wrote %40 of program.

Please anybody help me to solve this problem...

Executing: "C:\Program Files (x86)\PICC\Ccsc.exe" +FM "main.c" +DF +LN +T +A +M +Z +Y=9 +EA #__16F1938=TRUE
>>> Warning 216 "main.c" Line 741(48,49): Interrupts disabled during call to prevent re-entrancy: (@FLT)
>>> Warning 202 "main.c" Line 221(26,50): Variable never used: EEPROM_Write_Enable_flag
>>> Warning 202 "main.c" Line 227(22,42): Variable never used: Charger_Current_flag
>>> Warning 202 "main.c" Line 250(15,29): Variable never used: Old_Array_KWAH
>>> Warning 202 "main.c" Line 251(18,35): Variable never used: Old_AC_Charger_KW
>>> Warning 202 "main.c" Line 252(20,39): Variable never used: Old_AC_Charger_KWAH
>>> Warning 202 "main.c" Line 259(15,29): Variable never used: AC_Charger_KWH
>>> Warning 202 "main.c" Line 260(14,27): Variable never used: AC_Charger_KW
*** Error 71 "main.c" Line 741(48,49): Out of ROM, A segment or the program is too large DISPLAY_PARAMETERS
Seg 00021-007FF, 00F5 left, need 073F
Seg 00800-00FFF, 0800 left, need 080F
Seg 01000-017FF, 0800 left, need 080F
Seg 01800-01FFF, 0800 left, need 080F
Seg 02000-027FF, 0800 left, need 080F
Seg 02800-02FFF, 0800 left, need 080F
Seg 03000-037FF, 0800 left, need 080F
Seg 03800-03FFF, 0800 left, need 080F
Seg 00000-00002, 0000 left, need 080F
Seg 00003-00003, 0001 left, need 080F
Seg 00004-00020, 0000 left, need 080F
Seg 00021-007FF, 00F5 left, need 080F

1 Errors, 8 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Thu Dec 04 17:09:40 2014
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Dec 04, 2014 6:53 am     Reply with quote

classic error....

*** Error 71 "main.c" Line 741(48,49): Out of ROM, A segment or the program is too large DISPLAY_PARAMETERS
Seg 00021-007FF, 00F5 left, need 073F
Seg 00800-00FFF, 0800 left, need 080F

It's telling you that your code is too large to fit into the memory.
IE: One 'function' or 'piece' of your code needs 073F bytes of space yet there's only 00F5 left in a memory page.

While physically the PIC still has a lot of memory left, you have to ensure that 'functions' reside 100% within a memory 'page'.You cannot 'cross' page boundaries.
The 'cure' is to rewrite code to have smaller functions,sometimes rearranging the order will get the code to fit as well.

consider a PIC with 1000 bytes of code space, consisting of two 'page' each 500 bytes long and 4 functions A-100 bytes, B 200 bytes, C 300 Bytes, and D 400 bytes.

If coded A-B-C-D, then the compiler halts after B, since it knows it can't get 100+200+300 bytes into a 500 byte 'page'
However if you 'recode'( rearrange the sequence) to A-D-B-C, then it will compile as A(100) + D(400) = 500 , and B(200)+C(300)= 500.

hth
jay
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Dec 04, 2014 7:42 am     Reply with quote

By the way, the warnings are telling you important stuff too.

>>> Warning 216 "main.c" Line 741(48,49): Interrupts disabled during call to prevent re-entrancy: (@FLT)

This shows you are using floating point in an ISR, possibly just a cast to float, as well as the main code. Floating point is never a great idea in ISRs as it takes a long time to process.

The other warnings:
>>> Warning 202 "main.c" Line 221(26,50): Variable never used: EEPROM_Write_Enable_flag
>>> Warning 202 "main.c" Line 227(22,42): Variable never used: Charger_Current_flag
>>> Warning 202 "main.c" Line 250(15,29): Variable never used: Old_Array_KWAH
>>> Warning 202 "main.c" Line 251(18,35): Variable never used: Old_AC_Charger_KW
>>> Warning 202 "main.c" Line 252(20,39): Variable never used: Old_AC_Charger_KWAH
>>> Warning 202 "main.c" Line 259(15,29): Variable never used: AC_Charger_KWH
>>> Warning 202 "main.c" Line 260(14,27): Variable never used: AC_Charger_KW

tell you that you have declared some variables that you haven't used. If they are not for something you haven't added yet they are probably redundant. I think the compiler doesn't even allocate RAM for such variables, so there's probably not RAM wasted.
SSURESHREDDY



Joined: 10 Aug 2013
Posts: 13
Location: bangalore

View user's profile Send private message

PostPosted: Thu Dec 04, 2014 8:00 am     Reply with quote

Yeah...
I got it.
I just split my large function into two functions, now problem is fixed.

Thanks Jay

Still I am writing the code, is there any chance to come again this problem..

SURESH
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Dec 04, 2014 9:22 am     Reply with quote

yes...

If you use a 'chunk of code' several times throughout your main program, consider creating it as a 'function', thus callable from anywhere. That way you'll save space and may not see the error again.

hth
jay
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