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.

cc430f5137 resets in runtime mode

Other Parts Discussed in Thread: CC430F5137

Hello,
I work with cc430f5137 for a wireless communication project. I have written my program code c++ and compiler is ti v16.9.3lts.
Program works fine in debug mode but it always resets in normal mode or freerun mode.
Watchdog is off. In addition system reset interrupt service routine (isr) , system nmi isr and user nmi isr not been entered.
I don't use heap and there is no stack overflow stuation. I have tested my all functions one by one and all functions work fine but
when i run program as a whole , it resets. Where can the error be ?

Thanks & regards,

Celal

  • Hello Celal,

    An active debugger changes the system timing, when removed it is possible that the MCU reaches a point in the code too soon. Can you share your initialization code, supply voltage, and intended operating frequency? What has the SYSRSTIV determined the reset to be caused by? Are you evaluating with a TI EVM or using a custom PCB? If the latter then please share the schematic and board layout if possible.

    Regards,
    Ryan
  • Thanks for repyl Ryan,
    I solved the problem. I use mrfi module of simliciti library for simple rf communication. MRFI doesn't init power management module. mcu resets when radio go into rx active mode in low power mode because PMMHPMRE bit of PMMCTL0 register is not set.
    I set PMMHPMRE of PMMCTL0 register before calling MRFI_init(), hereby code works fine

  • /*this is my main code*/

    #include <msp430.h>
    #include "mrfi.h"
    #include "HAL_PMM.h"
    #include "string.h"

    #define trapdebug __bic_SR_register(GIE);while(1)


    void ledblink(int ch){

    int i;
    if(ch == 1){
    P2DIR |= BIT7;
    P2OUT &= ~BIT7;
    for (i = 0; i < 10; ++i) {
    P2OUT ^= BIT7;
    __delay_cycles(50000);
    }
    }
    else if(ch == 0){
    P2DIR |= BIT6;
    P2OUT &= ~BIT6;
    for (i = 0; i < 10; ++i) {
    P2OUT ^= BIT6;
    __delay_cycles(50000);
    }
    }
    }

    uint16_t sysrstiv = 0;
    int main(void)
    {
    WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
    SFRIFG1 = 0;
    SFRIE1 |= ACCVIE | NMIIE | VMAIE;

    SetVCore(2);
    PMMCTL0_H = 0xA5;
    PMMCTL0_L |= PMMHPMRE_L; //global high power module request enable
    PMMCTL0_H = 0x00;

    ledblink(1);
    MRFI_Init();
    MRFI_WakeUp();
    MRFI_RxIdle();
    __delay_cycles(16000);
    MRFI_RxOn();



    sysrstiv = SYSRSTIV;



    mrfiPacket_t p;
    memset(p.frame+1,0,20);
    memcpy(p.frame+1,(uint8_t*)&sysrstiv,sizeof(uint16_t));
    p.frame[0] = 20;
    int i;
    for (i = 0; i < 5; ++i) {
    MRFI_Transmit(&p, MRFI_TX_TYPE_CCA);
    }

    while(1){
    __bis_SR_register(LPM3_bits + GIE);
    }


    }


    #pragma vector=SYSNMI_VECTOR
    __interrupt void sysnmi_isr (void)
    {
    ledblink(0);
    __no_operation();
    switch (__even_in_range(SYSSNIV,0x12)) {
    case SYSSNIV_NONE:
    __no_operation();
    break;
    case SYSSNIV_SVMLIFG:
    __no_operation();
    break;
    case SYSSNIV_SVMHIFG:
    __no_operation();
    break;
    case SYSSNIV_DLYLIFG:
    __no_operation();
    break;
    case SYSSNIV_DLYHIFG:
    __no_operation();
    break;
    case SYSSNIV_VMAIFG: //vacant memory access
    __no_operation();
    break;
    case SYSSNIV_JMBINIFG:
    __no_operation();
    break;
    case SYSSNIV_JMBOUTIFG:
    __no_operation();
    break;
    case SYSSNIV_VLRLIFG:
    __no_operation();
    break;
    case SYSSNIV_VLRHIFG:
    __no_operation();
    break;
    default:
    break;
    }
    WDTCTL = 0xdead;
    }
    #pragma vector=UNMI_VECTOR
    __interrupt void unmi_isr (void)
    {
    ledblink(0);
    __no_operation();
    switch (__even_in_range(SYSUNIV, 0x08)) {
    case SYSUNIV_NONE:
    __no_operation();
    break;
    case SYSUNIV_ACCVIFG: //flass access violation
    __no_operation();
    break;
    case SYSUNIV_NMIIFG:
    __no_operation();
    break;
    case SYSUNIV_OFIFG: //osc fault
    __no_operation();
    break;
    case SYSUNIV_SYSBERRIV:
    __no_operation();
    break;
    default:
    break;
    }
    WDTCTL = 0xdead;
    }
  • Glad to hear that you found the answer celal, thanks for posting the solution.

    Ryan

**Attention** This is a public forum