Spark Logic

Help with st-link

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:

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

Replies

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…

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

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.

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.

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 )

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 :).

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.

BennehBoy Fri Jan 27, 2017 2:23 pm

Thanks, gave that a try but neither board responds.


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'

BennehBoy Fri Jan 27, 2017 2:24 pm

The other possibility of course is that the st-link v2 clone is faulty.

stevestrong Fri Jan 27, 2017 2:38 pm

Can you connect the STlink to the target with the STlink utility?

BennehBoy Fri Jan 27, 2017 2:52 pm

stevestrong wrote:Can you connect the STlink to the target with the STlink utility?

victor_pv Fri Jan 27, 2017 3:02 pm

BennehBoy wrote:stevestrong wrote:Can you connect the STlink to the target with the STlink utility?

BennehBoy Fri Jan 27, 2017 4:40 pm

Are you sure I should power the target with USB AND 3.3 from the st-link? I thought this would result in magic smoke?

BennehBoy Fri Jan 27, 2017 4:49 pm

Tried with the settings you supplied (used these earlier too), failed. Tried resetting the board, still fails.

For fear of destroying the board I _did not_ also connect it via USB whilst 3.3 was being supplied to the VCC pin.

Here’s a photo of the wiring:
Image

victor_pv Fri Jan 27, 2017 4:50 pm

BennehBoy wrote:Are you sure I should power the target with USB AND 3.3 from the st-link? I thought this would result in magic smoke?

BennehBoy Fri Jan 27, 2017 4:56 pm

It’s steadfastly refusing to connect. :?

I think this st-link clone hardware must be garbage. I can feel a stamping frenzy coming on. :evil:

I continuity checked the dupont leads just for peace of mind, all are good.

racemaniac Fri Jan 27, 2017 5:02 pm

BennehBoy wrote:It’s steadfastly refusing to connect. :?

I think this st-link clone hardware must be garbage. I can feel a stamping frenzy coming on. :evil:

I continuity checked the dupont leads just for peace of mind, all are good.

BennehBoy Fri Jan 27, 2017 5:12 pm

racemaniac wrote:
And it’s a good advice that Roger likes to repeat on this forum: always have 2 of whatever you’re working on. it’s cheap chinese stuff, something will be broken or break, and if you then have to wait a month for the replacement to arrive…

Sign in to reply