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 support@ccsinfo.com

ICD2 stops working when program is at 98 to 99% ROM

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







ICD2 stops working when program is at 98 to 99% ROM
PostPosted: Tue Aug 31, 2004 5:46 am     Reply with quote

First time i experienced this. I'm using a PIC18F252. The ICD2 worked fine, til I hit around 98 to 99% rom usage. Then it stopped working at the main() statement. However, when I program the chip and let it run freely w/o the ICD2, all is fine.

My worst case stack usage is supposedly only 8 deep. I believe i can go to 32 deep. I suspect that the ICD2 debug executive is overwriting some of my code. Anyone have this happen to them?
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Tue Aug 31, 2004 7:09 am     Reply with quote

Remember, ICDs put a small piece of code at the end of memory of the target to enable the debugging and communication with the ICD board.
I'm not sure about ICD2, but in the case of CCS ICDS, for the PIC18 series, the size of this module is around 800 bytes.
Ttelmah
Guest







Re: ICD2 stops working when program is at 98 to 99% ROM
PostPosted: Tue Aug 31, 2004 7:19 am     Reply with quote

valemike wrote:
First time i experienced this. I'm using a PIC18F252. The ICD2 worked fine, til I hit around 98 to 99% rom usage. Then it stopped working at the main() statement. However, when I program the chip and let it run freely w/o the ICD2, all is fine.

My worst case stack usage is supposedly only 8 deep. I believe i can go to 32 deep. I suspect that the ICD2 debug executive is overwriting some of my code. Anyone have this happen to them?

Read the ICD2 data sheet.
Under the 'trade-offs' section, it says:
Use of some target system resources, such as I/O pins, program memory, and stack space.
The .hex file uploaded to the ICD, shows the area being used. I'm suprised you can get as high as 98% before hitting problems. This is the classic 'downside' of the ICD, versus the ICE systems.

Best Wishes
valemike
Guest







PostPosted: Tue Aug 31, 2004 7:43 am     Reply with quote

Thanks guys.
Is there a way to tell the compiler to "keep-out" of the last bytes that the ICD will use? Albeit, i'll get a compilation error telling me i'm out of ROM, but i'm just wondering if it's possible.

-Mike
alexbilo



Joined: 01 Jun 2004
Posts: 39
Location: Trois-Rivières

View user's profile Send private message

PostPosted: Tue Aug 31, 2004 9:01 am     Reply with quote

To reserve memory you can use #org start,end {}

This way you reserve the specified block and you don't write any data in it. You'll get the Out of ROM error, but at least you'll know when your code is too big! Smile
_________________
Alex
Mark



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

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

PostPosted: Tue Aug 31, 2004 11:08 am     Reply with quote

Did you specify ICD=TRUE ?
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