Hi

You are just erasing one sector of the flash memory, 1k, and probalby 
your bin file is larger.
Try something like:   flash erase_sector  0 0 10

Magnus


Robert Taylor wrote:
> Hello,
>
> I'm new to embedded development and I've just bought a STM3210E-EVAL
> board and an Olimex ARM-USB-TINY JTAG connector to play with. I've
> managed to set the tool chain and such up and I'm having trouble
> flashing an application. The application is from the ST example code
> and blinks the LEDs on and off.
>
> I've compiled an example program as follows:
>
> arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T generic-m.ld -I
> /home/taylorr/Desktop/um0427/Libraries/STM32F10x_StdPeriph_Driver/inc
> -I /home/taylorr/Desktop/um0427/Libraries/CMSIS/Core/CM3
> /home/taylorr/Desktop/um0427/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c
> /home/taylorr/Desktop/um0427/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c
> /home/taylorr/Desktop/um0427/Libraries/CMSIS/Core/CM3/system_stm32f10x.c
> stm32f10x_it.c main.c -o hello
>
> I used objcopy as follows:
>
> arm-none-eabi-objcopy -j .text a.out hello.bin -O binary
>
> Which produces the following file:
>
> -rwxr-xr-x 1 taylorr taylorr 6156 2009-04-09 14:35 hello.bin
>
> I started OpenOCD as follows:
>
> C:\Documents and Settings\Robert Taylor\Desktop>openocd -d 3 -l
> openocd.log -s "C:\Program Files\OpenOCD\0.1.0" -f
> interface\olimex-jtag-tiny-a.cfg -f board\stm3210e_eval.cfg
> Open On-Chip Debugger 0.1.0 (2009-01-21-21:15) Release
>
>
> BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
>
>
> $URL: 
> https://kc8...@svn.berlios.de/svnroot/repos/openocd/tags/openocd-0.1.0/src
> /openocd.c $
> User : 5 16 command.c:494 command_run_line():
> Debug: 7 16 command.c:91 script_command(): script_command - log_output
> Debug: 8 16 command.c:108 script_command(): script_command -
> log_output, argv[0]=ocd_log_output
> Debug: 9 16 command.c:108 script_command(): script_command -
> log_output, argv[1]=openocd.log
>
> I used Telnet to talk to the board as follows:
>
> Open On-Chip Debugger
>   
>> halt
>>     
> target was in unknown state when halt was requested
>
>   
>> stm32x unlock 0
>>     
> device id = 0x10016414
> flash size = 512kbytes
> stm32x unlocked
>
>   
>> flash erase_sector 0 0 0
>>     
> erased sectors 0 through 0 on flash bank 0 in 0.062500s
>
>   
>> flash write_bank 0 "C:/Documents and Settings/Robert 
>> Taylor/Desktop/hello.bin"
>>     
>  0
> flash writing failed with error code: 0xfffffc7a
> error writing to flash at address 0x08000000 at offset 0x00000000 (-902)
>
> called at file "command.c", line 456
> called at file "embedded:startup.tcl", line 89
> called at file "embedded:startup.tcl", line 93
>   
>
> The OpenOCD log has the following information:
>
> User : 10 16 command.c:494 command_run_line():
> Debug: 11 16 configuration.c:88 find_file(): found C:\Program
> Files\OpenOCD\0.1.0\bin\../interface\olimex-jtag-tiny-a.cfg
> Debug: 13 16 command.c:91 script_command(): script_command - interface
> Debug: 14 16 command.c:108 script_command(): script_command -
> interface, argv[0]=ocd_interface
> Debug: 15 16 command.c:108 script_command(): script_command -
> interface, argv[1]=ft2232
> Debug: 17 16 command.c:91 script_command(): script_command - 
> ft2232_device_desc
> Debug: 18 16 command.c:108 script_command(): script_command -
> ft2232_device_desc, argv[0]=ocd_ft2232_device_desc
> Debug: 19 16 command.c:108 script_command(): script_command -
> ft2232_device_desc, argv[1]=Olimex OpenOCD JTAG TINY A
> Debug: 21 16 command.c:91 script_command(): script_command - ft2232_layout
> Debug: 22 16 command.c:108 script_command(): script_command -
> ft2232_layout, argv[0]=ocd_ft2232_layout
> Debug: 23 16 command.c:108 script_command(): script_command -
> ft2232_layout, argv[1]=olimex-jtag
> User : 24 16 command.c:494 command_run_line():
> Debug: 25 16 configuration.c:88 find_file(): found C:\Program
> Files\OpenOCD\0.1.0\bin\../board\stm3210e_eval.cfg
> Debug: 26 16 configuration.c:88 find_file(): found C:\Program
> Files\OpenOCD\0.1.0\bin\../target/stm32.cfg
> Debug: 28 16 command.c:91 script_command(): script_command - jtag_khz
> Debug: 29 16 command.c:108 script_command(): script_command -
> jtag_khz, argv[0]=ocd_jtag_khz
> Debug: 30 16 command.c:108 script_command(): script_command -
> jtag_khz, argv[1]=500
> Debug: 31 16 jtag.c:2645 handle_jtag_khz_command(): handle jtag khz
> User : 32 16 command.c:383 command_print(): 500 kHz
> Debug: 34 16 command.c:91 script_command(): script_command - jtag_nsrst_delay
> Debug: 35 16 command.c:108 script_command(): script_command -
> jtag_nsrst_delay, argv[0]=ocd_jtag_nsrst_delay
> Debug: 36 16 command.c:108 script_command(): script_command -
> jtag_nsrst_delay, argv[1]=100
> Debug: 38 16 command.c:91 script_command(): script_command - jtag_ntrst_delay
> Debug: 39 16 command.c:108 script_command(): script_command -
> jtag_ntrst_delay, argv[0]=ocd_jtag_ntrst_delay
> Debug: 40 16 command.c:108 script_command(): script_command -
> jtag_ntrst_delay, argv[1]=100
> Debug: 42 16 command.c:91 script_command(): script_command - reset_config
> Debug: 43 16 command.c:108 script_command(): script_command -
> reset_config, argv[0]=ocd_reset_config
> Debug: 44 16 command.c:108 script_command(): script_command -
> reset_config, argv[1]=trst_and_srst
> Debug: 45 16 jtag.c:1892 jim_newtap_cmd(): Creating New Tap, Chip:
> stm32, Tap: cpu, Dotted: stm32.cpu, 8 params
> Debug: 46 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -irlen
> Debug: 47 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -ircapture
> Debug: 48 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -irmask
> Debug: 49 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -expected-id
> Debug: 50 16 jtag.c:2024 jim_newtap_cmd(): Created Tap: stm32.cpu @
> abs position 0, irlen 4, capture: 0x1 mask: 0xf
> Debug: 51 16 jtag.c:1892 jim_newtap_cmd(): Creating New Tap, Chip:
> stm32, Tap: bs, Dotted: stm32.bs, 8 params
> Debug: 52 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -irlen
> Debug: 53 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -ircapture
> Debug: 54 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -irmask
> Debug: 55 16 jtag.c:1911 jim_newtap_cmd(): Processing option: -expected-id
> Debug: 56 16 jtag.c:2024 jim_newtap_cmd(): Created Tap: stm32.bs @ abs
> position 1, irlen 5, capture: 0x1 mask: 0x1
> Debug: 57 16 target.c:3911 jim_target(): Target command params:
> Debug: 58 16 target.c:3912 jim_target(): target create stm32.cpu
> cortex_m3 -endian little -chain-position stm32.cpu
> Debug: 60 16 command.c:91 script_command(): script_command - bank
> Debug: 61 16 command.c:108 script_command(): script_command - bank,
> argv[0]=ocd_flash_bank
> Debug: 62 16 command.c:108 script_command(): script_command - bank,
> argv[1]=stm32x
> Debug: 63 16 command.c:108 script_command(): script_command - bank, argv[2]=0
> Debug: 64 16 command.c:108 script_command(): script_command - bank, argv[3]=0
> Debug: 65 16 command.c:108 script_command(): script_command - bank, argv[4]=0
> Debug: 66 16 command.c:108 script_command(): script_command - bank, argv[5]=0
> Debug: 67 16 command.c:108 script_command(): script_command - bank, argv[6]=0
> User : 68 16 command.c:494 command_run_line():
> Debug: 70 16 command.c:91 script_command(): script_command - init
> Debug: 71 16 command.c:108 script_command(): script_command - init,
> argv[0]=ocd_init
> Debug: 72 16 openocd.c:144 handle_init_command(): target init complete
> Debug: 73 16 ft2232.c:1463 ft2232_init_ftd2xx(): 'ft2232' interface
> using FTD2XX with 'olimex-jtag' layout (0403:6010)
> Debug: 74 47 ft2232.c:1550 ft2232_init_ftd2xx(): current latency timer: 2
> Debug: 75 47 ft2232.c:1966 olimex_jtag_init(): 80 08 1b
> Debug: 76 47 ft2232.c:2009 olimex_jtag_init(): 82 09 0f
> Debug: 77 47 ft2232.c:276 ft2232_speed(): 86 0b 00
> Debug: 78 62 openocd.c:151 handle_init_command(): jtag interface init complete
> Debug: 79 62 jtag.c:2240 jtag_init_inner(): Init JTAG chain
> Debug: 80 62 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG
> controller reset (RESET or TRST)
> Debug: 81 62 jtag.c:1487 jtag_reset_callback(): -
> Debug: 82 62 jtag.c:1487 jtag_reset_callback(): -
> Debug: 83 62 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG
> controller reset (RESET or TRST)
> Debug: 84 62 jtag.c:1487 jtag_reset_callback(): -
> Debug: 85 62 jtag.c:1487 jtag_reset_callback(): -
> Info : 86 62 jtag.c:1607 jtag_examine_chain(): JTAG tap: stm32.cpu
> tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00,
> Version: 0x3)
> Info : 87 62 jtag.c:1645 jtag_examine_chain(): JTAG Tap/device matched
> Info : 88 62 jtag.c:1607 jtag_examine_chain(): JTAG tap: stm32.bs
> tap/device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414,
> Version: 0x0)
> Info : 89 62 jtag.c:1645 jtag_examine_chain(): JTAG Tap/device matched
> Debug: 90 62 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG
> controller reset (RESET or TRST)
> Debug: 91 62 jtag.c:1487 jtag_reset_callback(): -
> Debug: 92 62 jtag.c:1487 jtag_reset_callback(): -
> Debug: 93 62 openocd.c:157 handle_init_command(): jtag init complete
> Debug: 94 62 cortex_swjdp.c:968 ahbap_debugport_init():
> Debug: 95 78 cortex_swjdp.c:1012 ahbap_debugport_init(): AHB-AP ID
> Register 0x14770011, Debug ROM Address 0xe00ff003
> Debug: 96 94 target.c:1185 target_read_u32(): address: 0xe000ed00,
> value: 0x411fc231
> Debug: 97 94 cortex_m3.c:1395 cortex_m3_examine(): CORTEX-M3 processor 
> detected
> Debug: 98 94 cortex_m3.c:1396 cortex_m3_examine(): cpuid: 0x411fc231
> Debug: 99 94 target.c:1185 target_read_u32(): address: 0xe000e004,
> value: 0x00000001
> Debug: 100 94 target.c:1185 target_read_u32(): address: 0xe000e100,
> value: 0x00000000
> Debug: 101 94 cortex_m3.c:1404 cortex_m3_examine(): interrupt
> enable[0] = 0x00000000
> Debug: 102 109 target.c:1185 target_read_u32(): address: 0xe000e104,
> value: 0x00000000
> Debug: 103 109 cortex_m3.c:1404 cortex_m3_examine(): interrupt
> enable[1] = 0x00000000
> Debug: 104 125 target.c:1185 target_read_u32(): address: 0xe0002000,
> value: 0x00000260
> Debug: 105 125 cortex_m3.c:1420 cortex_m3_examine(): FPB fpcr 0x260,
> numcode 6, numlit 2
> Debug: 106 125 target.c:1185 target_read_u32(): address: 0xe0001000,
> value: 0x40000000
> Debug: 107 125 openocd.c:160 handle_init_command(): jtag examine complete
> Debug: 108 125 openocd.c:166 handle_init_command(): flash init complete
> Debug: 109 125 openocd.c:170 handle_init_command(): mflash init complete
> Debug: 110 125 openocd.c:174 handle_init_command(): NAND init complete
> Debug: 111 125 openocd.c:178 handle_init_command(): pld init complete
> Warn : 112 125 telnet_server.c:612 telnet_init(): no telnet port
> specified, using default port 4444
> Warn : 113 141 gdb_server.c:2201 gdb_init(): no gdb port specified,
> using default port 3333
> Debug: 114 156 gdb_server.c:2225 gdb_init(): gdb service for target
> cortex_m3 at port 3333
> Warn : 115 156 tcl_server.c:178 tcl_init(): no tcl port specified,
> using default port 6666
> User : 116 156 command.c:494 command_run_line():
> Info : 117 4156 server.c:89 add_connection(): accepting 'telnet'
> connection from 0
> Debug: 119 13094 command.c:91 script_command(): script_command - halt
> Debug: 120 13094 command.c:108 script_command(): script_command -
> halt, argv[0]=ocd_halt
> Debug: 121 13094 target.c:1744 handle_halt_command(): -
> Debug: 122 13094 cortex_m3.c:485 cortex_m3_halt(): target->state: unknown
> Warn : 123 13094 cortex_m3.c:495 cortex_m3_halt(): target was in
> unknown state when halt was requested
> User : 124 13109 command.c:494 command_run_line():
> Debug: 126 38484 command.c:91 script_command(): script_command - unlock
> Debug: 127 38484 command.c:108 script_command(): script_command -
> unlock, argv[0]=ocd_stm32x_unlock
> Debug: 128 38484 command.c:108 script_command(): script_command -
> unlock, argv[1]=0
> Debug: 129 38500 target.c:1185 target_read_u32(): address: 0xe0042000,
> value: 0x10016414
> Info : 130 38500 stm32x.c:706 stm32x_probe(): device id = 0x10016414
> Debug: 131 38500 target.c:1210 target_read_u16(): address: 0x1ffff7e0,
> value: 0x0200
> Info : 132 38500 stm32x.c:766 stm32x_probe(): flash size = 512kbytes
> Debug: 133 38500 target.c:1185 target_read_u32(): address: 0x4002201c,
> value: 0x03fffffc
> Debug: 134 38516 target.c:1185 target_read_u32(): address: 0x40022020,
> value: 0xffffffff
> Debug: 135 38516 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0x45670123
> Debug: 136 38516 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0xcdef89ab
> Debug: 137 38531 target.c:1253 target_write_u32(): address:
> 0x40022008, value: 0x45670123
> Debug: 138 38531 target.c:1253 target_write_u32(): address:
> 0x40022008, value: 0xcdef89ab
> Debug: 139 38531 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000220
> Debug: 140 38547 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000260
> Debug: 141 38547 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000003
> Debug: 142 38547 stm32x.c:128 stm32x_wait_status_busy(): status: 0x3
> Debug: 143 38562 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000003
> Debug: 144 38562 stm32x.c:128 stm32x_wait_status_busy(): status: 0x3
> Debug: 145 38562 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000003
> Debug: 146 38562 stm32x.c:128 stm32x_wait_status_busy(): status: 0x3
> Debug: 147 38578 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 148 38578 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0x45670123
> Debug: 149 38578 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0xcdef89ab
> Debug: 150 38594 target.c:1253 target_write_u32(): address:
> 0x40022008, value: 0x45670123
> Debug: 151 38594 target.c:1253 target_write_u32(): address:
> 0x40022008, value: 0xcdef89ab
> Debug: 152 38609 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000210
> Debug: 153 38609 target.c:1274 target_write_u16(): address:
> 0x1ffff802, value: 0x0000ffff
> Debug: 154 38625 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 155 38625 target.c:1274 target_write_u16(): address:
> 0x1ffff808, value: 0x0000ffff
> Debug: 156 38641 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 157 38641 target.c:1274 target_write_u16(): address:
> 0x1ffff80a, value: 0x0000ffff
> Debug: 158 38656 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 159 38656 target.c:1274 target_write_u16(): address:
> 0x1ffff80c, value: 0x0000ffff
> Debug: 160 38656 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 161 38656 target.c:1274 target_write_u16(): address:
> 0x1ffff80e, value: 0x000000ff
> Debug: 162 38672 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 163 38672 target.c:1274 target_write_u16(): address:
> 0x1ffff800, value: 0x00005aa5
> Debug: 164 38687 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 165 38687 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000080
> User : 166 38687 command.c:383 command_print(): stm32x unlocked
> User : 167 38687 command.c:494 command_run_line():
> Debug: 169 59000 command.c:91 script_command(): script_command - erase_sector
> Debug: 170 59000 command.c:108 script_command(): script_command -
> erase_sector, argv[0]=ocd_flash_erase_sector
> Debug: 171 59000 command.c:108 script_command(): script_command -
> erase_sector, argv[1]=0
> Debug: 172 59000 command.c:108 script_command(): script_command -
> erase_sector, argv[2]=0
> Debug: 173 59000 command.c:108 script_command(): script_command -
> erase_sector, argv[3]=0
> Debug: 174 59000 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0x45670123
> Debug: 175 59016 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0xcdef89ab
> Debug: 176 59016 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000002
> Debug: 177 59031 target.c:1253 target_write_u32(): address:
> 0x40022014, value: 0x08000000
> Debug: 178 59031 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000042
> Debug: 179 59047 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000023
> Debug: 180 59047 stm32x.c:128 stm32x_wait_status_busy(): status: 0x23
> Debug: 181 59047 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000023
> Debug: 182 59047 stm32x.c:128 stm32x_wait_status_busy(): status: 0x23
> Debug: 183 59062 target.c:1185 target_read_u32(): address: 0x4002200c,
> value: 0x00000020
> Debug: 184 59062 target.c:1253 target_write_u32(): address:
> 0x40022010, value: 0x00000080
> User : 185 59062 command.c:383 command_print(): erased sectors 0
> through 0 on flash bank 0 in 0.062500s
> User : 186 59062 command.c:494 command_run_line():
> Debug: 188 107984 command.c:91 script_command(): script_command - write_bank
> Debug: 189 107984 command.c:108 script_command(): script_command -
> write_bank, argv[0]=ocd_flash_write_bank
> Debug: 190 107984 command.c:108 script_command(): script_command -
> write_bank, argv[1]=0
> Debug: 191 107984 command.c:108 script_command(): script_command -
> write_bank, argv[2]=C:/Documents and Settings/Robert
> Taylor/Desktop/hello.bin
> Debug: 192 107984 command.c:108 script_command(): script_command -
> write_bank, argv[3]=0
> Debug: 193 107984 configuration.c:88 find_file(): found C:/Documents
> and Settings/Robert Taylor/Desktop/hello.bin
> Debug: 194 107984 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0x45670123
> Debug: 195 107984 target.c:1253 target_write_u32(): address:
> 0x40022004, value: 0xcdef89ab
> Debug: 196 107984 target.c:819 target_alloc_working_area(): allocating
> new working area
> Debug: 197 107984 target.c:975 target_write_buffer(): writing buffer
> of 48 byte at 0x20000000
> Debug: 198 108000 target.c:819 target_alloc_working_area(): allocating
> new working area
> Debug: 199 108000 target.c:975 target_write_buffer(): writing buffer
> of 6156 byte at 0x20000030
> Debug: 200 108187 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 0  value 0x16
> Debug: 201 108219 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 1  value 0xf4
> Debug: 202 108234 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 2  value 0xf522fe4b
> Debug: 203 108250 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 3  value 0xf41f4593
> Debug: 204 108250 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 4  value 0xdf7ffffe
> Debug: 205 108266 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 5  value 0xffff7ffd
> Debug: 206 108297 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 6  value 0xf4e1380
> Debug: 207 108312 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 7  value 0x1c41650d
> Debug: 208 108328 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 8  value 0xa010fbff
> Debug: 209 108344 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 9  value 0xffffffff
> Debug: 210 108359 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 10  value 0xa9d93759
> Debug: 211 108375 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 11  value 0x34201af3
> Debug: 212 108391 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 12  value 0xfdfffffd
> Debug: 213 108406 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 13  value 0x100340
> Debug: 214 108437 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 14  value 0xfffffff9
> Debug: 215 108453 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 15  value 0x17b8
> Debug: 216 108469 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 16  value 0x1000003
> Debug: 218 108484 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 17  value 0x100340
> Debug: 219 108516 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 18  value 0xdf5c9720
> Debug: 220 108531 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 19 value 0x0
> Debug: 221 108547 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 20 value 0x0
> Debug: 222 108562 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 21 value 0x0
> Debug: 223 108578 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 22 value 0x0
> Debug: 224 108578 breakpoints.c:93 breakpoint_add(): added software
> breakpoint at 0x20000026 of length 0x00000002
> Debug: 225 108578 armv7m.c:134 armv7m_restore_context():
> Debug: 226 108625 cortex_m3.c:1282 cortex_m3_store_core_reg_u32():
> write special reg 19 value 0x1
> Debug: 227 108625 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 19 value 0x1
> Debug: 228 108641 cortex_m3.c:1253 cortex_m3_store_core_reg_u32():
> write core reg 16 value 0x1000003
> Debug: 229 108641 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 16 value 0x1000003
> Debug: 230 108656 cortex_m3.c:1253 cortex_m3_store_core_reg_u32():
> write core reg 15 value 0x20000000
> Debug: 231 108656 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 15 value 0x20000000
> Debug: 232 108672 cortex_m3.c:1253 cortex_m3_store_core_reg_u32():
> write core reg 3 value 0x3f0178
> Debug: 233 108672 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 3 value 0x3f0178
> Debug: 234 108687 cortex_m3.c:1253 cortex_m3_store_core_reg_u32():
> write core reg 2 value 0xc06
> Debug: 235 108687 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 2 value 0xc06
> Debug: 236 108703 cortex_m3.c:1253 cortex_m3_store_core_reg_u32():
> write core reg 1 value 0x8000000
> Debug: 237 108703 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 1 value 0x8000000
> Debug: 238 108719 cortex_m3.c:1253 cortex_m3_store_core_reg_u32():
> write core reg 0 value 0x20000030
> Debug: 239 108719 armv7m.c:243 armv7m_write_core_reg(): write core reg
> 0 value 0x20000030
> Debug: 240 108734 target.c:696 target_call_event_callbacks(): target
> event 23 (debug-resumed)
> Debug: 241 108734 target.c:3054 target_handle_event(): event: 23
> debug-resumed - no action
> Debug: 242 108734 cortex_m3.c:644 cortex_m3_resume(): target debug
> resumed at 0x20000000
> Debug: 243 108734 target.c:1724 target_wait_state(): waiting for
> target halted...
> Debug: 244 108781 cortex_m3.c:460 cortex_m3_poll():
> Debug: 245 108781 cortex_m3.c:338 cortex_m3_debug_entry():
> Debug: 246 108812 cortex_m3.c:133 cortex_m3_clear_halt():  NVIC_DFSR 0x3
> Debug: 247 108828 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 0  value 0x20000834
> Debug: 248 108859 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 1  value 0x8000804
> Debug: 249 108875 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 2  value 0x805
> Debug: 250 108891 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 3  value 0x27
> Debug: 251 108906 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 4  value 0x40022010
> Debug: 252 108922 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 5  value 0x4002200c
> Debug: 253 108937 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 6  value 0xf4e1380
> Debug: 254 108953 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 7  value 0x1c41650d
> Debug: 255 108969 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 8  value 0xa010fbff
> Debug: 256 108984 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 9  value 0xffffffff
> Debug: 258 109016 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 10  value 0xa9d93759
> Debug: 259 109031 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 11  value 0x34201af3
> Debug: 260 109031 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 12  value 0xfdfffffd
> Debug: 261 109062 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 13  value 0x100340
> Debug: 262 109078 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 14  value 0xfffffff9
> Debug: 263 109094 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 15  value 0x20000026
> Debug: 264 109109 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 16  value 0x21000003
> Debug: 265 109125 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 17  value 0x100340
> Debug: 266 109141 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 18  value 0xdf5c9720
> Debug: 267 109172 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 19 value 0x1
> Debug: 268 109187 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 20 value 0x0
> Debug: 269 109203 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 21 value 0x0
> Debug: 270 109219 cortex_m3.c:1213 cortex_m3_load_core_reg_u32(): load
> from special reg 22 value 0x0
> Debug: 271 109234 cortex_m3.c:323
> cortex_m3_examine_exception_reason(): HardFault SHCSR 0x0, SR
> 0xc0000000, CFSR 0x1000, AR 0xffffffff
> Debug: 272 109234 cortex_m3.c:400 cortex_m3_debug_entry(): entered
> debug state in core mode: Handler at PC 0x20000026, target->state:
> halted
> Debug: 273 109234 target.c:696 target_call_event_callbacks(): target
> event 22 (debug-halted)
> Debug: 274 109234 target.c:3054 target_handle_event(): event: 22
> debug-halted - no action
> Debug: 275 109250 cortex_m3.c:1187 cortex_m3_load_core_reg_u32(): load
> from core reg 15  value 0x20000026
> Debug: 276 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register control with value 0x00000000
> Debug: 277 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register faultmask with value 0x00000000
> Debug: 278 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register basepri with value 0x00000000
> Debug: 279 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register primask with value 0x00000000
> Debug: 280 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register psp with value 0xdf5c9720
> Debug: 281 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register msp with value 0x00100340
> Debug: 282 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register xPSR with value 0x01000003
> Debug: 283 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register pc with value 0x000017b8
> Debug: 284 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register lr with value 0xfffffff9
> Debug: 285 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register sp with value 0x00100340
> Debug: 286 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r12 with value 0xfdfffffd
> Debug: 287 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r11 with value 0x34201af3
> Debug: 288 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r10 with value 0xa9d93759
> Debug: 289 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r9 with value 0xffffffff
> Debug: 290 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r8 with value 0xa010fbff
> Debug: 291 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r7 with value 0x1c41650d
> Debug: 292 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r6 with value 0x0f4e1380
> Debug: 293 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r5 with value 0xffff7ffd
> Debug: 294 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r4 with value 0xdf7ffffe
> Debug: 295 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r3 with value 0xf41f4593
> Debug: 296 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r2 with value 0xf522fe4b
> Debug: 297 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r1 with value 0x000000f4
> Debug: 298 109266 armv7m.c:452 armv7m_run_algorithm(): restoring
> register r0 with value 0x00000016
> Error: 299 109266 stm32x.c:630 stm32x_write(): flash writing failed
> with error code: 0xfffffc7a
> Error: 300 109266 flash.c:113 flash_driver_write(): error writing to
> flash at address 0x08000000 at offset 0x00000000 (-902)
> Debug: 301 109266 command.c:427 run_command(): Command failed with
> error code -902
> User : 302 109266 command.c:626 openocd_jim_vfprintf():
> User : 304 109266 command.c:626 openocd_jim_vfprintf():
> User : 306 109266 command.c:626 openocd_jim_vfprintf():
> User : 308 109266 command.c:626 openocd_jim_vfprintf():
>
> Do you think this is an OpenOCD problem or something to do with the
> commands I'm using in Telnet? I can flash a smaller program (see end
> of email) with no errors.
>
> Thanks,
> Robert
>
> Demo program:
>
> int
> main ()
> {
>   int i = 0;
>   return 0;
> }
> _______________________________________________
> Openocd-development mailing list
> Openocd-development@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/openocd-development
>   

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to