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.

CCS/MSP432P401R: Error re-programming example program

Part Number: MSP432P401R

Tool/software: Code Composer Studio

I just got a new MSP432401R launchpad. It asked to update the XDS110 the first time I programmed it, so I assume that it is up to date.

I can re-program the gpio_toggle_output example just fine. But when I run the timer_32periodic_mode_led_toggle example (code below), it programs fine the first time, but any subsequent re-programs give me the following error:

CS_DAP_0: Error connecting to the target: (Error -614 @ 0x0) The target indicates there is an error condition from a previous SWD  request.
Clear the error the condition, and try the SWD request again. (Emulation package 7.0.188.0)

And I can only cancel. Once I pull the USB and put it back in, everything is fine.

I thought it might be the fact that it is in LPM0 mode, so I commented that out of the while loop, but still had the same problem. Any thoughts?

/*******************************************************************************
 * MSP432 Timer32 - Periodic LED Blink
 *
 * Description: Starts timer on a button press, toggles GPIO/LED for
 * a timer period, and then turns off LED at end of period.
 *
 *                MSP432P401
 *             ------------------
 *         /|\|                  |
 *          | |                  |
 *          --|RST         P1.1  |<--- Switch
 *            |                  |
 *            |                  |
 *            |            P1.0  |---> LED
 *            |                  |
 *            |                  |
 *
  *******************************************************************************/
/* DriverLib Includes */
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>

/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>

int main(void)
{
    /* Halting the Watchdog */
    MAP_WDT_A_holdTimer();

    /* Setting MCLK to REFO at 128Khz for LF mode */
    MAP_CS_setReferenceOscillatorFrequency(CS_REFO_128KHZ);
    MAP_CS_initClockSignal(CS_MCLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);
    MAP_PCM_setPowerState(PCM_AM_LF_VCORE0);

    /* Configuring GPIO */
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
    MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);

    /* Configuring Timer32 to 128000 (1s) of MCLK in periodic mode */
    MAP_Timer32_initModule(TIMER32_BASE, TIMER32_PRESCALER_1, TIMER32_32BIT,
            TIMER32_PERIODIC_MODE);

    /* Enabling interrupts */
    MAP_Interrupt_enableInterrupt(INT_PORT1);
    MAP_Interrupt_enableInterrupt(INT_T32_INT1);
    MAP_Interrupt_enableMaster();

    /* Sleeping when not in use */
    while (1)
    {
        MAP_PCM_gotoLPM0();
    }
}

/* GPIO ISR */
void PORT1_IRQHandler(void)
{
    uint32_t status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1,status);

    if (GPIO_PIN1 & status)
    {
        MAP_GPIO_disableInterrupt(GPIO_PORT_P1, GPIO_PIN1);
        MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
        MAP_Timer32_setCount(TIMER32_BASE,64000);
        MAP_Timer32_enableInterrupt(TIMER32_BASE);
        MAP_Timer32_startTimer(TIMER32_BASE, true);
    }
}

/* Timer32 ISR */
void T32_INT1_IRQHandler(void)
{
    MAP_Timer32_clearInterruptFlag(TIMER32_BASE);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
    MAP_GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);
}
/******************************************************************************* * MSP432 GPIO - Toggle Output High/Low * * Description: In this very simple example, the LED on P1.0 is configured as * an output using DriverLib's GPIO APIs. An infinite loop is then started * which will continuously toggle the GPIO and effectively blink the LED. * * MSP432P401 * ------------------ * /|\| | * | | | * --|RST P1.0 |---> P1.0 LED * | | * | | * | | * | | * ******************************************************************************/ /* DriverLib Includes */ #include <ti/devices/msp432p4xx/driverlib/driverlib.h> /* Standard Includes */ #include <stdint.h> #include <stdbool.h> //![Simple GPIO Config] int main(void) { volatile uint32_t ii; /* Halting the Watchdog */ MAP_WDT_A_holdTimer(); /* Configuring P1.0 as output */ MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0); while (1) { /* Delay Loop */ for(ii=0;ii<50000;ii++) { } MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); } } //![Simple GPIO Config]

**Attention** This is a public forum