Hi there, I don’t understand what tricks you’ve made to make it work. I have almost the same problem, with this SWJ-DP STICKY ERROR.
I explain :
I have the STM32-P103 board
I use the jtagkey (tiny one) from Amontec
I have downloaded the openocd here :
http://www.siwawi.arubi.uni-kl.de/avr_p … index.html
I’ve mixed what I’ve found in several sites (thanks gregson for your script)
here is the script I use
#daemon configuration
telnet_port 4444
gdb_port 3333
# we use the ft2232 interface
interface ft2232
ft2232_device_desc "Amontec JTAGkey A"
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xCFF8
# these settings come from openocd homepage.
#how fast should we talk to the jtag interface
#the numeb is a divisor for the speed -> 0 is the fastest possible
jtag_speed 40
jtag_nsrst_delay 200
jtag_ntrst_delay 200
#use combined on interfaces or targets that can't set TRST/SRST separately
#reset_config srst_only srst_pulls_trst
reset_config srst_only
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
jtag_device 5 0x1 0x1 0x1e
#target configuration
#actually, we attatch to the <B5>C
#daemon_startup attach
#for flashing
daemon_startup reset
#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
#target arm7tdmi little run_and_halt 0 arm7tdmi-r4
#flash test
target cortex_m3 little reset_halt 0
#run_and_halt_time 0 30
working_area 0 0x20000000 0x5000 nobackup
#flash configuration
#flash bank <driver> <base> <size> <chip_width> <bus_width>
#flash bank at91sam7 0 0 0 0 <target#> (base, size, chip and bus_width are read from the target)
flash bank stm32x 0x08000000 0x00020000 0 0 0
I’ve opened a command line window and entered :
openocd_local -d 3 -l logfile.txt -f Amontec.cfg
In an other window :
telnet localhost 4444
...
Open On-Chip Debugger
> load_image main.bin 0x8000000
SWJ-DP STICKY ERROR
dcb_dhcsr 0x3000f, nvic_shcsr 0x20000, nvic_cfsr 0x0, nvic_bfar 0xe000edf8
SWJ-DP STICKY ERROR
dcb_dhcsr 0x3000f, nvic_shcsr 0x20000, nvic_cfsr 0x0, nvic_bfar 0xe000edf8
Block write error address 0x8000000, wcount 0x3f5
>
> flash info 0
device id = 0x20016410
flash size = 128kbytes
#0: stm32x at 0x08000000, size 0x00020000, buswidth 0, chipwidth 0
#0: 0x00000000 (0x400 1kB) protected
#1: 0x00000400 (0x400 1kB) protected
#2: 0x00000800 (0x400 1kB) protected
#3: 0x00000c00 (0x400 1kB) protected
#4: 0x00001000 (0x400 1kB) protected
#5: 0x00001400 (0x400 1kB) protected
.
.
.
#125: 0x0001f400 (0x400 1kB) protected
#126: 0x0001f800 (0x400 1kB) protected
#127: 0x0001fc00 (0x400 1kB) protected
stm32x flash driver info
>
The main.bin is the blinking example from olimex