EmbeddedRelated.com
Forums

Checking routines to Large Flash device; datapattern

Started by Klaus Vestergaard Kragelund April 1, 2004
Hi

I have this 4Mbit Flash device that is connected to a 8051 type micro.

Well, I can program and read back the values fine. But I would like to check
the entire storage area of the device - also that all the addresses are
programmed correctly (the bank switching and so on)

My guess is to use my routines to program from address 0 to the max address
(bank switching is done with kernel routines)

But I need info on what data pattern I should use. I thought about using a
sine pattern that is NOT a multiple of the page size adresses. This way I
can check that that what I'm reading is not just another page programmed or
read incorrectly

Finally I would create a long stream of the entire contents and check there
are no discontinouties to the plot reading back the values to the PC

Any comments?

Thanks

Klaus


On Thursday, in article
     <406c0811$0$227$edfadb0f@dread12.news.tele.dk>
     klauskvik@hotmail.com "Klaus Vestergaard Kragelund" wrote:
>Hi > >I have this 4Mbit Flash device that is connected to a 8051 type micro. > >Well, I can program and read back the values fine. But I would like to check >the entire storage area of the device - also that all the addresses are >programmed correctly (the bank switching and so on)
With the reliability of most storage devices being several magnitudes better than they were 15 plus years ago, why check thoroughly ALL address on a flash device? The more thorough the test and more repeated the test the shorter you make the life time of the part. Complex memory testing algorithms doing many passes of reading and writing data to ALL locations. When saving data to the flash checksum the data before writing to flash write the data then the checksum, then checksum the flash contents. Which can be done on a section/sector and/or whole device basis.
>My guess is to use my routines to program from address 0 to the max address >(bank switching is done with kernel routines) > >But I need info on what data pattern I should use. I thought about using a >sine pattern that is NOT a multiple of the page size adresses. This way I >can check that that what I'm reading is not just another page programmed or >read incorrectly > >Finally I would create a long stream of the entire contents and check there >are no discontinouties to the plot reading back the values to the PC
There are two main factors that need to be tested that are more to do with testing the device is connected properly:- 1/ The data path is correct, so a pattern written is returned exactly on the same data lines (no shorts or open circuits or data buffer problems). 2/ The address lines work correctly so no one location exists at two or more addresses and no location is not addressed. DATA Path check (done first) If you have a small block that is likely not to be written to by your application, use this area for an RARELY done check on the data paths as follows:- erasing location, check zero, write pattern, dummy read a different VALID location on the bus, (this ensures no bus hold of value written being misread as the same valid data). then check the pattern. Patterns good start would be sliding 1 and sliding zero. Address Path check What you actually need to check is that each address line operates on its own correctly, so you only need to address binary boundaries (0,1,2,4,8....). In your case you may need to also need to do binary boundaries within EACH bank. So what I always do as a startup RAM test could be applied here, and a much reduced version is shown here.. a) Write order Address Data 0 1 1 2 2 3 4 4 (this is bad on multiplexed data/address busses) 8 5 16 6 b) Read a DIFFERENT location (maybe the special case data path test location) to stop data bus hold up problems. c) Read data back in REVERSE ORDER e.g. Address Read Data 16 6 8 5 4 4 2 3 1 2 0 1 Now you will notice that the address pointer is a shift function, and the data pattern is a simple increment on write and a simple decrement on read. The test can also be repeated as write a decremnting pattern and read the incrementing pattern back. This is simple to perform and I have done this in very small amounts of machine code loops several times. I have used this as a basis of simple RAM power up tests for over 10 years! Most of these tests I normally only bother with on RAM devices as power up tests only. Flash devices I normally do lots of 32bit checksums from 16bit reads of 8 bit devices, which catches all the errors I have needed to catch in my embedded applications. The only other test I do is a blank check after erase. The important factor is to checksum the data BEFORE writing to flash or checksum the original before it is written to flash, so the checksum is a checksum of the data not what was read back from the Flash. Sometimes due to insufficient RAM space I verify the flash contents after each section is written, then checksum the flash contents knowing the flash contents are valid. For extra belt and braces you can do CRC, hamming or other methods, but in all my applications if the data set is wrong, nearly all predictions of how to correct the error would be too much hassle compared with regenerating the data even for 1MB and larger parts. -- Paul Carpenter | paul@pcserv.demon.co.uk <http://www.pcserv.demon.co.uk/> Main Site <http://www.gnuh8.org.uk/> GNU H8 & mailing list info. <http://www.badweb.org.uk/> For those web sites you hate.
Klaus Vestergaard Kragelund wrote:
> Hi > > I have this 4Mbit Flash device that is connected to a 8051 type micro. > > Well, I can program and read back the values fine. But I would like to check > the entire storage area of the device - also that all the addresses are > programmed correctly (the bank switching and so on) > > My guess is to use my routines to program from address 0 to the max address > (bank switching is done with kernel routines) > > But I need info on what data pattern I should use. I thought about using a > sine pattern that is NOT a multiple of the page size adresses. This way I > can check that that what I'm reading is not just another page programmed or > read incorrectly > > Finally I would create a long stream of the entire contents and check there > are no discontinouties to the plot reading back the values to the PC
Depends how much resource you want to throw at the problem ? We have used the very simple, single line DataValue := 0FFH - (UpperAdrByte XOR LowerAdrByte); That gives a pattern that is the inverse of address LSB's, that also rolls on every page - so stuck address bits / open data busses / coverage bloopers etc are caught. In use, you first write the whole device, then a second pass reads/verifies. -jg