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.

Is it necessary to backup cpu registers when do STC? (CPU Self Test Controller)

Hi, 

Follow the example in reference manual, all cpu core registers should be backup before run STC (page 237). I want to know if it is necessary to do it?

I know the STC will cause a CPU reset, the program will run from beginning. In STC module, I do

if(1U != (regStc.STCGSTAT & 0x1U))

{

run STC

}

else

{

reset state register and disable STC

}

is this ok?

I found the STC was run completely (by check STCGSTAT) and program was reset but I can't find the CPU reset bit in SYSESR register. So I am not sure if the function works properly.

Any help?

thanks 

 

  • You should be able to read the reset status from the sysesr register. I checked in my bench. It works fine.

    If you plan to test STC only on startup, you might not need to save your contents. You can let the reset go through all the startup configurations.

    If you plan to divide the STC into 32 intervals and run them during normal operation, you have to save your CPU contents and reload them to restore your work. Because you do not want the device take another 20ms (just a example) to go back to normal condition after a STC reset.

    Regards,

    Haixiao

  • that's what I thought, thanks