1.49 CLASSB_SelfTest_FailSafe

Function

void CLASSB_SelfTest_FailSafe(CLASSB_TEST_ID test_id);

Summary

This function is called if any of the non-critical tests are failed.

Description

The self-tests for SRAM, Clock and Interrupt are considered non-critical since it may be possible to execute a fail-safe function after detecting a failure, if the fail-safe routine does not use the failed element on the microcontroller. Default implementation of this function is available in classb.c file. The function contains an infinite loop. Further code shall be added as per the application need.

Precondition

None.

Parameters

test_id - Identification number of the failed test.

Returns

None.

Example

if (classb_sram_status == CLASSB_TEST_FAILED)
{
    CLASSB_SelfTest_FailSafe(CLASSB_TEST_RAM);
}

Remarks

This function must not return to the Class B library since it is called due to a self-test failure. Avoid using features which depend on the failed component. For example, if self-test for clock is failed, it is not advisable to use UART for error reporting since BAUD rate may not be accurate. In the case of SRAM failure, avoid the use of function calls or variables in SRAM. The error reporting mechanism in this case can be an IO pin.