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, A segment or the program is too large: main
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 20, 2013 1:40 pm     Reply with quote

Quote:
initializePIC();
start_up();
ready_sleep();
battery_monitor(SLEEP_AH);
wireless_tx(1,5);
wireless_rx();

One or more of these functions is too large. I would guess that it's
probably wireless_tx() and/or wireless_rx().

Just split the components of those functions up. Example:
Currently you likely have this (One big function):
Code:

void wireless_tx(int parm1, int parm2)
{
.
.
.
.
.
}


Try to split up wireless_tx() into two or more smaller functions. Example:
Code:
func1()
{
.
.
.
}

func2()
{
.
.
.
}

func3()
{
.
.
}


void wireless_tx(int parm1, int parm2)
{
.
func1(parm1);
.
.
func2(parm2);
.
func3();
.
.
}

I didn't show all the parameters or return values, just to keep it simple.

If you split up your large functions, the compiler will probably be able
to pack the smaller pieces so they efficiently fill up each 2KB code page.
Your PIC has code pages of 0x800 bytes. Functions can not be larger
than the code page size. That's the key issue that you have to deal with.
io_Joe



Joined: 20 Nov 2013
Posts: 5

View user's profile Send private message

PostPosted: Wed Nov 20, 2013 2:03 pm     Reply with quote

thank you.

I will try that, I am running on #separate prior to main now.. but I feel uneasy doing that... I will try your suggestion.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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