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.

"security violation" Reset caused by __bis_SR_register(LPM3_bits+GIE);

Other Parts Discussed in Thread: MSP430FR5989

Hello,

I'm having a weird problem when entering LPM3 with the line __bis_SR_register(LPM3_bits+GIE);  Once this line gets executed, it causes a reset. By reading out SYSRSTIV i figured out that the reset is caused by a "security violation" (SYSRSTIV=0x000A). According to information from this forum this happens when trying to acces protected areas of the flash (or in this case FRAM) ( see this thread ).

Now I'm wondering: how can this be caused by writing to the SR?

The stackpointer says 0x0023D4 is this close to an overflow? (Where can I find information on the maximum stack size?)

The ISR that is supposed to end the LPM3 is:

#pragma vector=TIMER0_A0_VECTOR
__interrupt void TIMER0_A0_ISR(void)
{
  switch(__even_in_range(TA0IV,TA0IV_TAIFG))
  {
    case TA0IV_NONE:	break;
    case TA0IV_TA0CCR1:	break;
    case TA0IV_TA0CCR2:	break;
    case TA0IV_3:		break;
    case TA0IV_4:		break;
    case TA0IV_5:		break;
    case TA0IV_6:		break;
    case TA0IV_TAIFG:
    {
    	_no_operation();
    	_low_power_mode_off_on_exit( );
    	break;
    }
    default:			break;
  }
}

Best Regards,

Andreas

  • To see the used stack size you can fill the memory with a known content and see how much is overwritten.
  • I just found the memory map in the datasheet. This says that for a MSP430FR5989 the RAM starts at 0x0023FF, my stackpointer points to 0x0023D4, and the Boot Memory starts at 0x001BFF. If I understand this correctly, there should be more than enough space on the stack left, right?
  • You wrote the wrong ISR/enabled the wrong interrupt.
    TIMER0_A0_VECTOR is for TA0CCR0.CCIE bit only (and this interrupt is not contained in TA0IV and the TA0CCR0.CCIFG bit is automatically reset when the ISR is entered).
    For all other xxIE bits in TIMERA0, including the TAIE bit in TA0CTL, the TIMER0_A1_VECTOR is used. So when your timer interrupt happens, it tries to jump to an ISR that doesn't exists (reading 0xFFFF as ISR address form the vector table) and then executes random code, finally crashiong/resetting.

**Attention** This is a public forum