Help with st-link

User avatar
RogerClark
Posts: 6375
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Help with st-link

Post by 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.
Pulling Boot0 high normally works as well, as this prevents the code running but still seems to allow the SWD connection to operate

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

Re: Help with st-link

Post by 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

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

Re: Help with st-link

Post by 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!?!
-------------------------------------
https://github.com/BennehBoy

User avatar
RogerClark
Posts: 6375
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Help with st-link

Post by 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)
Last edited by RogerClark on Thu Feb 02, 2017 8:29 pm, edited 1 time in total.

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

Re: Help with st-link

Post by 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:

Code: Select all

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
I've tried swapping rx and tx to no avail.
-------------------------------------
https://github.com/BennehBoy

User avatar
RogerClark
Posts: 6375
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Help with st-link

Post by RogerClark » Thu Feb 02, 2017 8:30 pm

Sorry
I forgot you were using Ubuntu

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

Re: Help with st-link

Post by BennehBoy » Thu Feb 02, 2017 8:37 pm

I've got win10 too, will give that a go...
-------------------------------------
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 » Thu Feb 02, 2017 8:42 pm

1x debricked maple mini YAY

Thanks Roger!
-------------------------------------
https://github.com/BennehBoy

User avatar
RogerClark
Posts: 6375
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Help with st-link

Post by RogerClark » Thu Feb 02, 2017 10:04 pm

Cool!

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

Re: Help with st-link

Post by 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 ? ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests