Hello,
I have downloaded today last git repo of OpenOCD (git://repo.or.cz/openocd.git) As previously, I still have problem to erase and program STM32. I sent a patch to create unlock_mass_erase function ([PATCH] stm32 : improve unlock procedure for mass_erase) but it was never accepted because of the name of the function. Then someone propose to only keep one mass_erase function and adding parameters but this broke the compatibility with previous and finally, my patch was never committed !

So, can someone gave me the commend sequence to flash a STM32 with last release of OpenOCD, please ?

Here is what i have tried (cfg files are the one found in tcl directory) :

source [find jlink.cfg]
source [find stm32.cfg]
init
jtag_khz 100
flash probe 0
halt
stm32x unlock 0
reset init
flash protect 0 0 last off
flash erase_sector 0 0 last
flash write_bank 0 myapp.bin 0x0
flash protect 0 0 last on
verify_image myapp.bin 0x0
reset run
sleep 30
shutdown

First flash is working, if I run flash once more, protect off is working but I get an error on erase_sector:

cleared protection for sectors 0 through 127 on flash bank 0
Error: stm32x device protected
Error: failed erasing sectors 0 to 127

Then I try a third time and it's working, and so on.

Thanks a lot for your help.
Gaëtan
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to