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

victor_pv Fri Jan 27, 2017 5:51 pm

BennehBoy wrote: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…

BennehBoy Fri Jan 27, 2017 6:18 pm

I tried both the bricked board and the working one, neither connects.

Just checked continuity and it’s good.

:(

I hope I’m just doing something stupid…

BennehBoy Fri Jan 27, 2017 6:25 pm

Checked the pins against a schematic and it’s deffo PA13 SWDIO (pin 22) & PA14 SWCLK (pin 21) so it’s not some bizarre pinout change by the manufacturer.

victor_pv Fri Jan 27, 2017 6:40 pm

Open up the stlink clone and check it out, perhaps the bad solder is there.
The swdio and swdclk pins in the MCU should match the schematics for the stlinks in the nucleo boards, which are widely available. Check continuity on those, gnd, etc.
And it’s possibly about time to order another one of those stlinks ;)

BennehBoy Fri Jan 27, 2017 7:05 pm

So there looks to be a solder bridge between the bottom two right hand pins of RP1 in this image… Guess would be it’s not supposed to be there?

Image

BennehBoy Fri Jan 27, 2017 7:20 pm

No change with it removed :(

BennehBoy Fri Jan 27, 2017 7:27 pm

Seller contacted, fingers crossed they put another (working!) one in the post.

infrared Mon Jan 30, 2017 9:12 pm

I’m not sure if this is related, but I recently experienced strange behavior from my st-link v2 interface. I have been using a cheap st-link v2 dongle to program/debug stm32f103c8 blue pill boards, and CubeMX to generate the chip configuration and app framework.

Last night, I upgraded my HAL libraries to STM32Cube_FW_F1_V1.4.0, migrated one of my projects via CubeMX, and Openocd programmed the target one time. Openocd managed to get the new firmware into the target, but immediately lost connection with the target. I was never able to establish connection with that target again.

Today, to see if my st-link dongle was dead, I attempted the same thing with a different target. I experienced exactly the same problem… Firmware was downloaded into the target one time, connection was immediately lost, and I am unable to re-establish connection.

ahull Mon Jan 30, 2017 9:28 pm

I managed to bork a couple of boards by compiling binaries for the wrong processor. This seems to lock things up quite nicely, however connecting the ST-Link v2 under reset has so far always managed to resurrect them.

RogerClark Mon Jan 30, 2017 10:30 pm

ahull wrote:I managed to bork a couple of boards by compiling binaries for the wrong processor. This seems to lock things up quite nicely, however connecting the ST-Link v2 under reset has so far always managed to resurrect them.

zmemw16 Tue Jan 31, 2017 12:54 am

as each has worked once? inpo ‘ attempting to say/save in no particular order – google fails’
bootloader, target start address, linker address’s ?
stephen

BennehBoy Thu Feb 02, 2017 8:06 pm

My replacement st-link is probably weeks away.

However today I received a CH340 based USB to Serial adapter

Presumably I can use this to program the board, but how do I get a bootloader .bin uploaded? What tool do I need?

From what I’ve rad I need

tx from the ch340 to rx1 on the mini
rx from the ch340 to tx1 on the mini
gnd to gnd
3.3v to vcc
boot1 tied to ground…

Then what? I’ve got the v2 bootloader bin from github but not sure how to get it onto the device!?!

RogerClark Thu Feb 02, 2017 8:25 pm

Yes

You can flash with USB to serial

You can even make your own STLink if you have a spare STM32F103 board (albeit the STLink binary is not officially released but is available from various websites (mainly russian ones))

Download ST’s

“Flash loader Demonstrator” PC gui program

(You can use the STM32Flash exe in the repo, but the Gui is easier)

BennehBoy Thu Feb 02, 2017 8:28 pm

I tried this:

http://jeelabs.org/book/1546c/

the ch340 shows up as ttyUSB0 in ubuntu

Issuing this command whilst holding down ‘button’

./stm32loader.py -p /dev/ttyUSB0 -ewv maple_mini_boot20.bin

results in this:

Traceback (most recent call last):
File "./stm32loader.py", line 434, in <module>
bootversion = cmd.cmdGet()
File "./stm32loader.py", line 118, in cmdGet
if self.cmdGeneric(0x00):
File "./stm32loader.py", line 115, in cmdGeneric
return self._wait_for_ask(hex(cmd))
File "./stm32loader.py", line 80, in _wait_for_ask
raise CmdException("Can't read port or timeout")
__main__.CmdException: Can't read port or timeout

RogerClark Thu Feb 02, 2017 8:30 pm

Sorry
I forgot you were using Ubuntu

BennehBoy Thu Feb 02, 2017 8:37 pm

I’ve got win10 too, will give that a go…

BennehBoy Thu Feb 02, 2017 8:42 pm

1x debricked maple mini YAY

Thanks Roger!

RogerClark Thu Feb 02, 2017 10:04 pm

Cool!

zmemw16 Thu Feb 02, 2017 10:43 pm

would or could you perhaps brick it again and then do the unbrick from linux to elucidate and enlighten us ? ;)

BennehBoy Thu Feb 02, 2017 10:46 pm

zmemw16 wrote:would or could you perhaps brick it again and then do the unbrick from linux to elucidate and enlighten us ? ;)

Sign in to reply