CRC - for 32kb flash?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CRC - for 32kb flash?

2,890 次查看
prasadvr
Contributor I
Hi,
 
I am currently using a HCS08 controller with 32kb flash. I have to implement CRC as part of Flash Checksum test at power up. I was a bit confused on what size CRC polynoomial to use?  By using a 32-bit CRC am I overdoing it? Is 8-bit CRC sufficient for 32kb flash? Is it dependent on the size of the memory or a higher order CRC is just increasing the reliability?
标签 (1)
0 项奖励
回复
3 回复数

1,355 次查看
tonyp
Senior Contributor II
I'd go with CRC-16.  CRC-8 is too weak and CRC-32 is probably an overkill.  Of greater importance is which polynomial to choose.  I'd go with one of the standard ones (e.g. CCITT) that are known to work well.

The discussion for what length to choose is rather long but, put simply, it has to do with several factors, such as the overall length of your data, the number of errors that may occur simultaneously (so they don't cancel each other out when computing a CRC), how far apart these are likely to be, etc.

If there aren't any specific stringent requirements, I have a simple rule of thumb: pick a CRC of (about) as many bits as the bits of the address space to protect (e.g., CRC-16 for up to 2^16 bytes).
0 项奖励
回复

1,355 次查看
prasadvr
Contributor I
Hi Tony,
 
Thanks for the information. But still if I use CRC-16, I am ending up with higher processor time utilization. To avoid, I am planning to divide 32kb into 64 blocks of 256 bytes and have a CRC-8 checksum for each of them. Though this will consume memory(which is currently not a constraint), I would save a lot of processing time.
 
Any comments.
0 项奖励
回复

1,355 次查看
tonyp
Senior Contributor II
That should work. But I'm not sure you'll gain any processing if you consider the added overhead of dealing with multiples CRCs rather than one.  Since memory isn't an issue, you could use a table-driven CRC routine to improve on speed.
0 项奖励
回复