cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F0] SWD write problem

paniagua
Associate
Posted on July 07, 2014 at 16:48

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:

SWCLK: PA14

GND: GND

SWDIO: PA13

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.
7 REPLIES 7
Posted on July 07, 2014 at 16:56

To support an F0 device you'd need to make sure you have sufficiently current firmware on the F4-DISCO.

You need to also make sure you have adequately disconnected the F4 from the ST-LINK, via the jumpers and solder-bridges, so that it doesn't interfere with the operation of the F0 you have now attached.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
paniagua
Associate
Posted on July 07, 2014 at 17:08

Thanks for the reply,

SB11 is OFF, jumpers are OFF and the firmware is V2J17F0.

I have successfully tested the process with this ST-LINK and a F0 DISCOVERY board.

But still not working on my custom board.

I have successfully programmed the board in DFU mode if it can help.
dscdsc
Senior
Posted on April 07, 2015 at 16:40

I have the same problem, except that I don't get the ''Can not connect to device!'' error in the end.

I've uploaded a binary file to the chip before and I can still connect to it and read its contents, but erasing any blocks leads to the error.

I'm using STM32F051C8T6 on a custom board.

dscdsc
Senior
Posted on April 09, 2015 at 15:12

Bump.

dscdsc
Senior
Posted on April 12, 2015 at 16:25

Bump #2.

Posted on April 12, 2015 at 18:05

The pool here is pretty shallow. I have very marginal interest in Cortex-M0 parts. Instead of bumping threads, ask yourself why it might be ignored.

You have a similar problem, but different? You have an error, it's different but there's no log or diagnostic output. You have the same firmware, perhaps not? You have a different board? You've tested the JTAG/SWD interface with any other equipment? Does an F0-DISCO work? Does a ST-LINK V2 work? Does the behaviour change if you strap BOOT0 High?

May be you both have errors in your board designs.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dscdsc
Senior
Posted on April 13, 2015 at 15:17

Thanks for your reply, you've practically solved my problem. Issue was that I completely neglected the BOOT0 pin and it was floating. When bound to ground, flashing and erasing the chip works fine.