ST-link clone by baite

nobodyman
Posts: 5
Joined: Thu Nov 24, 2016 9:15 pm

Re: ST-link clone by baite

Post by nobodyman » Fri Nov 25, 2016 11:16 pm

I saw the list of pins but I didn´t know that pins PA9/PA10 or PB6/PB7 are possible to be used for flashing!
I used the explanation from this site: http://embdev.net/articles/STM_Discover ... agic_Probe to compile the source files.
After spending a lot of time to apply the patches from post "by denis » Tue Sep 27, 2016 11:42 pm" I flashed the BAITE ST-Link but it´s not working :(
Windows shows an unknown device. Hardware details are showing errors like DEVICE_DESCRIPTOR_FAILURE.
I used STMFlashLoader Demo.exe to flash the two bin files, first the blackmagic_dfu.bin to address 0x8000000 and then blackmagic.bin to address 0x8002000. Do you have any idea what´s wrong?

Edit: My file blackmagic.bin is about 70KB but the flash size is only 64KB :oops:
Why is the bin file size too big?
Last edited by nobodyman on Fri Nov 25, 2016 11:53 pm, edited 1 time in total.

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

Re: ST-link clone by baite

Post by RogerClark » Fri Nov 25, 2016 11:28 pm

nobodyman wrote:Do you have any idea what´s wrong?
You only flash the bin not the dfu

I'd also consider getting a clean copy from the blacksphere repo as they have an STLink build and give that a try

The stuff that @denis did is based on an older version of the BMP

When I get time I was going to try the latest version on the Baite STLink , as the Baite STLink is just going to be pre-loaded with the binary of STLink that someone reverse engineered from a ST Discovery board, so I would have thought that the Blacksphere repo version would work with it

nobodyman
Posts: 5
Joined: Thu Nov 24, 2016 9:15 pm

Re: ST-link clone by baite

Post by nobodyman » Sat Nov 26, 2016 12:11 am

RogerClark wrote:You only flash the bin not the dfu
I flashed two different bin files! I think blackmagic_dfu.bin is the bootloader.

Do you know how to use the make commands in correct order?
First I called

Code: Select all

make
in the blackmagic root directory and then in the src directory

Code: Select all

make clean
and

Code: Select all

make PROBE_HOST=stlink
But do I have to call

Code: Select all

make
in the blackmagic root directory again or not?

Edit:
I compiled once more and didn´t call make in the root directory again. Now my blackmagic.bin is 54KB :D
After flashing I have two serial devices and one called "Black Magic Firmware Upgrade (STLINK)" but I´m not able to assign a driver.

Edit2:
ZADIG is the tool which is needed! Now all my devices appear in the windows system managent :D
I hope a final test will be successful!

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

Re: ST-link clone by baite

Post by RogerClark » Sat Nov 26, 2016 6:12 am

There are windows driver on blacksphere's github repo.

nobodyman
Posts: 5
Joined: Thu Nov 24, 2016 9:15 pm

Re: ST-link clone by baite

Post by nobodyman » Sun Nov 27, 2016 12:25 am

The hardware is available in the hardware manager but it´s not working as expected.
After starting gdb and connecting to COM port

Code: Select all

monitor version
returns "Black Magic Probe (STLINK), (Firmware v1.6-rc0-249-gb745799-dirty)".
But when I use

Code: Select all

monitor swdp_scan
to connect to STM32 target gdb freezes.
I´m using a blue pill STM32 board which is not flashed before (it already contains a blinking LED example) and it´s connected with SWCLK, SWDIO and power.
Is something missing? What´s about the BOOT-Jumpers? Do I have to change them from default position to connect to the target?
Or may I have to check out an earlier version of the projekt? You mentioned release 45e322b before. How do I get this from git?

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

Re: ST-link clone by baite

Post by RogerClark » Sun Nov 27, 2016 1:04 am

If you are using the stock BlackMagic probe firmware you should post an issue to the official repo.

My repo only works for nRF51

nobodyman
Posts: 5
Joined: Thu Nov 24, 2016 9:15 pm

Re: ST-link clone by baite

Post by nobodyman » Sun Nov 27, 2016 1:14 am

Ok, I will do that.
But please take a look at my questions at the bottom of my last post regarding BOOT jumper and how to get the version you used from git.
Thanks a lot!

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

Re: ST-link clone by baite

Post by RogerClark » Sun Nov 27, 2016 1:20 am

If SWD is connecting at all e.g. if you can scan and find a device, then SWD is running and you don't need to change boot0

If code is running which disables the SWD pins, then if you set boot0 and reset, the code will not be running and hence you can access the SWD pins

Its possible that your BluePill is read protected but it may be possible to do a full chip erase (the command is erase_mass I think or mass-erase)

I know that deprotects it on the nRF51 but it would may be different on the STM32 code in the BMP

denis
Posts: 17
Joined: Wed May 11, 2016 8:38 pm

Re: ST-link clone by baite

Post by denis » Thu Dec 08, 2016 7:30 pm

RogerClark wrote:The pins inside the stlink, on the back of the board were listed by @denis in his first post i.e.
gnd,5V,boot0,TX,RX
@denis reflashed using usb to serial on the TX and RX pins by pulling boot0 high during power.
Note don't use the 5V to pull boot0 high, use the 3.3V output from your usb to serial converter
For flashing, I use this USB to TTL: http://www.hotmcu.com/cp2102-module-usb ... -p-35.html
It have both 5V and 3.3V output. 5V is for 5V, 3.3V is perfect for boot0.

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

Re: ST-link clone by baite

Post by RogerClark » Thu Dec 08, 2016 8:14 pm

I do the same as @denis

The 3.3v output from the USB to serial is ideal for pulling boot0 hight, but you need to remember to plug the baite stlink in, after the usb to serial is already plugged in and producing 3.3v for boot0 on the baite stlink

Post Reply