DIAG_SRAM_MarchC_Minus

Software Requirement Reference ID : SW_SRAM_MARCH_TEST_01.

This API implements the March-C Minus algorithm, converted to a Word Oriented Memory (WOM) test. See the SRAM_MARCH_TEST Assumptions of Use (AoU) section for a full description of how this API should be used.

The test is destructive, meaning that all data stored in SRAM will be permanently deleted when the test is completed, to ensure full test coverage of the listed Coupling Faults (CFs).

If the stack pointer (SP) is set equal to the SRAM_END_ADDR and the API is subsequently called before any other function in the .init0 section, the API can detect all the listed failure modes for the entire SRAM used by the application, including the stack area (located in SRAM), and return normally as the return address is backed up. As the test is performed in the .init0 section, before any other function calls, no application data is lost as this is loaded into SRAM at a later stage in the startup code.

The API supports the possibility to verify smaller sections of the SRAM, such as an array, in the application code as an additional periodic check check. However, be warned that such usage is not covered by the SRAM_MARCH_TEST AoU. This is because certain CFs between a memory cell under test and a memory cell left out of the test might not be detected. Moreover, note that the data on all the SRAM addresses tested will be permanently overwritten. If used in this way, it is advisable to back up the data stored in the memory under test to another place in SRAM and restore it after completion of the test. Such usage of the API can be done from anywhere in the application code. However, it is not adviseable to include the stack area of SRAM when useing the API in this way. If the stack area is not included, the API can be called without setting the SP to SRAM_END_ADDR first. Finally, note that the main clock frequency will be set to the default value after the test is completed.

The API supports the possibility of changing the execution time of the March-C Minus WOM algorithm by two different mechanisms, if desireable to meet certain deadlines as outlined by the SRAM_MARCH_TEST AoU:

  • Restricting the SRAM size used by the application, see SRAM_DATA_REGION_LEN for more information
  • Changing the main clock frequency used when executing the test, see SRAM_DATA_REGION_LEN for more information The test will not run if the WDT Reset Flag is set to ensure compatability with the Watchdog Timer diagnostic tests.
The test is executed with the following steps:
  • Back up the return address from stack
  • Abort test if the WDT reset flag is set
  • Verify that the input parameters are valid
  • Set the main clock frequency to the value configured by SRAM_MARCH_CLK_FRQ
  • Run the inter-word test
  • Run the intra-word test
  • If the stack is part of the test, restore the return address
  • Restore the main clock frequency to the default value out of reset
  • Store the result of the test in a persistent variable

If an error is detected while executing any of the March elements, the return address is restored (when applicable) and the main clock frequency is restored to the default value before returning as fast as possible.

The March-C Minus WOM test algorithm performed by executing the following march elements:

  • Start of inter-word test:
  • M0 up (w00000000);
  • M1 up (r00000000,w11111111);
  • M2 up (r11111111,w00000000);
  • M3 down (r00000000,w11111111);
  • M4 down (r11111111,w00000000);
  • Start of intra-word test:
  • M5 down (r00000000, w01010101);
  • M6 up (r01010101, w10101010);
  • M7 down (r10101010, w01010101);
  • M8 up (r01010101, w00110011);
  • M9 down (r00110011, w11001100);
  • M10 up (r11001100, w00110011);
  • M11 down (r00110011, w00001111);
  • M12 up (r00001111, w11110000);
  • M13 down (r11110000, w00001111);
  • M14 up (r00001111);

Error reporting:

DIAG_SRAM_MarchC_Minus_GetStatus should be called from main to know the result of of SRAM March-C Minus test

void DIAG_SRAM_MarchC_Minus(
    register uint8_t * startAddress,    register uint16_t length
)

Parameters

startAddress register uint8_t *

The start address of the memory under test.

length register uint16_t

Defines the size of the memory under test.

Returns