Forum: Mikrocontroller und Digitale Elektronik LPC2138 OpenOCD flash bank


von Thomas K. (tomthegeek)


Lesenswert?

Hallo

ich probiere seit einiger Zeit meinen LPC2138 via OpenOCD und JTAG zu 
flashen. Bei meinem AT91SAM7X256 funktioniert es problemlos.

Folgendes Config-File:
1
#use combined on interfaces or targets that can't set TRST/SRST separately
2
#reset_config trst_and_srst srst_pulls_trst
3
4
#jtag scan chain
5
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
6
#jtag_device 4 0x1 0xf 0xe
7
8
#target configuration
9
#daemon_startup reset
10
11
#target  
12
#target arm7tdmi    
13
#target arm7tdmi little run_and_init 0 arm7tdmi-s_r4
14
#run_and_halt_time 0 30
15
16
# flash-options LPC2138
17
#flash bank lpc2000 0x0 0x7D000 0 0 lpc2000_v2 0 12000 calc_checksum
18
19
# NXP LPC2138 ARM7TDMI-S with 512kB Flash and 32kB SRAM, clocked with 14.7456MHz crystal
20
21
if { [info exists CHIPNAME] } {   
22
   set _CHIPNAME $CHIPNAME
23
} else {
24
   set _CHIPNAME lpc2138
25
}
26
27
if { [info exists ENDIAN] } {
28
   set _ENDIAN $ENDIAN
29
} else {
30
   set _ENDIAN little
31
}
32
33
if { [info exists CPUTAPID ] } {
34
   set _CPUTAPID $CPUTAPID
35
} else {
36
   set _CPUTAPID 0x4f1f0f0f
37
}
38
39
# LPC2000 -> SRST causes TRST
40
reset_config trst_and_srst srst_pulls_trst
41
42
# reset delays
43
jtag_nsrst_delay 100
44
jtag_ntrst_delay 100
45
jtag_khz 1000      # slow down jtag-connection to avoid errors
46
47
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
48
49
set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
50
51
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4
52
53
# 32kB of internal SRAM
54
55
56
#$_TARGETNAME configure  -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0
57
$_TARGETNAME configure  -work-area-phys 0x00000000 -work-area-size 0x7FFFF -work-area-backup 0
58
# flash bank name driver base size chip width bus width target [driver options]
59
flash bank $_TARGETNAME lpc2000 0x0 0x7D000 0 0 0  lpc2000_v2 14745 calc_checksum
60
61
62
63
# 23.09.2010
64
arm7_9 dcc_downloads enable
65
arm7_9 fast_memory_access enable
66
67
init
68
reset halt
69
sleep 10

Bei der Initialisierung tauchen auch keine Fehler in der Konsole auf. 
Sobald ich jedoch via Eclipse das Teil flashen will bekomme ich 
folgenden Fehler:
1
Warn : memory write caused data abort (address: 0x00000000, size: 0x4, count: 0x6)

Könnt ihr mir irgendwie weiterhelfen?

Gruß Thomas

von Thomas K. (tomthegeek)


Lesenswert?

ich habe jetzt mal versucht das ganze mit Flash Magic hochzuladen, aber 
ich bekomme immer den Fehler, dass das Hex-File Ram-Locations im Bereich 
0x40000120 bis 0x400001FF nutzt.

Wenn ich mir die Info vom Hex-File ansehe steht da, dass es den Bereich 
von 0x00000000 bis 0x400033DF nutzt. das File ansich hat eine Größe von 
37,37kByte und es steht folgendes dabei:
1048588.97 Kbytes (including gaps)
209717.79% of an LPC2138


