Ram Test - ramtst module of AUTOSAR


After reading this article you'll understand
  1.  What is ram test and why it is required?.
  2.  How to perform ram test .
  3.  RamTst module in Autosar architecture.
  4.  Autosar RamTst Configuration in detail.

1. Introduction:

Ram test module is intended to test physical Ram cells. Ram test module monitors physical ram cell and find out whether cell is corrupted or not. (stuck at zero, stuck at one etc.) Generally ram test is performed at initialization time of micro-controller to detect faults in ram memory, if there is any fault then system shall be put in safe state. Also at run-time ram is performed to check error occurred after initialization in ram cells.

How does ram test module monitors ram cell?. Ram test module monitors by writing some pattern to memory and reading the contents of memory, if the memory hold same value/pattern which was written then there is no error else there is an error. There are multiple algorithms to perform ram test and different algorithms covers different faults and execution time. 

In AUTOSAR ram test SWS it is mentioned, ram test can be performed at initialization time (Foreground test) or at run time (Background Test).

Foreground Test: Complete ram is tested with all interrupts disabled. i.e. no other task will execute until ram test is complete.

Background Test: Ram is tested periodically (e.g. every 10ms) and in each period/cycle part of ram is tested with all interrupts disabled. 

E.g. Consider a system has 1Kb (0x00000000 to 0x000003FF)of ram  as shown in below image.

Fig 1. Ram Memory 

In foreground mode, ram test module will test 1Kb ram in one shot.While in background mode ram test module will test part of ram (i.e.consider 256 bytes in one call then in next call next 256 bytes) till end address. After reaching end address ram test will start from starting address.

2. Ram test algorithm:

Many algorithms are available to test ram memory. Here we are going to discuss MATS algorithm. In MATS algorithm 0s are written to memory from start to end address of RAM. Then memory contents are read again from start address to end address of RAM if memory contents are same i.e 0 then there is no fault. Again same test is repeated for another pattern in which 1s are written to memory and read back.

step 1. Write 0s to memory
step 2. Read memory
step 3. Compare read memory with 0
step 4. If step 3 true then go-to step 4 else go-to step 9  
step 5. Write 1s to memory
step 6. Read memory
step 7. Compare read memory with 1
step 8  If step 7 true return true else go-to step 9
step 9. return error  

3. Configuration of ramtst in Autosar:

One must configure Ram Test init function, as without init function ram test will not work. To perform ram test background RamTst_Allow() API must be called, before calling this API if you want perform foreground test. While configuring ram test in AUTOSAR environment, one must know size of ram under test, size of 1 cell (1 bit or 32 bit etc), how many bits to test in one call (in case of background test), what is the frequency (period) of function  to test ram (in case of background test). Which algorithm to use for ram test.

Following are some sample configuration of ramtst module
  1. Min. No. of tested cells           : 32bits
  2. cell size                                   : 1bit
  3. Start address                          : Ram start address                 
  4. End address                           : Ram end address
  5. Algorithm                                : MATS
  6. No. of tested cells                   : 1024

Below image shows location of RamTst module in AUTOSAR architecture.

 Fig.2 Ram Test Module in AUTOSAR Architecture


Post a Comment

  1. In Section 2 RAM TEST ALGORITHM,

    if the step 8 returns false, then only step 9 gives the error. Correct me if I'm missing anything.

Post a Comment
To Top