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

Out of memory error?

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



Joined: 24 Jan 2010
Posts: 14

View user's profile Send private message

Out of memory error?
PostPosted: Sun Jan 30, 2011 5:58 pm     Reply with quote

I had a working program before I switched processors from a 18f2550 (32k flash) to a 18f26k22 (64k flash). Even though the memory size doubled I get the following error:

Executing: "C:\Program Files (x86)\PICC\Ccsc.exe" +FH "main.c" #__DEBUG=1 +ICD +DF +LN +T +A +M +Z +Y=9 +EA #__18F26K22=TRUE >>> Warning 203 "main.c" Line 136(1,1): Condition always TRUE *** Error 71 "main.c" Line 454(2,3): Out of ROM, A segment or the program is too large MAIN Seg 00004-01CBE, 018A left, need 0568 Seg 00000-00002, 0000 left, need 0568

What am I doing wrong?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 30, 2011 6:21 pm     Reply with quote

Do a test. Run this program in MPLAB simulator and see what the
compiler thinks the Program Memory size is:
Code:

#include <18F26K22.h>
#fuses INTRC_IO,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, UART1, ERRORS)

//======================================
void main(void)
{
printf("ROM size is: %lx \r", getenv("PROGRAM_MEMORY"));

while(1);
}


Also post your compiler version.
bdrmachine



Joined: 24 Jan 2010
Posts: 14

View user's profile Send private message

PostPosted: Sun Jan 30, 2011 8:03 pm     Reply with quote

The memory usage gauge reads 121 bytes using version 4.111
bdrmachine



Joined: 24 Jan 2010
Posts: 14

View user's profile Send private message

PostPosted: Sun Jan 30, 2011 8:05 pm     Reply with quote

Sorry I forgot to add the compiler states 3%
The output from the printf is "ROM size is: 1cc0"
bdrmachine



Joined: 24 Jan 2010
Posts: 14

View user's profile Send private message

PostPosted: Mon Jan 31, 2011 7:30 am     Reply with quote

Where is the compiler getting its' part specific memory size. Is this pulled from the top part of the header file? I did notice that the ram size was stated as 512. I changed it to 3896 as stated in the data sheet. This had no change to the out of rom error. One thing I noticed is that the error is always reported as being 2 lines past the end of the file. e.g. if my main .c file is 455 lines long it reports the error at line 457. If I delete any 4 lines the error reports line 443.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Jan 31, 2011 7:43 am     Reply with quote

The size comes from the devices.dat file, not from the header. My header
(in version 4.114) shows 512 RAM but the devices.dat files shows the correct
amount (3896). If you have the IDE you can view/edit the file using the
device editor. I am not in a position right now to load 4.111 to check the
devices.dat file for that version.
_________________
Google and Forum Search are some of your best tools!!!!
levdev



Joined: 19 May 2010
Posts: 36
Location: UK

View user's profile Send private message

PostPosted: Tue Feb 08, 2011 3:49 am     Reply with quote

I have a similar problem converting from a PIC18F26K20 to a PIC18F26K22. My ROM usage goes from 10% to 90%, but the output code is the same size.

I found that removing the directive
Code:
#device ICD=true

fixed the problem, but obviously disables the debug capability. I have emailed CCS about the problem and will post a reply here once I get one.

bdrmachine, did you have this directive in your code, and does removing it solve the problem for you? Have you found another resolution to this problem?
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