View previous topic :: View next topic |
Author |
Message |
Mortenc
Joined: 22 Feb 2007 Posts: 55
|
Out of ROM |
Posted: Tue Feb 05, 2008 2:10 am |
|
|
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
|
|
Posted: Tue Feb 05, 2008 2:28 am |
|
|
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
|
|
Posted: Tue Feb 05, 2008 2:51 am |
|
|
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
|
|
Posted: Tue Feb 05, 2008 3:16 am |
|
|
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
|
|
Posted: Tue Feb 05, 2008 4:15 am |
|
|
Ohh I like this forum.
Thanks a lot. |
|
|
|