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.

Reset reason on CC2530 using SLEEPSTA register

Other Parts Discussed in Thread: CC2530, Z-STACK

Hello forum,

I'm facing problems to discover the reset reason on CC2530 using  SLEEPSTA register.

Regardless the reset is a power on, a watchdog reset or na external reset, the register SLEEPSTA always indicate external reset (value 01 on the corresponding bits).

I use the following macro of Z-Stack Home Automation 1.2.0:

/* Reset reason for reset indication */
#define ResetReason() ((SLEEPSTA >> 3) & 0x03)

Can anyone give ideas about the problem?

Best regards,

Jose

  • Hi Jose,

    I tried to reproduce this issue using the Z-Stack Home 1.2.2, I placed following code in the function zclSampleSw_Init() for a coordinator application.

    int resetReason;
    resetReason = ((SLEEPSTA >> 3) & 0x03); //set breakpoint here

    And used the following code to do the watch dog reset on pressing a button, I used key 3:

    if ( keys & HAL_KEY_SW_3 )
    {

    // do a watchdog reset
    st( HAL_DISABLE_INTERRUPTS(); WDCTL = WD_RESET1; WDCTL = WD_RESET2; for(;;); );
    }

    and while debugging using the IAR, I pressed button 3 and after reset when I hit the breakpoint in the zclSampleSw_Init() I see the reset reason to be 2.

    Can you please try this Or explain how you are testing this.

    Regards,
  • Hello Suyash,

    Thanks a lot for your fast answer. 

    The information on my question was not correctly.

    Now I found the problem: the resets I thought that were real resets, were in fact just a jump to address 0x00000 (used SystemResetSoft() of Z-Stack HA 1.2.0 ). So the SLEEPSTA register was not affected.

    Best regards,

    Jose