I am testing a board that has external SRAM. Apparently the SRAM is relatively sensitive to the soldering heat from the manufacturing process, and so careful testing must be done to check integrity of SRAM for newly manufactured boards.

What is the best (bare-metal) way to test SRAM? I have a driver that initialises the SRAM for read/write access. My first thought is to run tests such as:

1) Set all bits in SRAM to 1, and check that the SRAM was properly written. 2) Write the digits of Pi in SRAM, and check that the write was done properly.

Are there other kinds of tests I should consider?

  • 4
    \$\begingroup\$ How to test RAM article by Jack Ganssle \$\endgroup\$ Commented Mar 15, 2012 at 16:27
  • 1
    \$\begingroup\$ There are many RAM tests available. Some will be specific to the organisation of the RAM that you are using. BUT what you really need to do is to determine the conditions that the RAM should be soldered under and monitor your production line to ENSURE that these conditions are net.And then test it as well :-) \$\endgroup\$
    – Russell McMahon
    Commented Mar 15, 2012 at 16:40
  • \$\begingroup\$ @JobyTaffey, Glad I am not the only one whom loves Ganssle. \$\endgroup\$
    – Kortuk
    Commented Mar 15, 2012 at 18:31

1 Answer 1


I've written some RAM tests before that have roused up some errors. Here's what I did:

Data bus integrity - are all the data lines connected? First, write all 0's to an address and read it back, ensure it's all 0's. Second, write all 1's to a memory location, read it back and ensure all 1's. This will quickly tell you if one of your lines is simply not connected. But that's not the whole story. It could be that several lines are bridged to each other or to VCC or ground. That why you do the next test as well.

Walking 1's/walking 0's test - The idea is to exercise each bit in your data line and only that bit. So if you have an 8-bit wide data bus then you start by writing 00000001 to a memory address, then reading it back and verifying you get the same value, then 00000010, then 00000100 and so on, writing a 1 on each line individually until you've tested each line. Then you do a walking 0's test: first write 11111110 and confirm, then 11111101 and confirm, etc.

This test can be done just once - you don't need to repeat it for every memory address you have - it only ensure the data bus is properly connected.

Address line integrity - To test the address bus you have to write a unique value into each memory address you can access, then go back and verify that the data in each address is correct. If your address lines aren't correct you'll see incorrect data retrieved from memory. For instance, let's say that I have 8 memory addressing lines and the first one is shorted to VCC. If I try to write to location 00000000 it will actually write to 00000001 because of the short. Then I'll try to write to 0x01 to 00000001 and it will work. However, when it comes time to check the data in each address if I try to access location 00000000 I will actually access location 00000001 because of the short, and retrieve a value of 0x01 instead of 0x00 and immediately catch the error.

It's overkill but it has detected some insidious errors that would have tripped us up to a great degree.

What the above tests will NOT do is tell you if any of your address lines are messagese tests will NOT do is tell you whether

  • \$\begingroup\$ I like this suite of tests, the only change I would suggest it that they do indeed want to do the walking zeroes/ones test on all memory locations, as there are concerns for damage to the SRAM itself if I read the question correctly. \$\endgroup\$
    – Tevo D
    Commented Mar 15, 2012 at 19:20
  • 1
    \$\begingroup\$ Thanks for this. I really do not understand your last sentence. Could you please clarify? \$\endgroup\$
    – Randomblue
    Commented Mar 27, 2012 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.