File writed in the flash BUT NOT in the interrupt vector

Hi, i want to load a file ihex in the LPC2136. I use amontec jtagkey with openocd ver 0.1.0

my script is:

#interface

interface ft2232

ft2232_device_desc “Amontec JTAGkey A”

ft2232_layout jtagkey

ft2232_vid_pid 0x0403 0xcff8

telnet_port 4444

jtag_speed 5

#lpc2136

if { [info exists CHIPNAME] } {

set _CHIPNAME $CHIPNAME

} else {

set _CHIPNAME lpc2136

}

if { [info exists ENDIAN] } {

set _ENDIAN $ENDIAN

} else {

set _ENDIAN little

}

if { [info exists CPUTAPID ] } {

set _CPUTAPID $CPUTAPID

} else {

force an error till we get a good number

set _CPUTAPID 0x4F1F0F0F

}

#delays on reset lines

jtag_nsrst_delay 200

jtag_ntrst_delay 200

#use combined on interfaces or targets that can’t set TRST/SRST separately

reset_config trst_and_srst srst_pulls_trst

#jtag scan chain

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

set _TARGETNAME [format “%s.cpu” $_CHIPNAME]

target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0

$_TARGETNAME configure -event reset-init {

Force target into ARM state

soft_reset_halt

#do not remap 0x0000-0x0020 to anything but the flash

mwb 0xE01FC040 0x01

}

#flash bank lpc2000 0 0 <target#>

flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000

The commands are:

openocd -f openocd.cfg -c init -c halt

flash protect 0 0 14 off

flash write_image erase file.hex 0 ihex

All data are write in the flash BUT NOT in the interrupt vector!

Why? Where is my error?

Thanks!

Ok, now work correctly.

The value of the register MEMMAP should be 0x01.

This cfg work for LPC2136.

The command “cmd_program” is only for file raw-binary.

Bye

#interface

interface ft2232

ft2232_device_desc “Amontec JTAGkey A”

ft2232_layout jtagkey

ft2232_vid_pid 0x0403 0xcff8

telnet_port 4444

jtag_speed 5

#lpc2136

if { [info exists CHIPNAME] } {

set _CHIPNAME $CHIPNAME

} else {

set _CHIPNAME lpc2136

}

if { [info exists ENDIAN] } {

set _ENDIAN $ENDIAN

} else {

set _ENDIAN little

}

if { [info exists CPUTAPID ] } {

set _CPUTAPID $CPUTAPID

} else {

force an error till we get a good number

set _CPUTAPID 0x4F1F0F0F

}

#delays on reset lines

jtag_nsrst_delay 200

jtag_ntrst_delay 200

proc init_proc {} {

debug_level 0

fast disable

jtag_speed 100

jtag_khz 100

reset run

sleep 100

reset halt

wait_halt 2

PLL disconnect PLLCON

mww 0xE01FC080 0x01

mww 0xE01FC08C 0xAA

mww 0xE01FC08C 0x55

PLL disable PLLCON

mww 0xE01FC080 0x00

mww 0xE01FC08C 0xAA

mww 0xE01FC08C 0x55

no prescaler CCLKCFG

mww 0xE01FC104 0x00

internal RC CLKSRCSEL

mww 0xE01FC10C 0x00

main oscil. CLKSRCSEL

mww 0xE01FC10C 0x01

remap to internal flash

mww 0xE01FC040 0x01

sleep 100

jtag_khz 500

flash probe 0

sleep 100

}

proc cmd_program {IMGFILE} {

halt

init_proc

flash write_image erase $IMGFILE 0 bin

sleep 100

verify_image $IMGFILE 0

sleep 100

}

NOTE!!! LPCs need reset pulled while RTCK is low. 0 to activate

JTAG, power-on reset is not enough, i.e. you need to perform a

reset before being able to talk to the LPC2148, attach is not

possible.

#use combined on interfaces or targets that can’t set TRST/SRST separately

reset_config trst_and_srst srst_pulls_trst

#jtag scan chain

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

set _TARGETNAME [format “%s.cpu” $_CHIPNAME]

target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0

$_TARGETNAME configure -event reset-init {

Force target into ARM state

soft_reset_halt

#do not remap 0x0000-0x0020 to anything but the flash

mwb 0xE01FC040 0x01

}

#flash bank lpc2000 0 0 <target#>

flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 14765 calc_checksum