Failed to call Bist_GetExecStatus(BIST_SAFETYDCD_CFG) in BIST example

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

Failed to call Bist_GetExecStatus(BIST_SAFETYDCD_CFG) in BIST example

230 Views
LeahChen
Contributor I

Hi Team,

We want to implement BIST on s32g. We import example project SAF_EVAL_example_S32G274A_Rev2_M7_0 in s32DS and generate the SAF file according to the peripheral configuration, in which BIST adds BIST2.
main.c in the imported SAF_EVAL_example_S32G274A_Rev2_M7_0 project is empty, so we refer to S32_SAF_Demo and use the call about BIST in main.c of S32_SAF_Demo.

We can compile successfully, but when the program runs to Bist_GetExecStatus(BIST_SAFETYDCD_CFG) on S32G, the program stops running immediately. We used the Lauderbach debugger to show that the project jumps directly to Hardfault_Handler() after Bist_GetExecStatus().

The code we use in main.c is as follows:

Spoiler
#define BIST_MODULE_ENABLED                                 (1U)
/* Enables SafetyDCD configuration check */
/* Configuration shall be properly loaded into the DCD records, otherwise Bist_ExectStatus() returns BIST_NORUN. */
#define BIST_SAFETY_DCD_SELFTEST                            (1U)  
#if (BIST_MODULE_ENABLED == 1U)
    Std_ReturnType retStatus;
#if (BIST_SAFETY_DCD_SELFTEST == 1U)
    Bist_StatusType bistStatus;
    uint32 stcuStatus;
    Bist_LBistRDListType Bist_LBistRDList = 0U;
    Bist_MBistRDListType Bist_MBistRDList = 0U;
#endif /* (BIST_SAFETY_DCD_SELFTEST == 1U) */
#endif /* (BIST_MODULE_ENABLED == 1U) */

#if (BIST_MODULE_ENABLED == 1U)
    /**************************************************/
    /* Bist example code                              */
    /**************************************************/
    if (MCU_POWER_ON_RESET == Mcu_GetResetReason())
    {
        /* Call to the Mcu_GetResetReason() clears the Power-on Reset flag */
#if (BIST_SAFETY_DCD_SELFTEST == 1U)
        /* DCD records can be processed only after Power OnReset */
        /**************************************************/
        /* Bist example code - SAFETYDCD                  */
        /**************************************************/
        bistStatus = Bist_GetExecStatus(BIST_SAFETYDCD_CFG);

        if( bistStatus != BIST_OK )
        {
            if(bistStatus == BIST_ERROR)
            {
                /* Reads STCU ERR_STAT register to identify what HW error occurred */
                stcuStatus = Bist_GetRawErrorStatus();
                (void) stcuStatus;
            }
            else if(bistStatus == BIST_FAILED)
            {
                /* Analyze which reset domain is failing */
                retStatus = Bist_GetFailRDs ( &Bist_LBistRDList, &Bist_MBistRDList );
                (void) retStatus;
            }
            else if(bistStatus == BIST_BUSY)
            {
                while( 1U );   /* Handle BIST HW busy state */
            }
            else if(bistStatus == BIST_NORUN)
            {
                /* Bist execution was not successfully performed due to HW hazard state. */
                Bist_Run(BIST_SAFETYDCD_CFG);   /* Re-start execution */
            }
            else if(bistStatus == BIST_INTEGRITY_FAIL)
            {
                while( 1U );   /* Handle the integrity fail state */
            }
        }
#endif /* #if (BIST_SAFETY_DCD_SELFTEST == 1U) */
    }
#endif /* #if (BIST_MODULE_ENABLED == 1U) */
#if (BIST_MODULE_ENABLED == 1U)
            /* Call the BIST API that launches the Bist execution. When the execution is finished, functional reset occurs (due to the main reset domain testing).*/
            retStatus = Bist_Run(BIST_SAFETYBOOT_CFG);
            (void) retStatus;
#endif /* #if (BIST_MODULE_ENABLED == 1U)*/

It seems that we cannot successfully use BIST, we read S32G_SAF_BIST_UM.pdf, but found no solution.

0 Kudos
3 Replies

178 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Can you let us know which RTD/SAF version are you working with? Is this a custom board or is this with an NXP reference board?

In general, SAF is a premium software, for which we recommend contacting your local NXP FAE/DFAE/representative for inquiries related to premium software.

As for the overall behavior, we understand that prior to running Bist_GetExecStatus, you required to either execute Bist_Run or previously ran the Self-Test DCD:

DanielAguirre_0-1713968630659.png

Please, let us know.

0 Kudos

167 Views
LeahChen
Contributor I

Thanks Daniel,

We work with RTD 4.0.2 ver, SAF  2.0.1 EVAL , NXP reference board S32G-VNP-RDB2.

Thanks for your advice, we tried running Bist_Run first and encountered the same hardfault problem. We changed Bist_Run directly to an empty function that only returns 0. Running Bist_Run will still cause hardfault. We couldn't get more information with a single point of debugging. This phenomenon is very strange, and we can not locate the root of the problem.

0 Kudos

153 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

Thanks for your feedback. Have you tried running the IVT-based self-test (off-line BIST Configuration)?

Also, it seems that there are pre-requisites that need to be taken care of (when running the On-line BIST Configuration). Since you are using the base example, we assume that these have been taken care, but we can recommend verifying that your setup is compliant:

DanielAguirre_0-1714057348853.png

Please, let us know.

0 Kudos