Hi, Øyvind Harboe wrote: > > Could you include a debug_level 3 trace? > > The conclusion seems a bit premature based on the limited information > above. > >
Maybe the following example (output is pasted below) can illustrate the issue a bit better. First I try to flash a 20KB block, then a 21KB block and finally a 24KB block. Only the blocks of 20 and 24 succeed, because they happen to be nicely 4K alligned. All blocks that are not 4K alligned will fail. OpenOCD tries to erase, (un)protect and flash only those sectors that are modified, but doesn't take into account that some platforms require certain alligments. Debug level 3 yields nothing interresting: User : 209 1107 command.c:608 jim_echo(): ---Flashing--- Debug: 211 1110 command.c:64 script_debug(): command - write_image Debug: 212 1110 command.c:74 script_debug(): write_image - argv[0]=ocd_flash_write_image Debug: 213 1110 command.c:74 script_debug(): write_image - argv[1]=erase Debug: 214 1110 command.c:74 script_debug(): write_image - argv[2]=unlock Debug: 215 1110 command.c:74 script_debug(): write_image - argv[3]=out/monster_flash.bin Debug: 216 1110 command.c:74 script_debug(): write_image - argv[4]=0x8000000 Debug: 217 1110 command.c:74 script_debug(): write_image - argv[5]=bin User : 218 1110 command.c:405 command_print(): auto erase enabled User : 219 1110 command.c:405 command_print(): auto unlock enabled Debug: 220 1123 configuration.c:83 find_file(): found out/monster_flash.bin Debug: 221 1126 target.c:1516 target_read_u32(): address: 0xe0042000, value: 0x20036410 Info : 222 1126 stm32x.c:677 stm32x_probe(): device id = 0x20036410 Debug: 223 1128 target.c:1544 target_read_u16(): address: 0x1ffff7e0, value: 0x0080 Info : 224 1128 stm32x.c:752 stm32x_probe(): flash size = 128kbytes Warn : 225 1129 stm32x.c:366 stm32x_protect(): Error: start and end sectors must be on a 4 sector boundary Error: 226 1129 flash.c:117 flash_driver_protect(): failed setting protection for areas 0 to 20 (-901) Debug: 227 1129 command.c:472 run_command(): Command failed with error code -901 User : 228 1129 command.c:675 openocd_jim_vfprintf(): User : 231 1129 command.c:675 openocd_jim_vfprintf(): User : 233 1129 command.c:675 openocd_jim_vfprintf(): User : 235 1129 command.c:675 openocd_jim_vfprintf(): User : 237 1129 command.c:675 openocd_jim_vfprintf(): User : 239 1129 command.c:675 openocd_jim_vfprintf(): User : 241 1129 command.c:675 openocd_jim_vfprintf(): make: *** [flash] Error 1 Here's the output of the examples I mentioned: bla /1/arm/workspace/monster $ dd if=/dev/zero of=out/monster_flash.bin bs=1024 count=20 20+0 records in 20+0 records out 20480 bytes (20 kB) copied, 0.00668803 s, 3.1 MB/s bla /1/arm/workspace/monster $ rm flash -f ;make flash ---Flashing--- auto erase enabled auto unlock enabled Info : device id = 0x20036410 Info : flash size = 128kbytes wrote 20480 byte from file out/monster_flash.bin in 2.049710s (9.757 kb/s) ---Done--- bla /1/arm/workspace/monster $ dd if=/dev/zero of=out/monster_flash.bin bs=1024 count=21 21+0 records in 21+0 records out 21504 bytes (22 kB) copied, 0.00829303 s, 2.6 MB/s bla /1/arm/workspace/monster $ rm flash -f ;make flash ---Flashing--- 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 20 (-901) make: *** [flash] Error 1 bla /1/arm/workspace/monster $ dd if=/dev/zero of=out/monster_flash.bin bs=1024 count=24 24+0 records in 24+0 records out 24576 bytes (25 kB) copied, 0.00896715 s, 2.7 MB/s bla /1/arm/workspace/monster $ rm flash -f ;make flash ---Flashing--- auto erase enabled auto unlock enabled Info : device id = 0x20036410 Info : flash size = 128kbytes wrote 24576 byte from file out/monster_flash.bin in 2.299153s (10.439 kb/s) ---Done--- _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development