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

Locate compiler's scratchpad and generated variables

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



Joined: 15 Jun 2005
Posts: 1

View user's profile Send private message

Locate compiler's scratchpad and generated variables
PostPosted: Wed Jun 15, 2005 11:17 am     Reply with quote

My project is to have my code split in two parts :
1) A LOADER : This part does not change over time. It is basically the low-level routines (Serial line, I2C, internal E2PROM and external E2PROM,… ) plus code to update the application code (2) over a modem. This LOADER is placed in the upper part of the memory (#org) and once defined it cannot be changed.

2) The APPLICATION code, which does change over time and is to be downloaded. This APPLICATION (2) is sharing code with the LOADER (1).

When compiling the APPLICATION (2), the LOADER code (1) is included so the linker knows were they are located.

The problem is with RAM.
Using « typemod » and « #type default= … », it is rather easy to define a « protected » memory segment.
All RAM variables related to the LOADER functions (global, local and function parameters) are located within my protected segment.
*BUT*
- the ram for the compiler generated code
- the compiler’s scratchpad variables for my loader code
are always located outside the protected segment.

Therefore, every time I modify the APPLICATION code and recompile, the locations of these variables can be modified. When uploading a recompiled APPLICATION, there can be a mismatch between where the LOADER « thinks » his variable are, and their actual location. Mad

Question
Does anyone have a trick to locate the compiler’s scratchpad variables at a given address in RAM ? (But only for part of the program’s functions – not by modifying the device file)
Question
Same question for the variables defined by the compiler generated code ?
(Other than rewriting my own set of functions) Smile

PIC18F6720 - PCH v3.225

Many thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 15, 2005 2:31 pm     Reply with quote

The #org statement has a parameter "Auto=0" which may help.
It is described in the manual.
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