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

Embedding build numbers

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



Joined: 15 Mar 2005
Posts: 12

View user's profile Send private message

Embedding build numbers
PostPosted: Tue Mar 15, 2005 1:57 pm     Reply with quote

Greeting:

Is there a convenient way to embed a build or version number in a Hex file and retrieve it? I'm having trouble keeping track of what code is where in several development platforms. I have found how to retrieve the program hex file with the ICD Control Program V2.12, but I am not sure if there is an approved manner to handle such information within these files.

Thanks for your thoughts,
Doug
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 15, 2005 2:18 pm     Reply with quote

See if this thread helps:
http://www.ccsinfo.com/forum/viewtopic.php?t=1107&highlight=build
languer



Joined: 09 Jan 2004
Posts: 144
Location: USA

View user's profile Send private message

Excellent tip
PostPosted: Wed Mar 16, 2005 2:50 am     Reply with quote

Excellent tips. Thanks! Very Happy
dpaul



Joined: 15 Mar 2005
Posts: 12

View user's profile Send private message

HEX file format for Orged Value
PostPosted: Wed Mar 16, 2005 7:55 am     Reply with quote

Orging a string or a value is an excellent idea. I still need some help deciphering the .HEX file format so I can read the embedded identifier.

Here’s a test: I defined the following easily locatable array:

#org 0x1FD0, 0x1FDF
const char BuildNumber [] =
{
0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07
};

Examining the very short .HEX file in my test program, I can pick out the following record which has my BuildNumber data in it.

:103FA0008207003401340234033404340534063407

Can anyone tell me what the record format is in the .HEX file? This record was locatable because the test program was very short (only a dozen lines in the .HEX file), and the array values known. Obviously finding the BuildNumber record would be much more daunting in a real program. This record, surprisingly, was in the middle of the .HEX file despite being Orged at the end of memory. I would have thought/hoped the #org statement would have physically located it at the end of the .HEX file making it easy to manually pick out, but obviously that was only a guess, and a wrong one at that.

Again, thanks for any help.

Doug
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Wed Mar 16, 2005 2:11 pm     Reply with quote

I use printf(__DATE__ __TIME__)
LomasS
Guest







PostPosted: Wed Mar 16, 2005 4:17 pm     Reply with quote

The .Hex file format is an Intel hex file, characterised by the initial ':' search the internet for 'Intel Hex File Format' or similar for lots of descriptions.

Steve.
RossJ



Joined: 25 Aug 2004
Posts: 66

View user's profile Send private message

PostPosted: Wed Mar 16, 2005 5:48 pm     Reply with quote

The reason why you are seeing 34s in there is because of the way CCS C implements const arrays. 0x34 is the upper byte of the return with literal in W instruction (on a 16 series PIC). If all you want is to see the raw hex bytes, try the #rom directive instead of a const array.
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