Memory signature follow-up

I recently posted some thoughts about handling non-volatile RAM - dealing with the recognition of memory that had not been initialized. I was very pleased to hear from a reader, Bert Böhne in the Netherlands, who has some experience in this matter:

“In a current project we do the same. We have some non-volatile memory for settings. After each set of data we also defined one byte for a crc. When we write a set of data, we calculate the crc and write it to the memory. Each time when read a set of data we also calculate the crc. Then we check if the calculated crc is the same as crc which is read back. When the board comes from the fabric the memory data is 0×00 on each address. The calculation of the crc will then return 0×00. This would cause a match of calculated and read back crc. To overcome this, we added an offset to the crc calculation. By doing this we now that we already wrote a set of data, and that the data is correct.”

Preparing Recommendations

This is a very simple and elegant solution to the problem. My approach of using a signature enabled the state of the RAM to be determined very quickly [by interrogating a 32 bit value], without having to do an checksum or CRC calculation. I am just wondering whether in this case they can just check that the CRC is non-zero to see that the RAM is not initialized?

More Blog Posts

About Colin Walls

Colin WallsI have over twenty-five years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, I am a member of the marketing team of the Mentor Graphics Embedded Systems Division, and am based in the UK. Away from work, I have a wide range of interests including photography and trying to point my two daughters in the right direction in life. Visit The Colin Walls Blog

Follow on Twitter

More Posts by Colin Walls

Preparing Recommendations

Comments

No one has commented yet on this post. Be the first to comment below.

Add Your Comment

Please complete the following information to comment or sign in.

(Your email will not be published)

Archives

Tags

RSS