making blackmagic probe from stm32 chip board

kalregus
Wed Jan 18, 2017 9:49 pm
Hi guys.

I am trying to program NRF51822, and here, on this forum i’ve found recipe to make black magic probe out of stlink board (http://www.stm32duino.com/viewtopic.php?t=122). Because that thread is closed, i decided to make a new one. Unfortunatelly i can not find some answers in that closed thread.

First thing – i bought boards like this:
https://drive.google.com/file/d/0B02vrP … sTlJz/view

You can see there (from bottom) – uart converter (1), sth like maple mini stlink board (2), board with wires – also stlink, but different vendor (probably stmicroelectronics board or its clone – 3), also nrf51822 chip (4) and nrf51 DK motherboard by waveshare (5).

I found some tutorials on YT how to compile bin, but since i am windows user i cant (or dont know how to prepare those bin).

First of all i connected board 2 to windows – it hasnt been found (device manager says “Unknown device”). Even installing STlink v2 drivers didnt helped it
Next i connected board 3 – windows found it easily. After starting Stlink Utility i could connect to that board, and update firmware. Also, after connecting board 2 to board 3 via swd i could connect it.

I started to search bin of black magic probe which wasnt attached to
http://www.stm32duino.com/viewtopic.php?t=122

Fortunately i found them here:
http://builds.blacksphere.co.nz/blackmagic/

downloaded stlink file and programmed it to board 3 with board 2, after erasing whole chip.
I see that everything is flashed correctly (from address 0x08000000 memory looks like downladed bin), but still flashed chip (2) isnt recognized by system – it is still Unknown device even if i downladed BMP drivers from https://web.archive.org/web/20160331030 … blackmagic

I hope all those links will help someone which would encounter same problems as i did.
And now comes time for question:

What am i doing wrong? Is the bin file wrong? Or maybe my stlink board i am trying to flash is damaged? I also consider that i have some vendor-driver recognition problems. Or maybe there is something else? Please advice.

Kalreg.

Also useful links are:
https://github.com/blacksphere/blackmagic
https://www.deltanova.co.uk/electronics/arm/blackmagic/
https://github.com/RickKimball/blackmag … _coreboard


Rick Kimball
Wed Jan 18, 2017 10:22 pm
on your bluepill board, have you checked the R10 pullup resistor to see if it is 1k5 ?

kalregus
Wed Jan 18, 2017 10:46 pm
For sure i didnt had any resistor. Where should it be connected? While flashing board or while normal work? To which pins should it be connected?
Forgive my lack of english but is pull up resistor normal resistor?

kalregus
Wed Jan 18, 2017 10:48 pm
And to be completely sure – blue pill is the board that is flashing the other one, not the one that is flashed?

Rick Kimball
Wed Jan 18, 2017 11:31 pm
R10 is the resistor marking on “most” bluepills. Unfortunately, there is no such thing as a “typical” bluepill. Each one is different. The R10 resistor is the pull up on the USB +DM pin on the bluepill I personally have and one one that is often talked about. However you didn’t link a schematic for which specific bluepil you have so I can only guess which one you have. Often, and possibly not relevant here as I’ve heard recent bluepill purchases are providing a 1k5 resistor, the pull up resistor on the USB D+ pin is wrong.

On my bluepill I have they were 10K instead of 1k5 and didn’t allow my computer to enumerate them. This is not something you should normally have to mess with. The problem is that many bluepill manufacturers don’t give a shit and just put whatever resistors they have lying around. Problematic is that some computers will put up with this abuse of a 10k resistor and work properly anyways. So get out your multimeter and check the resistance of the USB D+ pin. If you look at the wiki and posts here you will see this is a common problem people with a blue pill have to deal with.

The bottom line, if you have a computer that expects a USB standard 1k5 pull up resistor then it will never enumerate properly which will prevent you from using it as a CDC device.

As you already have purchased a stlink device, instead of trying to flog yourself using a BMP, you might do a google search and see how to use openocd and and stlink-v2 device to debug and flash an nrf51822 device.

-rick


RogerClark
Thu Jan 19, 2017 12:22 am
kalregus wrote:
downloaded stlink file and programmed it to board 3 with board 2, after erasing whole chip.
I see that everything is flashed correctly (from address 0x08000000 memory looks like downladed bin), but still flashed chip (2) isnt recognized by system – it is still Unknown device even if i downladed BMP drivers from https://web.archive.org/web/20160331030 … blackmagic

I hope all those links will help someone which would encounter same problems as i did.
And now comes time for question:

What am i doing wrong? Is the bin file wrong? Or maybe my stlink board i am trying to flash is damaged? I also consider that i have some vendor-driver recognition problems. Or maybe there is something else? Please advice.


kalregus
Thu Jan 19, 2017 12:53 am
Rick:
Here are photos of my pills:

First one (the one i am programming the other one)
https://world.taobao.com/item/221027354 … 2.4.pgcaNO

The second one (the one is being programmed)
https://world.taobao.com/item/220978030 … 4.8.pgcaNO

I also found R10 marking on the second board – it has 103 digits on resistor, but it is so tiny that i find it impossible to change for other.
Picture of my second board – here:
http://dl.sniper.pl/pill.jpg

So i guess the idea of stlink programming stlink to become bmp and to flash nrf is impossible for me.

A propos the idea of flashing NRF51288 with STLink directly – i’d love to but whatever i try i can not do it. I tried:
– flash it via NRF51 DK through jlink – jlink find no emulators
– flash it directly via STLink and visual studio – i can upload simple program to nrf like blinking led, but any more complex program like advertising ble doesnt work. I’ve been told that it is because lack of softdevice on nrf. I checked option to make softdevice separately – then i can upload simple programs, otherwise visual studio doesnt send program to nrf chip.
– flash stlink pill to become bmp – as you know – without any success.

Roger:
Is there a way to download core / DFU binary? I mean full code to make stlink pill full bmp?
Can i make my own bin from source on windows?

All the tutorials i’ve watched, movies on YT and so on need devices i do not have (segger jlink, bmp), are made on linux (i have windows) or just dont work because some port of them is for author so obvious he doesnt mention about it.
All the links in google i search to find any other solution is now marked as “visited”, and i am running out of options. It doesnt matter how, via jlink, stlink, visual studio or notepad – i just want to flash softdevice, and my program to nrf. How to achieve this having windows, stlink pill, nrf51822 and nrf51 DK from waveshare?

K.


kalregus
Thu Jan 19, 2017 1:52 am
All right guys! I guess i have some progress with open OCD. I guess one thing is wrong and i hope you will point it out.

In command line i entered such a command:

openocd -f ..//share/openocd/scripts/interface/stlink-v2.cfg -c "transport select hla_swd; set WORKAREASIZE 0x4000;" -f ../share/openocd/scripts/target/nrf51.cfg -c "init ; reset halt ; nrf51 mass_erase ; sleep 500 ; flash write_image ../../s130_nrf51_2.0.1_softdevice.hex 0x0 ; verify_image ../../s130_nrf51_2.0.1_softdevice.hex 0x0 0x0 ; mww 0x4001e504 1 ; mww 0x10001000 0x001000 ; mww 0x4001e504 0 ; shutdown"


Rick Kimball
Thu Jan 19, 2017 2:29 am
these are nordic nrf51822 questions better answered on some site devoted to nordic chips

umejopa
Thu Jan 19, 2017 7:19 am
Any one that have a workong xxx.bin for a STM32C103C8T6 on a blue-pill ?

//Jonas


parasole
Thu May 18, 2017 3:29 pm
I could not point out to the exact message, I just remember that I found the way to program my blupill in the main topic which is 27 pages long…

Leave a Reply

Your email address will not be published. Required fields are marked *