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.

Stellaris Launchpad connection issues after programming

Hi,

I worked on the timer tutorials and tried a few things.

And suddenly the CCS crashed during debug and after restarting i cannot connect to my target.

Iam not sure if it is because of the code that i uploaded last session.

I set down the SystemClock to test the 16bit timer to see toggleing of the led.

If clicking on debug the CCS presents a Messagebox Window with the text: Error connecting to the target.

If clicking on Retry it distplays "Frequency is out of range."

If clicking Cancel it shows one additional box, returns to edit perspective and then it crashes.

How can i recover my Launchpad?

here is the code:

#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include <inttypes.h>

int main(void) {
    uint32_t ulPeriod;

    SysCtlClockSet( SYSCTL_SYSDIV_50 | SYSCTL_USE_OSC | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC);

    ulPeriod = (SysCtlClockGet() ) / 2;
    TimerLoadSet(TIMER0_BASE, TIMER_A, 0xffFF);//);ulPeriod -1);
    TimerPrescaleSet(TIMER0_BASE, TIMER_A, 10);
    TimerControlStall(TIMER0_BASE, TIMER_BOTH, true);

    IntEnable(INT_TIMER0A);
    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    IntMasterEnable();

    TimerEnable(TIMER0_BASE, TIMER_A);


    while (1) {
    }
}


void Timer0IntHandler(void)
{
    // Clear the timer interrupt
    TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    // Read the current state of the GPIO pin and
    // write back the opposite state
    if(GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_2))
    {
        GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);
    }
    else
    {
        GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 4);
    }
}

  • Hi,

    With this line:

        SysCtlClockSet( SYSCTL_SYSDIV_50 | SYSCTL_USE_OSC | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN)

    You changed the frequency of your device to 320 kHz. You need to also slow down your JTAG interface if you are going to run the system so slowly.  What are you using for your debug interface?

    To recover your device, use LMFlash Programmer.  On the Configuration tab, change the JTAG speed to something much slower, like 10000.  Then go to the Other Utilities tab and click on Fury, DustDevil, and Blizzard classes and hit the Unlock button.  This should reestablish communication with your Launchpad.


    Regards,

    Sue

  • thanks for your reply.

    Sue Cozart said:
    You changed the frequency of your device to 320 kHz.

    I know

    Sue Cozart said:
    To recover your device, use LMFlash Programmer

    i allready tried to select
    "manual config"
    Interface "ICDI", Port "JTAG", Speed "10000"
    I do not know what to set on the clock source settings.
    I tried a few settings and tried to program.
    There i get a "**ERROR**: Unable to initialize target -0!" message.

    the Debug Port-Unlock procedure - how doies this work?
     - disconnect the USB,
     - click unlock,
     - confirm with yes
     - on next MsgBox hold reset, connect and click OK?

    I get a "**ERROR**: Failed to unlock connected device Msg!" message

  • ok i reproduced the reset with another workling Launchpad. It seems that after any failed connection the LM-Flash util has to be restarted to work correct.

    The clock setting has to be 16Mhz and the procedure is:

     - disconnect the USB,
     - click unlock,
     - confirm with yes
     - on next MsgBox hold reset, connect
     - click ok, while still holding reset
     - release reset
     - power cycle board (and restart Flash tool?)
     - after that the programming works

  • Hi,

    My problem is similar, but I set the clock to high value 25 MHz with SysCtlClockFreqSet(SYSCTL_USE_OSC|SYSCTL_XTAL_25MHZ,25000000);

    Now I can't use debug interface and I can't use LM Flash Programmer. Which speed should I choose for ICDI interface?

  • Hello Grzegorz,

    The JTAG TCK cannot exceed 1/10 of the system clock. So if the system clock is 25MHz, the maximum JTAG TCK would be 2.5MHz. Generally speaking the default configuration should be OK.

    Regards
    Amit