$60 off LOAD-n-GO Handheld Programmer
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 support@ccsinfo.com

Out of ROM, A segment or the program is too large

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







Out of ROM, A segment or the program is too large
PostPosted: Tue Apr 19, 2005 5:56 am     Reply with quote

Hi!
When I compile the compiler says that the program is too large but I know that it's not because I have counted the size of the functions and know that it will fit in the ROM. Now to the problem..I'm using a bootloader and the bootloader can not be changed. This bootloader do not write to some addresses witch is wrong so I have to keep the compiler from placing code in that area. There is free space in the segments but still the compiler trys to place code in the forbidden area or something. Here is the err file

    @DIV88
    Seg 00000-00003, 0000 left, need 0017
    0000
    Seg 00004-00044, 0000 left, need 0017
    0000
    Seg 00045-00047, 0003 left, need 0017
    0000
    Seg 00048-0011A, 0007 left, need 0017
    0000
    Seg 0011B-001FF, 00E5 left, need 0017
    0000
    Seg 00200-007FF, 0600 left, need 0017
    0000
    Seg 00800-0081F, 0010 left, need 0017
    0000
    Seg 00820-0082F, 000B left, need 0017
    0000
    Seg 00830-0083F, 000B left, need 0017
    0000
    Seg 00840-00B3F, 0300 left, need 0017
    0000
    Seg 00B40-00FFF, 01F2 left, need 0017
    0000
    Seg 01000-017FF, 0800 left, need 0017
    0000
    Seg 01800-01FFF, 07D9 left, need 0017
    0000

As you can see there is space left in the segments but how can I tell the compiler to place @DIV88 in some segment that is free? There is plenty of room for @DIV88 in Seg 01800-01FFF why don't the compiler try to put it there?
Using CCS version 3.214 and a PIC 16F877A

//EMP
steve.booth



Joined: 18 Oct 2004
Posts: 7

View user's profile Send private message

Out of ROM Space
PostPosted: Tue Apr 19, 2005 6:51 am     Reply with quote

I have seen this before, quite common really.
The problem is that the CCS compiler generates 'one big file' when you compile your code. If you know the hardware inside your PIC, e.g. say a pic16f876, although you have 8k ROM, you actually have 4 x 2k ROM, and your code (specifically a single function) will not span across the ROM memory pages. What you need to do is reduce the size of your function(s), (main doesn't count onviously). This can be done by splitting off functions specifically into subroutine calls rather than in-line , use the #SEPARATE directive infront of the function ( and it's prototype )

This will allow the compiler to fit the code mode efficiently.
_________________
Steve
steve.booth



Joined: 18 Oct 2004
Posts: 7

View user's profile Send private message

Out of ROM Space
PostPosted: Tue Apr 19, 2005 6:53 am     Reply with quote

I have seen this before, quite common really.
The problem is that the CCS compiler generates 'one big file' when you compile your code. If you know the hardware inside your PIC, e.g. say a pic16f876, although you have 8k ROM, you actually have 4 x 2k ROM, and your code (specifically a single function) will not span across the ROM memory pages. What you need to do is reduce the size of your function(s), (main doesn't count onviously). This can be done by splitting off functions specifically into subroutine calls rather than in-line , use the #SEPARATE directive infront of the function ( and it's prototype )

This will allow the compiler to fit the code mode efficiently.
_________________
Steve
steve.booth



Joined: 18 Oct 2004
Posts: 7

View user's profile Send private message

Out of ROM Space
PostPosted: Tue Apr 19, 2005 6:57 am     Reply with quote

I have seen this before, quite common really.
The problem is that the CCS compiler generates 'one big file' when you compile your code. If you know the hardware inside your PIC, e.g. say a pic16f876, although you have 8k ROM, you actually have 4 x 2k ROM, and your code (specifically a single function) will not span across the ROM memory pages. What you need to do is reduce the size of your function(s), (main doesn't count onviously). This can be done by splitting off functions specifically into subroutine calls rather than in-line , use the #SEPARATE directive infront of the function ( and it's prototype )

This will allow the compiler to fit the code mode efficiently.
_________________
Steve
steve.booth



Joined: 18 Oct 2004
Posts: 7

View user's profile Send private message

Out of ROM Space
PostPosted: Tue Apr 19, 2005 7:01 am     Reply with quote

I have seen this before, quite common really.
The problem is that the CCS compiler generates 'one big file' when you compile your code. If you know the hardware inside your PIC, e.g. say a pic16f876, although you have 8k ROM, you actually have 4 x 2k ROM, and your code (specifically a single function) will not span across the ROM memory pages. What you need to do is reduce the size of your function(s), (main doesn't count onviously). This can be done by splitting off functions specifically into subroutine calls rather than in-line , use the #SEPARATE directive infront of the function ( and it's prototype )

This will allow the compiler to fit the code mode efficiently.
_________________
Steve
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message

PostPosted: Tue Apr 19, 2005 7:59 am     Reply with quote

Steve, They have many brands of de-caffeinated coffee that are very tasty.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Apr 19, 2005 10:00 am     Reply with quote

There is also the option to delete or at least edit those multiple posts Smile
Guest








Out of ROM Space
PostPosted: Tue Apr 19, 2005 10:58 am     Reply with quote

I have seen this before, quite common really.
The problem is that the CCS compiler generates 'one big file' when you compile your code. If you know the hardware inside your PIC, e.g. say a pic16f876, although you have 8k ROM, you actually have 4 x 2k ROM, and your code (specifically a single function) will not span across the ROM memory pages. What you need to do is reduce the size of your function(s), (main doesn't count onviously). This can be done by splitting off functions specifically into subroutine calls rather than in-line , use the #SEPARATE directive infront of the function ( and it's prototype )

This will allow the compiler to fit the code mode efficiently.
Guest








Out of ROM Space
PostPosted: Tue Apr 19, 2005 10:58 am     Reply with quote

I have seen this before, quite common really.
The problem is that the CCS compiler generates 'one big file' when you compile your code. If you know the hardware inside your PIC, e.g. say a pic16f876, although you have 8k ROM, you actually have 4 x 2k ROM, and your code (specifically a single function) will not span across the ROM memory pages. What you need to do is reduce the size of your function(s), (main doesn't count onviously). This can be done by splitting off functions specifically into subroutine calls rather than in-line , use the #SEPARATE directive infront of the function ( and it's prototype )

This will allow the compiler to fit the code mode efficiently.
DragonPIC



Joined: 11 Nov 2003
Posts: 118

View user's profile Send private message

PostPosted: Tue Apr 19, 2005 11:26 am     Reply with quote

feeling like a broken record?
_________________
-Matt
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