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 ROM

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



Joined: 22 Feb 2007
Posts: 55

View user's profile Send private message

Out of ROM
PostPosted: Tue Feb 05, 2008 2:10 am     Reply with quote

Hello Super forum,

I have a mysterious thing.

I get a message " Out of ROM, a segment or the program is to large".

The message come when I make the program smaller!!
If I keep the "else" call of the function "calc_windows" the ROM use is 78%.

void limit_calc() //
{
if (new_calc == 1)
{
temp = read_eeprom(EE_c_limit_ok);
temp1 = read_eeprom(EE_o_limit_ok);
if ((temp == 0) && (temp1 == 0)) //
{
calc_windows();
}
}
else
{
calc_windows(); // If I remove this, the message - Out of ROM come
}
}
Foppie



Joined: 16 Sep 2005
Posts: 138
Location: The Netherlands

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Tue Feb 05, 2008 2:28 am     Reply with quote

you could try adding the #separate directive in from of your calc_windows() function.

like this:
Code:

#separate
void calc_windows()
{
...
}


If this works, your ROM is not to small, but your function gets to big to fit in one ROM area.
Mortenc



Joined: 22 Feb 2007
Posts: 55

View user's profile Send private message

PostPosted: Tue Feb 05, 2008 2:51 am     Reply with quote

Thanks a lot, it worked.

(sorry I'am new with C-programing)

Does this mean that the compiler try to make the code "inline" when the function is only called one time?

Will I get a mesage if there is stack overflow when I use "separate"?
Ttelmah
Guest







PostPosted: Tue Feb 05, 2008 3:16 am     Reply with quote

Yes. The optimiser will 'inline' anything only used in one place.
Look at the top of the .LST file. 9th line down, lists the stack useage. There is an error, if an ISR, will overflow the stack, but (obviously), you can turn this off, so the LST file is the real 'check'.

Best Wishes
Mortenc



Joined: 22 Feb 2007
Posts: 55

View user's profile Send private message

PostPosted: Tue Feb 05, 2008 4:15 am     Reply with quote

Ohh I like this forum.

Thanks a lot.
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