Help with st-link

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 11:25 am

I managed to brick one of my maple mini clones when attempting to use victors firmware updater sketch.

I bought an st-link2 clone which arrived today.

I've connected ground to ground on the mini, reset to reset on the min, SWCLK to pin 21, and SWDIO to pin 22

I then powered the Mini only by USB (so not 3.3v connection from the st-link2 clone)

The st-link utility reports the following:

Code: Select all

11:23:49 : Can not connect to target!
                  Please select "Connect Under Reset" mode from Target->Settings menu and try again.
                  If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.
11:23:50 : No target connected
Have I killed the board? (no leds flash nor does my pc detect it via USB - it was this way prior to attempting to use st-link)

I cannot find an option labelled 'Connect Under Reset' in the Target->Settings menu.

I don't want to try my other working mini in fear I might kill it.

This is the reference info I used for the pins:
Image
-------------------------------------
https://github.com/BennehBoy

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 11:41 am

So I didn't look hard enough for the 'Connect Under Reset' option, found it but still had no luck...

Code: Select all

11:40:51 : Can not connect to target!
                  If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.
                  If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.
11:40:53 : No target connected
-------------------------------------
https://github.com/BennehBoy

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 11:43 am

PS, unfortunately the st-link clone only came with 4 dupont leads so I can't power the board from it just yet - hence why USB power.
-------------------------------------
https://github.com/BennehBoy

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 12:03 pm

Found this russian posts which says reset isn't needed. http://nuzhen-sovet.ru/content/podklyuc ... k-v2-kitay

Removed reset, and powered the board from the st-link, still no leds light on the board and cant connect.

Tried my working board, the leds flash, but still can't connect.

I'm clearly doing something wrong. I've tried a few different frequencies too - default was 4mhz.
-------------------------------------
https://github.com/BennehBoy

racemaniac
Posts: 423
Joined: Sat Nov 07, 2015 9:09 am

Re: Help with st-link

Post by racemaniac » Fri Jan 27, 2017 12:10 pm

btw, just a tip if you like working with electronics: at least make sure you've got the basic stuff like the wires :).
i've got tons of dupont wires (male-male, female-female & female-male) just for the reason you just mentioned: it's so stupid to not have them when you need them. especially when it costs next to nothing :).

And the last time i had issues with flashing, flashing under reset did work, but i don't know what exactly i had to do to get it to work. i also fiddled with it until it worked :). (but i did have 5 cables :p )

zmemw16
Posts: 1290
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Help with st-link

Post by zmemw16 » Fri Jan 27, 2017 12:13 pm

i've added a reference to this thread to http://www.stm32duino.com/viewtopic.php?f=10&t=1740
hopefully something on how to unbrick will emerge :)
stephen

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 12:27 pm

racemaniac wrote:btw, just a tip if you like working with electronics: at least make sure you've got the basic stuff like the wires :).
:lol: :lol:

TBH I'm only recently 'back in the fold' after a 25 year break!

A lot of my Uni course was hardware, specifically PICS, z80 boards, comms etc. Since then I veered off down the sysadmin route so didn't touch electronics or low level code (just high level scripting).

I'm trying to build up my array of kit - if it grows to anywhere near the size of my car tool collection then I need to worry.
-------------------------------------
https://github.com/BennehBoy

User avatar
ahull
Posts: 1544
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Help with st-link

Post by ahull » Fri Jan 27, 2017 1:43 pm

Unbricking from Linux...

https://github.com/rogerclarkmelbourne/ ... from-Linux

... for what its worth, when I wrote that, I only used 3 "du-pont" wires... It shows how to connect to a Bluepill and the "Uggly board" but it should work with pretty much any stm32fXXX board, so the mm will work too. The version of Linux is not important. So long as the version of openocd is fairly recent you should be fine.

Connecting under reset with openocd will unbrick pretty much any screwup that doesn't actually result in smoke. :D

Pinout for stm32f103 is

Programmer -> Target

Ground (Green) -> GND

SWDIO (Blue) -> PA13

SWCLK (Yellow) -> PA14


(Colour of wire is up to you of course ;) )

If still dead, unplug the maple mini USB and connect the 3v3 pin from the programmer to 3v3 on the mm and try again.
- Andy Hull -

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 2:23 pm

Thanks, gave that a try but neither board responds.

Code: Select all


Open On-Chip Debugger 0.10.0+dev-00001-g0ecee83 (2017-01-27-13:59)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.233618
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'
Not sure if this is a tool error or I'm being retarded - either way it tallies with the results from the windows st-link util.

Is there anything which could cause SWD to not be enabled? I've checked the pcb traces and they are good.
-------------------------------------
https://github.com/BennehBoy

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Help with st-link

Post by BennehBoy » Fri Jan 27, 2017 2:24 pm

The other possibility of course is that the st-link v2 clone is faulty.
-------------------------------------
https://github.com/BennehBoy

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests