AnsweredAssumed Answered

[STM32F0] SWD write problem

Question asked by paniagua.guillaume on Jul 7, 2014
Latest reply on Apr 13, 2015 by goverdovskiy.andrey
Hi everybody,
I'm working with an  ST-LINK from a discovery board STM32F4 to debug an external application on a custom board which embedded  an STM32F0 (my target). 
The ST-LINK seem to be good because there's no problem to perform read and write operation on the discovery MCU (stm32f4).
So i connect the SWD signals to the custom board's MCU as describe bellow:
RESET: Reset pin

My first problem is that i need to choose "connect under reset" in the st-link utility while i have a blank MCU. (i don't understand why because there's no pin config yet)

The second problem is that the software is able to read the memory content but it can't write anything in the flash memory. 

3 pop up displayed: 
"Elf loader could not be transfered to the device. Change ...."  
then "Error occured during memory writing!" 
and finally "Can not connect to device!"
The Log show:
15:28:02 : Could not set Option bytes!
                              Please reset the target and retry.
            16:30:10 : Elf Loader could not be transfered to device.
                              Change 'Target/Settings/Connetion' mode to <<Connect Under Reset>> and Try again.
            16:31:29 : Error occured during memory writing!
            16:31:56 : Can not connect to device! 

I had a look on memory protection but st link utility seem to unlock the memory himself. Am i right ?

I would like to understand if it's an hardware or a software issue.

I also attach the SWDIO oscilloscope signals if it can help. 
Thanks in advance.