In this article we will discuss about the RAM Test module in Autosar. RAM test is performed to understand the state of the physical RAM location. RAM Test is performed by writing a known sequence in a RAM location and reading it back and testing whether the read sequence is the same as the one written. There are algorithms which also require the testing of the adjacent RAM locations. RAM test is not meant to test the content of RAM. During the execution of a RAM test algorithm, no other software shall be allowed to modify the RAM area under test.
There are different types of RAM test algorithms which deliver different level of coverage, have different runtime behavior and are either destructive or non-destructive. Coverage can be Low(60%), Medium(90%) or High(99%). ECU safety analysis is required to decide which coverage level is required. Non-Destructive algorithms are the one in which the RAM area is saved before the module modifies the RAM location and the area is restored after the test.
Performed synchronously by the test environment. Foreground test cannot be interrupted. RamTst_RunFullTest or RamTst_RunPartialTest api is used to perform the foreground test with one algorithm. Full and Partial refers to Full or Partial memory. RamTst_MainFunction is not scheduled in case of foreground testing. As there is a possibility of testing larger memory areas without interruption the fault coverage of foreground tests is mostly better than of background test for the same algorithm.
Performed asynchronously by cyclically calling the RamTst_MainFunction. Background test is interruptible. In background test, the complete RAM test with a single algorithm is split over many scheduled MainFunction calls. RamTst_MainFunction is interruptible but it is made up of one or more uninterruptable pieces of code. The number of cells that can be tested in one uninterruptable sequence is considered as implementation specific. When the testing for the configured number of RAM cells is completed, RamTst_MainFunction issues a notification and continues the testing from the first block. If there is an error during testing a notification is issued and the testing continues.
Different algorithms can be used to perform the Foreground and the Background test.