EmbDev.net

Forum: ARM programming with GCC/GNU tools briked evaluation board with lm3s811


Author: grub (Guest)
Posted on:

Rate this post
0 useful
not useful
Hello.

I have problem with Stellaris EKC-LM3S811 evaluation kit. I can't 
download programs nor erase LM3S811 after I've downloaded my program.
Before this I could download demo programs.
I have tryed to unlock with Debug Port Unlock in LM Flash 
Programmer(build 1154).
No success - error message: "**ERROR**:Invalid IDCODE!"
If I try to erase, blank check or upload: "**ERROR**: Unable to 
initialize target!"
I have also tryed this board as ICDI programmer to program LM3S6B95 
chip, it worked OK, so hardware JTAG interface is not broken.

My program:
#include "lm3s_cmsis.h"
#define SYSDIV                  0x09
#define XTAL_6_MHz              0x0B
/* Clock sources */
#define OSCSRC_MOSC             0   /* main oscillator */
#define OSCSRC_IOSC             1   /* internal oscillator */
#define OSCSRC_IOSC_BY_4        2   /* internal oscillator divided by 4 */
#define SYSCTL_RCC_OSCSRC       (OSCSRC_MOSC << 4)
#define SYSCTL_RCC_XTAL         (XTAL_6_MHz << 6)
#define SYSCTL_RCC_BYPASS       (1 << 11)
#define SYSCTL_RCC_OEN          (1 << 12)
#define SYSCTL_RCC_PWRDN        (1 << 13)
#define SYSCTL_RCC_USESYSDIV    (1 << 22)
#define SYSCTL_RCC_SYSDIV       (SYSDIV << 23)
#define SYSCTL_RIS_PLLLRIS      (1 << 6)  /* PLL lock raw interrupt status */

/*
 * LM3S811 clocks and PLL initialization.
 */
void LM3S811_clock_init(void) {
    /* bypass the PLL */ 
    SYSCTL->RCC |= SYSCTL_RCC_BYPASS;
    /* bypass the system clock divider */
    SYSCTL->RCC &= ~SYSCTL_RCC_USESYSDIV;
    /* select the crystal value and oscillator source */
    SYSCTL->RCC |= SYSCTL_RCC_XTAL | SYSCTL_RCC_OSCSRC; 
    /* enable power to PLL and enable its output */
    SYSCTL->RCC &= ~(SYSCTL_RCC_PWRDN |  SYSCTL_RCC_OEN);
    /* select system divider and enable to use it */
    SYSCTL->RCC |= SYSCTL_RCC_SYSDIV | SYSCTL_RCC_USESYSDIV;
    /* wait for the PLL to lock */
    while ((SYSCTL->RIS & SYSCTL_RIS_PLLLRIS) == 0)
      ;
    /* enable use of PLL */
    SYSCTL->RCC &= ~(SYSCTL_RCC_BYPASS);
}

int main(void)
{
    LM3S811_clock_init();
    /* enable clock gating control for PORTC */
    SYSCTL->RCGC2 = (1 << 2);
    /* enable pin connected to LED, set it as output */
    GPIOC->DIR = (1 << 5);
    GPIOC->DEN = (1 << 5);
    for (;;) {
        volatile int i;
        GPIOC->DATA_Bits[1 << 5] = 1 << 5;
        for (i = 0; i < 1000000; i++)
            ;
        GPIOC->DATA_Bits[1 << 5] = 0;
        for (i = 0; i < 1000000; i++)
            ;

    }
}
Any suggestions how to unlock the deveice, please?

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.