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.

TMDS570LS31HDK: Determining cause of software reset in SYSESR

Part Number: TMDS570LS31HDK
Other Parts Discussed in Thread: HALCOGEN

Hello,

I'm trying to chase down an issue when my program is sporadically resetting.  I have looked at the SYSESR register and the value is 0x00000010 pointing to a software reset.  I am not explicitly doing a software reset anywhere in my code, so the issue is somewhere else.  Any pointers to any other registers I can look at in order to chase down the cause of the reset? Or other debug ideas?

Thanks!

  • Hello,
    Bit 4 of SYSESR register is set when a software reset has occurred. Software reset is generated by the application software writing a 1 to bit 15 of System Exception Control Register (SYSECR) or a 0 to bit 14 of SYSECR. HALCoGen generates sys_startup.c file where cause of reset is determined on start-up. There is a place for user code where you can handle reset cause.
    Are you using bootloader?

    Best regards,
    Miro
  • Hi, thanks for the reply! No, I am not using a bootloader in this application.  I put a breakpoint in sys_startup.c to catch when the reset occurred, when it did I looked at the SYSECR register (0xFFFFFFE0) which read 0x00004000.  According to the datasheet, no reset should have occurred, but I'm not sure if this is the right time to read the SYSECR register.

    Still don't know why the reset happened.

  • Hello,
    With the following code in sys_startup.c :

    else if ((SYS_EXCEPTION & SW_RESET) != 0U)
    {
    /* Reset caused due to software reset.
    Add user code to handle software reset. */

    /* USER CODE BEGIN (22) */
    /* USER CODE END */
    }

    is checked whether resets is caused due to software reset. This code checks SYSESR[4].

    If you want to force software reset then you have to write to SYSECR (writing to SYSECR is allowed only in privileged mode). After reset default state for SYSECR is 0x00004000.

    Best regards,
    Miro
  • Hello,
    I am closing this thread. You can reopen it with writing here or you can open new thread.

    Best regards,
    MIro