SPRADS4 October   2025 TDA4VM

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Instructions
    1. 2.1 Scope
    2. 2.2 HWA Instruction Definition
    3. 2.3 Fault Injection Procedure
      1. 2.3.1 Block Diagram
      2. 2.3.2 Fault Injection: Steps
        1. 2.3.2.1 Underflow Error
        2. 2.3.2.2 Overflow Error
        3. 2.3.2.3 Offset Parity Error
        4. 2.3.2.4 Config Parity Error
          1. 2.3.2.4.1 A FSM Config Parity Error
          2. 2.3.2.4.2 B FSM Config Parity Error
          3. 2.3.2.4.3 C FSM Config Parity Error
          4. 2.3.2.4.4 X FSM Config Parity Error
        5. 2.3.2.5 C READ Error
        6. 2.3.2.6 C Write Error
  6. 3Flow Diagram
    1. 3.1 Code Changes
      1. 3.1.1 Return Hook Definition
      2. 3.1.2 Clear MMA Function
      3. 3.1.3 Sequence Test
  7. 4Summary
  8. 5References

Sequence Test

The following function verifies that there is a sequence of MMA error injection test. The following code is a sample of the end implementation is completely dependent by the user.

volatile unit8_t track_exception = 0;
void test_fun(void)
{
    switch(track_exception)   /*track exception is a global variable ,        initialized to zero*/
    {
        case 0:
            clear_mma(); /*this cleares the previous mma error code, definition is given above*/
            track_exception = track_exception+1;//increment track //exception 
            overflow_exception();//generate exception
            break;
        case 1:
            clear_mma();
            track_exception = track_exception+1;
            appLogPrintf("Under flow exception\n"); /*Only for debug, remove*/
            underflow_exception(); // generate exception
            break;
        case 2:
            clear_mma();
            track_exception = track_exception+1;
            appLogPrintf("offset parity exception\n"); /*only for debug remove*/
            offset_parity_test();//generate excpetion
            break;
        case 3:
            clear_mma(); 
            appLogPrintf("config parity exception\n"); /*Only for debug*/
            track_exception = track_exception+1;
            config_parity_test();
            break;
        case 4:
            clear_mma();
            track_exception = track_exception+1;
            appLogPrintf("offset parity exception\n");/*Only for debug*/
            offset_parity_test();
            break;
        case 5: 
            appLogPrintf("Signal ESM\n");
            appLogPrintf("Waiting for ESM event\n");
            while(1) /*it needs to wait, if not the program doesnt go , and it would generate multiple exceptions*/
            {

            }
            break;
        default:
    //Handle any unlikely scenario
        break;
}
    return;
}