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

CRC16 for program integrity

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



Joined: 13 Oct 2010
Posts: 5

View user's profile Send private message

CRC16 for program integrity
PostPosted: Wed Oct 13, 2010 9:29 pm     Reply with quote

Hi,

I'm trying to perform a CRC16 on the program memory (14bit-core Flash). However, all the sample code/documents I found was CRC16 on 8bit data.

Anyone with sample code/documents/ideas for performing crc16 on 14bit data (Program memory/Flash)??

I tried to modify the int16 generate_16bit_crc(char* data, int16 length, int16 pattern) function found in the PIC drivers folder. However the result does not tally with the crc16 generated by #rom getenv("Program_memory")-1 = crc16. Anyone with sucessfully history??

Thanks in advance....
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 13, 2010 9:43 pm     Reply with quote

Look at this file:
Quote:

c:\program files\picc\examples\ex_checksum.c

If that doesn't help, then post your compiler version.
ferlyn



Joined: 13 Oct 2010
Posts: 5

View user's profile Send private message

PostPosted: Wed Oct 13, 2010 11:45 pm     Reply with quote

Hi,
Thanks for the advise...

ex_checksum.c is using
#rom getenv("Program_memory")-1 = CHECKSUM
I already tested the checksum method, it is working.

however, i would like to use
#rom getenv("Program_memory")-1 = crc16
ferlyn



Joined: 13 Oct 2010
Posts: 5

View user's profile Send private message

PostPosted: Fri Oct 15, 2010 12:29 am     Reply with quote

Hi,

Anyone with sucessful history on using

"#rom getenv("Program_memory")-1 = crc16"

for checking program memory???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 15, 2010 12:21 pm     Reply with quote

You could have stated your problem better. I thought this was just some
invention of yours. In fact, it's in the manual. Your real question is,
"Does anyone know the algorithm that the CCS compiler uses to generate
the crc16 as described in the #ROM section of the manual ?".

Once I figured out what you wanted, I had a hunch. I used Google to
search the CCS website, exclusive of the forum, using this string:
Quote:
site:ccsinfo.com -forum crc16

Then I got this:
http://www.ccsinfo.com/pdfs/CRC_Source_Code.pdf
This looks like it might be what you want. I don't guarantee it, but it
looks like a good bet.
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