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.

HALCoGen sys_startup.c question - TMS570LS3137

Other Parts Discussed in Thread: HALCOGEN

Hello,

I have to modify _c_init00() to handle an external watchdog connected to nRST.  I know this module has evolved over many years of HALCoGen versions on many processors, so I don't take this change lightly.

My first question is:

Only one cause of a reset is processed each pass of _c_init00().  The TRM says that the reset source status bits in SYSESR are not automatically cleared if a new reset occurs.  If more than one bit is set in SYSESR (with the exception of PORST), one will be processed and cleared while the others will remain set and unprocessed.  Is there any reason not to check all reset sources by using an "if" rather than an "else if"?

Thanks, Charlie Johnston

  • Hello Charlie,

    The reset handler gets called as the first routine after resuming code execution after a CPU reset, which can be caused by a power-on reset, or a system reset, or just a CPU reset. Normally there is a single cause of reset, which is then cleared by the reset handler. Note that the EXTRST bit in the SYSESR gets set regardless of the cause of the system reset (internal or externally driven).

    Regards, Sunil