stlink clone support #62
Comments
Hi Rene Without knowing exactly what is in the clone it's hard to say. The Cheers, On Fri, Jan 9, 2015 at 11:59 PM, Rene Hopf notifications@github.com wrote:
Black Sphere Technologies Ltd. Web: www.blacksphere.co.nz |
I actually ordered two of those and they arrived today. They contain a STM32F101CBT6 (128 kB flash, not too bad), and as gsmcmullin said, have officially no USB support. TL;DR It might actually be fully compatible. |
I can now confirm that the stlink version of blackmagic works out of the box on this device (tested against 1b2cd54, i.e latest). I flashed it using openocd and another stlink through the test pads. |
wow. |
It seems to work all the way, I connected to another stm32f101 and it behaved as expected. I did a quick compare of your schematic against this one http://www.micromouseonline.com/wp/wp-content/uploads/2014/01/mini-st-link-v2.png and things line up :). |
Hi! Would you please help me? I have this chinese stlinkv2 but it does not work w/ openocd. It fails when I try to flash. |
I have the same st-link clone (same date on pcb) and was able to flash it with modified code. |
Hey, first of all I am damn new to STM32 and BMP so please be forgiving if I ask obvious questions. So I managed it to flash a CH ST-Link v2 clone, like above, with the latest (
As you see, the prob's UARTs were mapped to
File to flash exists and is reachable. To me it seems to relate to denis-fr's comment but I might be wrong and I'm missed something... |
hexprog.py is not a gdb command. It is supposed to be used on the command line. |
Hi @milkpirate. It looks like everything is working fine. The To load a hex file from gdb, do:
To load a binary file from gdb, do:
|
Hey, @esden: Yes I know, but
So the next step was to add an
The suggested
|
@themadinventor did You find where uart debug is workin? Or not working at all? |
look's like pin 12/13 (PA2/PA3) are UART pins and need to be connected to additional header. |
Are you sure you can use PA2 / PA3 The Stlink dongle I have, is basically like this schematic http://www.avrki.ru/picture/articles/samodelniy_st_link_v2/shemf_st_link_v2.jpg So PA2 and PA3 are not connected I think to be able to use a UART on these dongles you'll need to remap UART1 onto its alternate pins of PB6 and PB7 and use the pins that are labelled as SWIM and SWIM_RST. You also need to make sure that PB5, and PB9 and PB10 are all floating, as PB7,9 and 10 are linked and PB5 and 6 are linked. But other pins default to floating input so should be OK as long as they are not explicitly configured as either a UART or GPIO output. PS. When I get time, I was going to revisit this, as I had some old code BMP code that runs on these, but I'd need to dig it out and see what I need to do in order to make it work with the revised code architecture. PS. I found basically the same circuit elsewhere as well. So I suspect most dongles are the same. http://we.easyelectronics.ru/uploads/images/00/31/28/2013/05/11/3012f7.jpg The only difference being the pin order on connector on the end of the dongle |
Just a heads up as I wanted to look at black magic probe as an alternative to the stlink clone I have for various reasons. I built a firmware using the patches available in the forums, but the usart RX wasn't working for some types of serial adapters. The reason for this was that on my clone, there isn't a 680R in series with 22R, its actually a 680 pullup to 3v rail. There is however an additional ~220K resistor in series after the pullup. The reason RX wasn't working for me was that the USB USART adapter I had included a 1K inline resistor on the TX pin, which formed a nice voltage divider with the 680R pullup, resulting in a low of around 2V. I swapped out the 680R for a 20K on the board and logic low is now working fine. Hope this helps someone who can't work out why RX isn't working on a clone device, but TX works fine once patched. PS - Didn't check if I could remove it or not as wasn't sure if the PB7 pin has input pullup enabled or not. |
Which STLink dongle are you using? I have it partially working, including UART on a "Baite" branded STLink from AliExpress, but I was also interested in getting it to work on the same one as @rene-dev posted the internal photos of. However, If the schematic posted by @rene-dev is correct (which I think it probably is), then to make the UART work would require the use of 2 UARTS i.e However PB6 is the USART1_TX via ALT pin mapping I'm not sure if the F101C8 has USART3 BTW. As previously discussed, although the STM32F101 is not supposed to have USB, in reality it does have, probably because ST are selling F103's as F101's |
@rogerclarkmelbourne will check tonight - but I think it was one of the v1 clones with an stm32f101 on it. |
Thanks. I noticed that the resistors seem to stop serial loopback working, but I could send and receive to a separate USB Serial. So I suspect the problem is the resistor values e.g. the 680 ohms in series, though I think there is also a pullup which may not be helping either |
The problem I had (from memory) was a 680K pullup pulling low too high for
the usb usart dongle I was using - swapping to 20k did the trick and
allowed low to be low on RX.
Will dig out the details later - but mine has been working fine ever since
swapping it out and using usart for debugging all the time ...
…On 8 June 2017 at 10:14, Roger Clark ***@***.***> wrote:
@enly1 <https://github.com/enly1>
Thanks.
I noticed that the resistors seem to stop serial loopback working, but I
could send and receive to a separate USB Serial.
So I suspect the problem is the resistor values e.g. the 680 ohms in
series, though I think there is also a pullup which may not be helping
either
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFif6kuFQoU59NRFQDpj6u3vlJ4mGVyhks5sB59KgaJpZM4DQTpi>
.
|
I think your STLink dongle may be different from mine. AFIK the schematic in mine is something like this http://www.avrki.ru/picture/articles/samodelniy_st_link_v2/shemf_st_link_v2.jpg It seems to have 680 ohms in series with PB7 and another 680 ohms to 3.3V (via the PB7 to PB11 connection) So it looks like the SWIM pin would be pulled to 3.3V/2 = 1.65 and PB7 will have to drive against that all the time. |
PS - label on the aluminum cover shows st-link v2. |
Which build target ("platform") are you using with this dongle ? stlink or swlink (or something else) BTW. Mine also has STLink V2 written on it, so I'm sure its the same one. I presume you must have connected Serial TX and RX to Pins 1 and 3 (RST and SWIM) (possibly the other way around) In which case, isn't RST connected to either PB0 or PB6, depending on whether RST means NRST or SWIM_RST I presume RST must mean SWIM_RST otherwise its not going to work. I'm now also guessing that you must be using code based on the "swlink" version, as that version uses the UART on PB6 and PB7 Re: Changing R10 for 20k. Also. Why didn't you simply remove the pullup ? |
It was a while ago now, but I think it was stlink target during make.
Yes, RST = SWIM_RST.
I can't quite remember, but think I added the gpio config for alt pins on
USART1. Can't find the code now though to check.
…On 9 June 2017 at 02:01, Roger Clark ***@***.***> wrote:
Which build target ("platform") are you using with this dongle ?
stlink or swlink (or something else)
BTW. Mine also has STLink V2 written on it, so I'm sure its the same one.
I presume you must have connected Serial TX and RX to Pins 1 and 3 (RST
and SWIM) (possibly the other way around)
In which case, isn't RST connected to either PB0 or PB6, depending on
whether RST means NRST or SWIM_RST
and SWIM connected to PB7 ?
I presume RST must mean SWIM_RST otherwise its not going to work.
I'm now also guessing that you must be using code based on the "swlink"
version, as that version uses the UART on PB6 and PB7
Re: Changing R10 for 20k.
Can you post a link to the schematic, as I don't think I have one which
accurately reflects the resistor numbers
Also. Why didn't you simply remove the pullup ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFif6uNsk7TdPDww8rPu-F8ZjDpvaDMMks5sCH1EgaJpZM4DQTpi>
.
|
No worries |
@enly1 @rogerclarkmelbourne lucky me, I think I have one! :| Last evening, I was trying to flash BlackMagic onto a "Blue Pill" with the STM32F103C8, and pretty much comprehensively confirmed there's only 64KB For one,
Further, when I try to flash BlackMagic, (now 58,364 bytes), I get this error:
I am otherwise able to flash the smaller
launching the STM32 Flash loader demonstrator (UM0462) indicates at startup time that it found a 64K device: There's a comment here that:
So perhaps there's still hope? However I've been unable to find these "settings" for memory (?) And so ya - I also have a ST-Link that I will be trying, but the chip is so hard to read, I cannot tell if that's a "B" or an "8". *edit: spelling |
I guess you were using a version of blackmagic_dfu prior to commit b09a522: Before this change the bootloader always reported a total of 64k flash for the stlink target regardless of the actual chip, and dfu-util refuses to flash a firmware image that is larger than the reported flash size. The newer bootloader reads the chip's flash size register at runtime and if that reports 64k it passes on 128k instead, because even the STM32F103C8 chips that really have 128k claim to only have 64k in their flash size register. So your test was only for the reported flash size, not for the actual flash size and if your C8 really has 128k you should be able to use it if after upgrading to the latest bootloader. |
description of the string, from st: USBD_DFU_MEDIA Interface USBD_DFU_MEDIA Parameter Description: |
thank you @rma-x |
Could people with a "baite"board try https://github.com/UweBonnes/blackmagic/tree/baite If PC13/14 float and PB11 is pulled high, recognize as baite. |
I have some Baite STLink dongles, but don't have time to test until the weekend |
@UweBonnes: I've tried your baite branch and it works. First I flashed the stlink version, then merged your baite branch and flashed the new bin using the stm32.mem.py. In µC.net I reported you an error when using the python flash scripts, with the stlink version it works. The version output is: but there is another PR for the baite platform: #274 My conclusion: use the PR #274 for this hardware version. |
@rixnco have you been able to flash your boards? Very interested in converting my clone to BMP to use SWD/SWC + RX |
@orangefour. No I ended up using a bluepill board. |
This guide helped me (mac user) to install Black Magic Probe on an ST-Link V2. You will need two of those devices, one to program the other. https://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe I found the correct pins to use for my device here: |
@gojimmypi same here. Last page is not writeable and stuff. Looks like those "unique" 64k RAM ones (56 KB free after bootloader). What I can do about it?
Looks like a regular $2 blue pill board, got it from ebay. Upd: used ST-Link Demonstrator GUI via UART (force select 128K, select 8002000) and it worked. Instructions found here https://gojimmypi.blogspot.com/2017/07/BluePill-STM32F103-to-BlackMagic-Probe.html |
Have a look at (blackmagic)/scripts/stm32mem. It does not care about the DFU header but tries to write above 64 kByte even on a F103C8. But it compares the result and will show if there is no success. |
@UweBonnes https://github.com/UweBonnes/blackmagic/tree/baite works for me with a baite adapter. |
I am wondering if it works on these cheap stlink clones:
http://www.ebay.com/itm/ST-Link-V2-mini-Emulator-Downloader-Programming-Unit-Random-Color-STM8-STM32/251609973875
they have an stm32f101 inside.
Rene
The text was updated successfully, but these errors were encountered: