ModusToolbox Safety Test Library
Loading...
Searching...
No Matches

General Description

Functions

uint8_t SelfTest_SRAM_Stack (uint8_t *stackBase, uint32_t stackSize, uint8_t *altStackBase)
 This function performs the self test on Stack.

Function Documentation

◆ SelfTest_SRAM_Stack()

uint8_t SelfTest_SRAM_Stack ( uint8_t * stackBase,
uint32_t stackSize,
uint8_t * altStackBase )

This function performs the self test on Stack.

It can detect stuck-at faults and direct coupling faults. The RAM tests are destructible in nature, so this function copies the stack in use to the provided RAM area. Once the test is completed, the stack is copied back to its original location. Because of the RAM destructible behavior, it is advisable to disable the interrupts before starting the test.

Parameters
stackBaseThe pointer to the Stack Base.
stackSizeThe size of Stack.
altStackBaseThe pointer to the start of the RAM area to use as an alternate Stack Base. RAM address from altStackBase to (altStackBase - stackSize) is used to store/restore the Stack under test. The existing content of this area will be destructed and this area must not overlap with the Stack under test. The platform might set stack limit using __set_MSPLIM, ensure that the alternate stack is within the stack limit set by the platform
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Test failed