I got some further after I downloaded a newer version of OpenOCD and run is outside of Eclips. But I still have problem flashing the main.bin into my p103.
software:
window XP
OpenOCD r717 released on 6/19/2008. The main.bin and main.list are from OpenOCD-projects100 for stm_p103. So is the cfg file.
Here is the procedure I used:
in a DOS window I type:
Openocd-ftd2xx –l log.txt –f lpc2xx_armusbocd.cfg
I open an other dos window and type this:
telnet localhost 4444
Open On-chip debugger
flash probe 0
device id = 0x20016410
flash size = 128kbytes
flash ‘stm32x’ found at 0x08000000
flash info 0
#0: stm32x at 0x08000000 …
flash write_bank 0 main.bin 0
not enough working area available<requested 8192, free 8144>
flash write failed with error code: 0xfffffc7a
error writing to flash at address 0x08000000 at offset 0x00000000 <-902>
wrote 4104 byte from main.bin to flash bank 0 at offset 0x00000000 in 0.296875s (13.500000 kb/s)
reset init
Why do I get this “not enough working area” error even though the file has been written into the STM. And the no blinking LED.
Here is the content of cfg file:
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ft2232
ft2232_device_desc “Olimex OpenOCD JTAG A”
ft2232_layout jtagkey
jtag_speed 10
#use combined on interfaces or targets that can’t set TRST/SRST separately
reset_config trst_and_srst
#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
daemon_startup reset
#target
#target cortex_m3
target cortex_m3 little run_and_halt 0
run_and_halt_time 0 30
working_area 0 0x20000000 16384 nobackup
#flash bank <chip_width> <bus_width>
flash bank stm32x 0x08000000 0x00010000 0 0 0
4k working area at base of ram
#working_area 0 0x20000800 0x1200 nobackup
all ram
working_area 0 0x20000000 0x2000 nobackup
For more information about the configuration files, take a look at:
The openOCD output this log file:
Info: options.c:50 configuration_output_handler(): jtag_speed: 10, 10
Info: options.c:50 configuration_output_handler(): Open On-Chip Debugger (2008-06-19 19:00) svn: 717
Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)
Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)
Info: server.c:78 add_connection(): accepting ‘telnet’ connection from 0
Info: stm32x.c:631 stm32x_probe(): device id = 0x20016410
Info: stm32x.c:670 stm32x_probe(): flash size = 128kbytes
Warning: target.c:853 target_alloc_working_area(): not enough working area available(requested 8192, free 8144)
Error: stm32x.c:556 stm32x_write(): flash writing failed with error code: 0xfffffc7a
Error: flash.c:103 flash_driver_write(): error writing to flash at address 0x08000000 at offset 0x00000000 (-902)
Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)
User: target.c:957 target_arch_state(): target state: halted
User: armv7m.c:451 armv7m_arch_state(): target halted due to breakpoint, current mode: Handler HardFault
xPSR: 0x21000003 pc: 0x20000026