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.

MSPM0L1306: How to test NRST triggered BOOTRST (<1s hold) ?

Part Number: MSPM0L1306

Tool/software:

Hi,

I am using MSPM0L1306 MCU and I am trying to test NRST triggered BOOTRST.

I am not able to see 0x0C value in RSTCAUSE register. 

how to test this scenario? 

How to generate below condition?

NRST (low <1 s)

Please help to generate NRST triggered BOOTRST reset.

  • Hi Sourabh,

    My apologies for the delayed response. Are you using Code Composer Studio and if so which version?

    Assuming you are using CCS there is a way to launch the debug session that allows you to connect while the target is running.  See the attached pdf file which illustrates the steps.  Once you are connected to the target, perform a reset (NRST to GND) and view the RSTCAUSE register.  I see 0x0C.

    If not using CCS, let me know.


    how to connect to target.pdf

  • Hi Dennis, 

    I am using Keil IDE, is there any way to generate BOOTRST in Keil IDE ?

  • Hi Sourabh,

    I'm not that experienced with the Keil IDE so I'll ask the rest of our team to see who is most experienced. BTW, are you doing this on the MSPM0L1306 Launchpad or on your own PCB?  If not the Launchpad, which debugging tool are you using?

  • Hi Dennis, 

    Its not Launchpad, its custom board. I am using J-Link Debugger.

  • Hi Sourabh,

    Ok, it turns out it is quite simple as you can see from the example below.  One driverlib function returns the reset cause.  I set a breakpoint in code (__BKPT(0)), but for your application you will probably execute various code based on the return value.

    int main(void)
    {
        uint32_t cause;
        cause = DL_SYSCTL_getResetCause();
        __BKPT(0);
    
          SYSCFG_DL_init();
    
         while (1) {
           __WFI();
        }
    }
    
    #if 0
    //from hw_sysctl_mspm0l11xx_l13xx.h
    /* SYSCTL_RSTCAUSE Bits */
    /* SYSCTL_RSTCAUSE[ID] Bits */
    #define SYSCTL_RSTCAUSE_ID_OFS                   (0)                             /* !< ID Offset */
    #define SYSCTL_RSTCAUSE_ID_MASK                  ((uint32_t)0x0000001FU)         /* !< ID is a read-to-clear field which
                                                                                        indicates the lowest level reset
                                                                                        cause since the last read. */
    #define SYSCTL_RSTCAUSE_ID_NORST                 ((uint32_t)0x00000000U)         /* !< No reset since last read */
    #define SYSCTL_RSTCAUSE_ID_PORHWFAIL             ((uint32_t)0x00000001U)         /* !< POR- violation, SHUTDNSTOREx or PMU
                                                                                        trim parity fault */
    #define SYSCTL_RSTCAUSE_ID_POREXNRST             ((uint32_t)0x00000002U)         /* !< NRST triggered POR (>1s hold) */
    #define SYSCTL_RSTCAUSE_ID_PORSW                 ((uint32_t)0x00000003U)         /* !< Software triggered POR */
    #define SYSCTL_RSTCAUSE_ID_BORSUPPLY             ((uint32_t)0x00000004U)         /* !< BOR0- violation */
    #define SYSCTL_RSTCAUSE_ID_BORWAKESHUTDN         ((uint32_t)0x00000005U)         /* !< SHUTDOWN mode exit */
    #define SYSCTL_RSTCAUSE_ID_BOOTNONPMUPARITY      ((uint32_t)0x00000008U)         /* !< Non-PMU trim parity fault */
    #define SYSCTL_RSTCAUSE_ID_BOOTCLKFAIL           ((uint32_t)0x00000009U)         /* !< Fatal clock failure */
    #define SYSCTL_RSTCAUSE_ID_BOOTEXNRST            ((uint32_t)0x0000000CU)         /* !< NRST triggered BOOTRST (<1s
                                                                                        hold) */
    #define SYSCTL_RSTCAUSE_ID_BOOTSW                ((uint32_t)0x0000000DU)         /* !< Software triggered BOOTRST */
    #define SYSCTL_RSTCAUSE_ID_SYSWWDT0              ((uint32_t)0x0000000EU)         /* !< WWDT0 violation */
    #define SYSCTL_RSTCAUSE_ID_SYSBSLEXIT            ((uint32_t)0x00000010U)         /* !< BSL exit */
    #define SYSCTL_RSTCAUSE_ID_SYSBSLENTRY           ((uint32_t)0x00000011U)         /* !< BSL entry */
    #define SYSCTL_RSTCAUSE_ID_SYSWWDT1              ((uint32_t)0x00000013U)         /* !< WWDT1 violation */
    #define SYSCTL_RSTCAUSE_ID_SYSFLASHECC           ((uint32_t)0x00000014U)         /* !< Flash uncorrectable ECC error */
    #define SYSCTL_RSTCAUSE_ID_SYSCPULOCK            ((uint32_t)0x00000015U)         /* !< CPULOCK violation */
    #define SYSCTL_RSTCAUSE_ID_SYSDBG                ((uint32_t)0x0000001AU)         /* !< Debug triggered SYSRST */
    #define SYSCTL_RSTCAUSE_ID_SYSSW                 ((uint32_t)0x0000001BU)         /* !< Software triggered SYSRST */
    #define SYSCTL_RSTCAUSE_ID_CPUDBG                ((uint32_t)0x0000001CU)         /* !< Debug triggered CPURST */
    #define SYSCTL_RSTCAUSE_ID_CPUSW                 ((uint32_t)0x0000001DU)         /* !< Software triggered CPURST */
    
    // For reference, here is driverlib function to see how it is implemented
    /**
     *  @brief  Return byte that is stored in RSTCAUSE.
     *
     *  @return The cause of reset. One of @ref DL_SYSCTL_RESET_CAUSE
     */
    
    __STATIC_INLINE DL_SYSCTL_RESET_CAUSE DL_SYSCTL_getResetCause(void)
    {
        uint32_t resetCause = SYSCTL->SOCLOCK.RSTCAUSE & SYSCTL_RSTCAUSE_ID_MASK;
    
        return (DL_SYSCTL_RESET_CAUSE)(resetCause);
    }
    #endif

  • Hi Dennis,

    I tried the sequence you mentioned in PDF. But i am getting SYSSW in RSTCAUSE register. Once I connect NRST to GND Its coming out of debug mode 

    I am using

    IDE - CCS

    Debugger - JLINK

    Device - MSPM0L1306 (Custom board).