Indefinite while loops handling in driver code

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

Indefinite while loops handling in driver code

1,436 Views
noorhasan
Contributor III

Hello,

 

I am trying to do some improvement to make the code production ready. My requirement is to remove all the indefinite while loops and replace them with resets.

I see that there are many while(1) loops which are mostly added after some initialization or other failures. An example is FSS init task:

void Fss_FW_Init_Task(void)
{
----
---

    /* Fss_Sym Startup FSS */
    BistExecution = FALSE;
    if (E_OK != Fss_Sym_PrepareCohort(0U, &BistExecution))
    {
        while (1)
        {
            /* FSS startup failed */
        }
    }
---
---
    if( E_OK != Fss_Sam_FoundationBootToSafety() )
    {
        while(1)
        {
            /* Stop if boot to safety fails */
        }
    }
 ---
---
}

I am trying to find any analysis of which failures are fatal thereby leading to complete failure of the HW and which are types of failure expected to be fixed by a hard or soft reset.
I am hoping that such an analysis might have been done before adding these indefinite while loops.
Please help me with any historical/analytical data on how these while loops were decided to be put where they are put.

Thanks

 

Tags (1)
0 Kudos
Reply
4 Replies

1,215 Views
Chadder777
Contributor I

In software, if a while loop does not meet all functional requirements, the user must intervene. If they fail to do so, a watchdog mechanism will activate predefined fault reactions, such as FCCU, RGM, or ERM. In gaming, like in the Papa's Freezeria game, user actions are crucial for success.

0 Kudos
Reply

1,338 Views
JordanBerry
Contributor I

awesome this is exactly what i was looking for how to fix

0 Kudos
Reply

1,308 Views
JordanBerry
Contributor I

you can fix it with android zil sesi.i am looking for this

0 Kudos
Reply

1,417 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I am trying to find any analysis of which failures are fatal thereby leading to complete failure of the HW and which are types of failure expected to be fixed by a hard or soft reset.

Such analyzes is unique to each customer project. Therefore there is FMEDA.

Basically when you program ends in while loop there are are multiple reasons and reactions:

For example if SW ends in while loop by not fulfilling all requirements for function lets say, then you as user take appropriate action in the place where are default while loops. If not, then watchdog will take action and the device will behave as define by your fault reaction paths. (usually FCCU, RGM, ERM, etc..)

This question looks to me fully dependent on end product and it required behavior in the fault/corner cases.

Best regards,

Peter

0 Kudos
Reply