s12xe - RAM FAULT MONITOR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s12xe - RAM FAULT MONITOR

1,665 Views
Xbot
Contributor II
Hello all,
 
Whe're implementing codes for automotive industry, anybody here have tried to create a functionality to monitor RAM faults (RAM FAULT MONITOR)? Any suggestions on how to go about this? Is there any standard function name conventions(e.g. autosar)? 
 
thanks.
 
 
 
 


Message Edited by Xbot on 2008-02-21 07:59 AM
Labels (1)
0 Kudos
3 Replies

397 Views
colinh
Contributor I
Hi

How you write your code depends on your level of paranoia :smileywink:

Assuming you dont want to block execution while test a large amount of RAM then you have do to it one (or a few) location(s) at a time.  This implies that some variables will be kept in RAM - what if these locations have failed, or fail during the test?

The following is designed mainly for on-chip RAM as it isn't trying to pick up faults in shorted address lines etc.

Basic concept (and please read this as psuedo code):

Init:
    uint8 volatile *testPtr = (uint8 *)(RAM_START_ADDRESS);

Process:                                 // do this one or more times per pass
   DISABLE_INTERRUPTS;
   uint8 savedData = *testPtr;
   *testPtr = 0x55;                               // try writing 0x55
   if(*testPtr != 0x55) RamFault;
   *testPtr ^= 0xFF;                              // complement
   if(*testPtr != 0xAA) RamFault;

   *testPtr = savedData;
   testPtr++;
   if(testPtr > (uint8 *) RAM_END_ADDRESS)
   {
       testPtr =  (uint8 *)(RAM_START_ADDRESS)  
   }
   ENABLE_INTERRUPTS


0 Kudos

397 Views
colinh
Contributor I
I wont start on the dubious benefits of RAM self checks in automotive designs, the great majority of which are single chip with on all RAM contained within the micro.  20yrs in the automotive game and I still haven't heard of a RAM failure.

Questions:
- Only at power up or continuous testing?
- Internal or external RAM?

I assume you are going to try and test for a completely dead RAM cell that cannot hold its contents for more than a couple of instruction cycles? 

Colin



0 Kudos

397 Views
Xbot
Contributor II
q1: (Always running) a self test program that can diagnose and detect failures of the RAM.
q2: Internal. Expandable perhaps
0 Kudos