2014-01-09 03:31 AM
Hello,
I like to program my STM32F103 with the ST-link/V2 device by using openOCD. However I got next message: Error: flash write failed at address 0x80016f8 Error: error writing to flash at address 0x08000000 at offset 0x00000000 By using the ST-link Utility, it works fine with the same programmer. I am using the stm32f1x_stlink.cfg target script and next openocd script for writing: I call this script from my makefile (IMGFILE is my binary) roc stm_flash {IMGFILE} { reset halt sleep 10 wait_halt 2 flash write_image erase $IMGFILE 0x08008000 sleep 10 verify_image $IMGFILE 0x08008000 sleep 10 reset run } Does anyone has an idea what is going on? Regards Evert Huijben Here is the complete logging: make program Open On-Chip Debugger 0.6.1 (2014-01-08-11:14) Licensed under GNU GPL v2 For bug reports, read adapter speed: 1000 kHz srst_only separate srst_nogate srst_open_drain Info : clock speed 1000 kHz Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints stm_erase target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000160 msp: 0x20000400 auto erase enabled Info : device id = 0x20036410 Info : flash size = 128kbytes Error: flash write algorithm aborted by target target state: halted target halted due to breakpoint, current mode: Thread xPSR: 0x01000000 pc: 0x08000160 msp: 0x20000400 Error: flash write failed at address 0x80016f8 Error: error writing to flash at address 0x08000000 at offset 0x00000000 Runtime Error: /home/evert/sandbox/multi_IO/projects/chibiOs/make/../../../boards/multiIo/stm32f1-openocd.cfg:12: in procedure 'stm_flash' in procedure 'flash' called at file ''/home/evert/sandbox/multi_IO/projects/chibiOs/make/../../../boards/multiIo/stm32f1-openocd.cfg'', line 12 make: Nothing to be done for `program'. #openocd2014-01-09 03:39 AM
Doesn't OpenOCD have it's own forum? You'd have better luck there
https://forum.sparkfun.com/viewforum.php?f=18
2014-01-09 03:51 AM
Hi
While I do not have a solution to your problem, you can check the problem is not the STM32F103 with the ST-link/V2. Compile and link a Intel Hex or Motorola S-Rec output file. Load this into ST-Link Utility and program the STM32F103. If there is a problem with the STM32F103 or ST-Link the utility program will tell you.2014-01-09 04:01 AM
''By using the ST-link Utility, it works fine with the same programmer.''
2014-01-09 05:39 AM
As I said, with the ST-linkV2 programmer and the ST-link utility everything works fine.
Evert Huijben2014-01-15 07:25 AM
According to your log you are using OpenOCD v0.6.1 - that is very old.
I suggest if possible to build from src and use the latest master branch. Cheers Spen2014-01-17 06:58 AM
Is there a reason to use OpenOCD? Are you using Linux?
If you are using Windows, you might like to try CoIDE (Windows-only/ARM-only).http://www.coocox.org/CooCox_CoIDE.htm