Hiya, I've found a few issues in OpenOCD and thought that I'd share before hacking a solution together. The following revision is used:
commit 8f446fcf676e9cd13cf53d9946f0cae5d29a10ec Date: Thu Nov 19 13:23:49 2009 -0800 When doing "flash write_image erase unlock image.bin 0x8000000 bin" on an STM32, the following error is generated: auto erase enabled auto unlock enabled Info : device id = 0x20036410 Info : flash size = 128kbytes Warn : Error: start and end sectors must be on a 4 sector boundary Error: failed setting protection for areas 0 to 21 (-901) So it seems we need write_image to be a bit smarter and do some boundary aligning before doing the unprotect / erase . The way I was thinking to do this is to add a configuration parameter to OpenOCD which tells it to be smart ( or not ) when encountering alignment issues like this one. For example "smartalign on" and "smartalign off". "smartalign on" will make OpenOCD adjust alignment automatically to be valid. Anyone go a better idea? Also I've noticed that the following two commands have stopped working, at least on STM32: - flash protect 0 0 last off - flash erase_sector 0 0 last OpenOCD just exits and the -d parameter only yields this: User : 208 1276 command.c:608 jim_echo(): ---Removing write protection--- Debug: 210 1279 command.c:64 script_debug(): command - protect Debug: 211 1279 command.c:74 script_debug(): protect - argv[0]=ocd_flash_protect Debug: 212 1279 command.c:74 script_debug(): protect - argv[1]=0 Debug: 213 1279 command.c:74 script_debug(): protect - argv[2]=0 Debug: 214 1279 command.c:74 script_debug(): protect - argv[3]=last Debug: 215 1279 command.c:74 script_debug(): protect - argv[4]=off User : 217 1282 command.c:675 openocd_jim_vfprintf(): User : 219 1282 command.c:675 openocd_jim_vfprintf(): User : 221 1282 command.c:675 openocd_jim_vfprintf(): User : 223 1282 command.c:675 openocd_jim_vfprintf(): User : 224 1283 command.c:675 openocd_jim_vfprintf(): User : 227 1283 command.c:675 openocd_jim_vfprintf(): User : 229 1283 command.c:675 openocd_jim_vfprintf(): User : 231 1283 command.c:675 openocd_jim_vfprintf(): User : 233 1283 command.c:675 openocd_jim_vfprintf(): User : 235 1283 command.c:675 openocd_jim_vfprintf(): User : 237 1283 command.c:675 openocd_jim_vfprintf(): make: *** [flash] Error 1 and User : 207 1027 command.c:608 jim_echo(): ---Erasing--- Debug: 209 1029 command.c:64 script_debug(): command - erase_sector Debug: 210 1029 command.c:74 script_debug(): erase_sector - argv[0]=ocd_flash_erase_sector Debug: 211 1029 command.c:74 script_debug(): erase_sector - argv[1]=0 Debug: 212 1029 command.c:74 script_debug(): erase_sector - argv[2]=0 Debug: 213 1029 command.c:74 script_debug(): erase_sector - argv[3]=last User : 215 1032 command.c:675 openocd_jim_vfprintf(): User : 216 1032 command.c:675 openocd_jim_vfprintf(): User : 219 1032 command.c:675 openocd_jim_vfprintf(): User : 221 1032 command.c:675 openocd_jim_vfprintf(): User : 223 1032 command.c:675 openocd_jim_vfprintf(): User : 225 1032 command.c:675 openocd_jim_vfprintf(): User : 227 1032 command.c:675 openocd_jim_vfprintf(): User : 229 1032 command.c:675 openocd_jim_vfprintf(): make: *** [flash] Error 1 OpenOCD apparently exits with an error, but why; I don't know. The mass_erase command, on the other hand, does work as it should. I've yet do dig in to this, but for lack of time, haven't done so yet. Perhaps somebody already knows the answer. If not, I'll try and find the cause some time next week. Cheers, Johnny _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development