Den Chip konnte ich löschen.
hier noch das Linker-Skript falls das weiterhilft:
1
/***********************************************************************/
2
/*  ROM.ld:  Linker Script File                                        */
3
/***********************************************************************/
4
ENTRY(_boot)
5
STACK_SIZE = 0x400;
6
7
/* Memory Definitions */
8
MEMORY
9
{
10
  ROM (rx) : ORIGIN = 0x00000000, LENGTH = 512k
11
  RAM (rw) : ORIGIN = 0x40000000, LENGTH = 32k
12
}
13
14
/* Section Definitions */
15
SECTIONS
16
{
17
  /* first section is .text which is used for code */
18
   .text :
19
  {
20
  /* *crt0.o (.text) */           /* Startup code */
21
  KEEP(*(.init))             /* Startup code from .init-section */
22
  *(.text .text.*)           /* remaining code */
23
  *(.gnu.linkonce.t.*)
24
  *(.glue_7)
25
  *(.glue_7t)
26
  *(.gcc_except_table)
27
  *(.rodata)                 /* read-only data (constants) */
28
  *(.rodata*)
29
  *(.gnu.linkonce.r.*)
30
  } > RAM
31
  
32
  /***** old: 
33
  .text :
34
  {
35
    *crt0.o (.text)            
36
    *(.text)                   
37
    *(.rodata)                 
38
    *(.rodata*)
39
    *(.glue_7)
40
    *(.glue_7t)
41
  } > ROM 
42
  *****/
43
44
  . = ALIGN(4);
45
  
46
  /* .ctors .dtors are used for c++ constructors/destructors */
47
  /* added by Martin Thomas 4/2005 based on Anglia Design example */
48
  .ctors :
49
  {
50
    PROVIDE(__ctors_start__ = .);
51
    KEEP(*(SORT(.ctors.*)))
52
    KEEP(*(.ctors))
53
    PROVIDE(__ctors_end__ = .);
54
  } >RAM
55
  
56
  .dtors :
57
  {
58
    PROVIDE(__dtors_start__ = .); 
59
    KEEP(*(SORT(.dtors.*)))
60
    KEEP(*(.dtors))
61
    PROVIDE(__dtors_end__ = .);
62
  } >RAM
63
  
64
    . = ALIGN(4);
65
  /* mthomas - end */
66
   
67
  _etext = . ;
68
  PROVIDE (etext = .);
69
70
  /* .data section which is used for initialized data */
71
  .data : AT (_etext)
72
  {
73
    _data = .;
74
    *(.data)
75
  *(.data.*)
76
  *(.gnu.linkonce.d*)
77
  SORT(CONSTRUCTORS) /* mt 4/2005 */
78
  . = ALIGN(4);
79
  *(.fastrun) /* !!!! "RAM-Function" example */
80
  } > RAM
81
 
82
  . = ALIGN(4);
83
  _edata = . ;
84
  PROVIDE (edata = .);
85
86
  /* .bss section which is used for uninitialized data */
87
  .bss (NOLOAD) :
88
  {
89
    __bss_start = . ;
90
    __bss_start__ = . ;
91
    *(.bss)
92
  *(.gnu.linkonce.b*)
93
    *(COMMON)
94
    . = ALIGN(4);
95
  } > RAM
96
97
  . = ALIGN(4);
98
  __bss_end__ = . ;
99
  PROVIDE (__bss_end = .);
100
101
  .stack ALIGN(256) :
102
  {
103
    . += STACK_SIZE;
104
    PROVIDE (_stack = .);
105
  } > RAM
106
107
  _end = . ;
108
  PROVIDE (end = .);
109
110
  /* Stabs debugging sections.  */
111
  .stab          0 : { *(.stab) }
112
  .stabstr       0 : { *(.stabstr) }
113
  .stab.excl     0 : { *(.stab.excl) }
114
  .stab.exclstr  0 : { *(.stab.exclstr) }
115
  .stab.index    0 : { *(.stab.index) }
116
  .stab.indexstr 0 : { *(.stab.indexstr) }
117
  .comment       0 : { *(.comment) }
118
  /* DWARF debug sections.
119
     Symbols in the DWARF debugging sections are relative to the beginning
120
     of the section so we begin them at 0.  */
121
  /* DWARF 1 */
122
  .debug          0 : { *(.debug) }
123
  .line           0 : { *(.line) }
124
  /* GNU DWARF 1 extensions */
125
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
126
  .debug_sfnames  0 : { *(.debug_sfnames) }
127
  /* DWARF 1.1 and DWARF 2 */
128
  .debug_aranges  0 : { *(.debug_aranges) }
129
  .debug_pubnames 0 : { *(.debug_pubnames) }
130
  /* DWARF 2 */
131
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
132
  .debug_abbrev   0 : { *(.debug_abbrev) }
133
  .debug_line     0 : { *(.debug_line) }
134
  .debug_frame    0 : { *(.debug_frame) }
135
  .debug_str      0 : { *(.debug_str) }
136
  .debug_loc      0 : { *(.debug_loc) }
137
  .debug_macinfo  0 : { *(.debug_macinfo) }
138
  /* SGI/MIPS DWARF 2 extensions */
139
  .debug_weaknames 0 : { *(.debug_weaknames) }
140
  .debug_funcnames 0 : { *(.debug_funcnames) }
141
  .debug_typenames 0 : { *(.debug_typenames) }
142
  .debug_varnames  0 : { *(.debug_varnames) }
143
}

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.