My OpenOCD is SVN 695
My log file:
Debug: 1137 18895 command.c:430 command_run_line(): sleep 10
Debug: 1138 18906 command.c:430 command_run_line(): mdw 0x40010C00 7
Debug: 1139 18906 cortex_swjdp.c:671 ahbap_read_buf_u32(): Looooooooook
Debug: 1140 18906 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xA2000012 to 0x00000000
Debug: 1141 18906 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0x40010C00 to 0x00000004
Info: 1142 19008 options.c:50 configuration_output_handler(): 0x40010c00: 44484444 44444441 0000fe13 00000010 00000000 00000000 00000000
Debug: 1143 19008 command.c:430 command_run_line(): sleep 10
Debug: 1144 19019 command.c:430 command_run_line(): mww 0x40010C0C 0x00000000
Debug: 1145 19019 cortex_swjdp.c:408 ahbap_write_buf_u32(): Looooooooook, count = 4, address = 0x40010C0C
Debug: 1146 19019 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0x40010C0C to 0x00000004
Debug: 1147 19063 command.c:430 command_run_line(): sleep 10
Debug: 1148 19074 command.c:430 command_run_line(): mdw 0x08000000 1
Debug: 1149 19074 cortex_swjdp.c:671 ahbap_read_buf_u32(): Looooooooook
Debug: 1150 19074 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0x08000000 to 0x00000004
Info: 1151 19126 options.c:50 configuration_output_handler(): 0x08000000: 20002000
Debug: 1152 19126 command.c:430 command_run_line(): sleep 10
Debug: 1153 19137 command.c:430 command_run_line(): mww 0x08000000 0x00000000
Debug: 1154 19137 cortex_swjdp.c:408 ahbap_write_buf_u32(): Looooooooook, count = 4, address = 0x08000000
Debug: 1155 19137 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0x08000000 to 0x00000004
Debug: 1156 19180 cortex_swjdp.c:208 swjdp_transaction_endcheck(): swjdp: CTRL/STAT error 0xf0000021
Error: 1157 19180 cortex_swjdp.c:222 swjdp_transaction_endcheck(): SWJ-DP STICKY ERROR
Debug: 1158 19195 cortex_swjdp.c:229 swjdp_transaction_endcheck(): swjdp: status 0xf0000001
Debug: 1159 19195 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000EDF0
Debug: 1160 19195 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xA2000002 to 0x00000000
Debug: 1161 19195 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xE000EDF0 to 0x00000004
Debug: 1162 19196 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000010
Debug: 1163 19268 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000ED24
Debug: 1164 19268 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xE000ED20 to 0x00000004
Debug: 1165 19268 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000014
Debug: 1166 19342 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000ED28
Debug: 1167 19342 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000018
Debug: 1168 19389 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000ED38
Debug: 1169 19389 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xE000ED30 to 0x00000004
Debug: 1170 19389 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000018
Error: 1171 19462 cortex_swjdp.c:236 swjdp_transaction_endcheck(): dcb_dhcsr 0x30003, nvic_shcsr 0x20000, nvic_cfsr 0x0, nvic_bfar 0xe000edf8
Debug: 1172 19462 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xA2000012 to 0x00000000
Debug: 1173 19462 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0x08000000 to 0x00000004
Debug: 1174 19514 cortex_swjdp.c:208 swjdp_transaction_endcheck(): swjdp: CTRL/STAT error 0xf0000021
Error: 1175 19514 cortex_swjdp.c:222 swjdp_transaction_endcheck(): SWJ-DP STICKY ERROR
Debug: 1176 19529 cortex_swjdp.c:229 swjdp_transaction_endcheck(): swjdp: status 0xf0000001
Debug: 1177 19529 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000EDF0
Debug: 1178 19529 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xA2000002 to 0x00000000
Debug: 1179 19529 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xE000EDF0 to 0x00000004
Debug: 1180 19530 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000010
Debug: 1181 19604 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000ED24
Debug: 1182 19604 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xE000ED20 to 0x00000004
Debug: 1183 19604 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000014
Debug: 1184 19679 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000ED28
Debug: 1185 19679 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000018
Debug: 1186 19726 cortex_swjdp.c:362 ahbap_read_system_atomic_u32(): Looooooooook,read 0xE000ED38
Debug: 1187 19726 cortex_swjdp.c:294 ahbap_write_reg_u32(): Looooooooook,write 0xE000ED30 to 0x00000004
Debug: 1188 19726 cortex_swjdp.c:305 ahbap_read_reg_u32(): Looooooooook,read 0x00000018
Error: 1189 19799 cortex_swjdp.c:236 swjdp_transaction_endcheck(): dcb_dhcsr 0x30003, nvic_shcsr 0x20000, nvic_cfsr 0x0, nvic_bfar 0xe000edf8
Warning: 1190 19799 cortex_swjdp.c:464 ahbap_write_buf_u32(): Block write error address 0x8000000, wcount 0x1
Debug: 1191 19799 command.c:387 find_and_run_command(): Command failed with error code -107
commands:
sleep 10
mdw 0x40010C00 7 // get the right value
sleep 10
mww 0x40010C0C 0x00000000 // OK, LEDs are set off(0x40010C0C is GPIOB_ODR which control the GPIO Output Data)
sleep 10
mdw 0x08000000 1 // read flash 0x08000000, the value read is OK the same as the program
sleep 10
mww 0x08000000 0x00000000 // write 0 to flash address 0x08000000, this fails, why?
Other commands run well, so I think there is no problem with the hardware. But why last write flash command fails?
How should I write flash word?