EmbDev.net

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


von grub (Guest)


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:
1
#include "lm3s_cmsis.h"
2
#define SYSDIV                  0x09
3
#define XTAL_6_MHz              0x0B
4
/* Clock sources */
5
#define OSCSRC_MOSC             0   /* main oscillator */
6
#define OSCSRC_IOSC             1   /* internal oscillator */
7
#define OSCSRC_IOSC_BY_4        2   /* internal oscillator divided by 4 */
8
#define SYSCTL_RCC_OSCSRC       (OSCSRC_MOSC << 4)
9
#define SYSCTL_RCC_XTAL         (XTAL_6_MHz << 6)
10
#define SYSCTL_RCC_BYPASS       (1 << 11)
11
#define SYSCTL_RCC_OEN          (1 << 12)
12
#define SYSCTL_RCC_PWRDN        (1 << 13)
13
#define SYSCTL_RCC_USESYSDIV    (1 << 22)
14
#define SYSCTL_RCC_SYSDIV       (SYSDIV << 23)
15
#define SYSCTL_RIS_PLLLRIS      (1 << 6)  /* PLL lock raw interrupt status */
16
17
/*
18
 * LM3S811 clocks and PLL initialization.
19
 */
20
void LM3S811_clock_init(void) {
21
    /* bypass the PLL */ 
22
    SYSCTL->RCC |= SYSCTL_RCC_BYPASS;
23
    /* bypass the system clock divider */
24
    SYSCTL->RCC &= ~SYSCTL_RCC_USESYSDIV;
25
    /* select the crystal value and oscillator source */
26
    SYSCTL->RCC |= SYSCTL_RCC_XTAL | SYSCTL_RCC_OSCSRC; 
27
    /* enable power to PLL and enable its output */
28
    SYSCTL->RCC &= ~(SYSCTL_RCC_PWRDN |  SYSCTL_RCC_OEN);
29
    /* select system divider and enable to use it */
30
    SYSCTL->RCC |= SYSCTL_RCC_SYSDIV | SYSCTL_RCC_USESYSDIV;
31
    /* wait for the PLL to lock */
32
    while ((SYSCTL->RIS & SYSCTL_RIS_PLLLRIS) == 0)
33
      ;
34
    /* enable use of PLL */
35
    SYSCTL->RCC &= ~(SYSCTL_RCC_BYPASS);
36
}
37
38
int main(void)
39
{
40
    LM3S811_clock_init();
41
    /* enable clock gating control for PORTC */
42
    SYSCTL->RCGC2 = (1 << 2);
43
    /* enable pin connected to LED, set it as output */
44
    GPIOC->DIR = (1 << 5);
45
    GPIOC->DEN = (1 << 5);
46
    for (;;) {
47
        volatile int i;
48
        GPIOC->DATA_Bits[1 << 5] = 1 << 5;
49
        for (i = 0; i < 1000000; i++)
50
            ;
51
        GPIOC->DATA_Bits[1 << 5] = 0;
52
        for (i = 0; i < 1000000; i++)
53
            ;
54
55
    }
56
}
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.