This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS1224: time out issue in while function

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Team,

For a lot of peripheral initialization, there have a lot of while function before the watchdog initialization,  for one example, in void canInit(void) there have the while function as show below:

    /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Potentially infinite loop found - Hardware Status check for execution sequence" */
    while ((canREG1->IF1STAT & 0x80U) ==0x80U)
    {
    } /* Wait */
    canREG1->IF1CMD  = 0x87U;

if customer are using this funtion which is generated automaticly by Halcogen, then there will have a potential risk that  the code will run infinite loop in the while function, here are the question and concern from the customer:

 1. how much is the probability of runing infinite loop in the while function?  

 2. when run infinite loop, dose it means that there have some hardware error occur? is that possilbe that have someTransient soft error that lead to run  infinite loop? and after reset, it will be ok and have no issue.

 3. How we usually handle these error?  if customer does not use any watchdog function, is there any other possible hardware time-out feature to handle runing infinite loop?

4. As these "while" code are generated automaticly by Halcogen,  Do we have plan to improve that in software also, e.g. timeout scheme?

  • Hello Strong,

    While the Busy bit in IFCMD register is 1, IF1/IF2 Register sets are write protected. This busy bit only lasts about 4 to 14 VCLK cycles.

    1. how much is the probability of runing infinite loop in the while function?
    QJW> I don't have this kind of value, and I haven't experienced this problem during device/peripherals configuration and initialization. Please refer to the FMEDA for the failure rate for the module. For example, the RAW transient faults FIT is 8.4E-4 (ISO26262).

    2. when run infinite loop, dose it means that there have some hardware error occur? is that possilbe that have someTransient soft error that lead to run infinite loop? and after reset, it will be ok and have no issue.
    QJW>It may be caused by the SW or HW, or transient fault. For example, for SCI receiving polling mode, the code may wait long time if transmitter delays to TX data. If code enters the infinite loop for(;;) in sys_startup.c , it may be caused by HW selftest (CPU selftest, STC selftest and Pbist selftest). Please refer to the FMEDA for permanent and transient fault FIT. Did you get this kind of fault?

    3. How we usually handle these error? if customer does not use any watchdog function, is there any other possible hardware time-out feature to handle runing infinite loop?
    QJW> The infinite loops can make applications unresponsive. Potential problems include lost work, lost access to application functionality, and a lack of responses to urgent events. The simplest way to guarantee a loop exits is to add a counter and quit after a certain number of iterations. You can add a timeout as an additional exit condition for your while() loop, or if your code uses exceptions, add a timeout exception (RTI compare).

    4. As these "while" code are generated automaticly by Halcogen, Do we have plan to improve that in software also, e.g. timeout scheme?
    QJW> No,