The thought of having HW debug capabilities on a development board was fascinating, but I found out pretty quickly that I wouldn’t be able to accomplish everything I’d hoped with the ST-Link debugger which is included on the stm32-discovery. I was searching for a cheap/open JTAG debugger when I stumbled across this thread on versaloon.com: http://www.versaloon.com/~bbs/viewtopic.php?f=2&t=17
Here’s how I accomplished converting the ST-Link of one stm32-discovery to Versaloon using the ST-Link of a second stm32-discovery to do the flashing. The details are all pulled from the above linked thread; I’m not taking credit for any of this! Many thanks to Bingo for the stm32-discovery patches and to Simon for the Versaloon project. Another excellent side-effect is that you gain the ability to flash and debug from linux!
NOTE: there will be no way to reverse back to st-link if you complete all of the following steps
1. Obtain the Versaloon binaries for the stm32-discovery. You can find binaries (search for the most recent) attached to the thread or better you can build the binary from source.
2. I’ll be calling the stm32-discovery we’re updating to Versaloon the “target.” You’ll need to solder two very thin wires to the target device. I used wire-wrap wire for this. This is the most difficult step; if you make it past here, you’ll be fine.
You’re going to solder to the left-hand side of the SB6 and SB10 bridges shown above, but you’ll want to be sure not to actually connect both sides of the bridge. If you use too much solder, this may occur, and then you’ll probably need some solder wick to clean it up. I found the easiest thing to do was to put just the tiniest bit of solder on the end of the wire, position the wire, and then attach to the pad.
As you can see, I attached a red wire to the SB6 pad and a yellow wire to the SB10 pad. Nothing special, but hopefully it will help you to distinguish the two in this post.
3. I installed a 3 pin male header to the end of the two wires I just connected to the bottom of the board; this will make it easy to connect it to the host ST-Link.
4. Next I used F/F jumper wires to connect 5V/GND and SWD pins from the primary board to the target. In the next couple of images, the target board is on top, the primary board is on bottom.
Above are 3 of the 4 connections on the primary board. The jumper wires are connected on the primary board to the bottom 3 pins of the header labeled “SWD”. The red and yellow jumper wires are connected to the red and yellow wires recently connected to the “target” board. The black/center wire can be connected to any GND on the “target” board. I’m using the one at the top right of the board.
The 4th connection is from a 5V pin on the primary board connected a 5V pin on the target. In this picture the connection was made to the top-side of the board, but you’ll probably find it easier to connect to the bottom side.
5. Remove the jumpers from CN3 on the primary board.
6. Connect USB from a Windows PC to the USB port on the primary stm32-discovery board.
7. Run the ST-Link software. Choose Target->Connect. Then Target->Option Bytes and change Read Out Protection to Disabled.
8. Download the binary (.bin) you obtained in step 1 using Target -> Program & Verify.
9. Fix jumpers at CN3 on the target. You’ll either need to make a “special” jumper out of a 4-pin female header or just jumper the center and run a wire between the outside posts.
10. Test newly programmed Versaloon with vsprog and openocd!
NOTE: If you wish to use your newly converted versaloon stm32-discovery to program/debug a remote SWD target (like we used the “primary” stm32-discovery above), the SWD pins are now reversed. This is explained in the versaloon forum linked above.
#1 by Geoffrey Brown on February 2, 2011 - 6:59 pm
Quote
Nice writeup — this worked well for me. Also, was able to get
a version of the maple bootloader working. I haven’t succeeded in
getting versaloon/openocd to work — which version of the code
are you using ? The versaloon forum thread is pretty confusing.
Perhaps it’s an issue with drivers on OS X. The best I got was a
versaloon device popping up in my network config.
#2 by tim on February 2, 2011 - 9:15 pm
Quote
I used the updated script in this post: http://www.versaloon.com/bbs/viewtopic.php?p=74#p74
I also had to chmod +s the resulting vsprog and openocd binaries to get the switch to libusb accomplished. I got a random error which I don’t quite remember right now, otherwise. Alternatively, and perhaps the better thing to do would just be to use sudo.
#3 by tim on February 2, 2011 - 9:17 pm
Quote
… sorry, the above is what I did for OpenOCD; I pulled the latest rev of vsprog from svn; at the time it was rev 691.
#4 by Geoffrey Brown on February 9, 2011 - 8:19 pm
Quote
Can’t say I’ve had much success. My programs appear to download properly through openocd, but they don’t run correctly and openocd gets confused
pretty quickly. I’ve run these same programs using the atollic gdb server
without problems. Not sure whether its the stm32vldiscovery versaloon
firmware or openocd that’s having problems. I did rebuild using the
latest vsprog and built openocd with the “updated script”.
#5 by tim on March 20, 2011 - 8:16 am
Quote
Geoffrey, How did you get past the issue above where the Versaloon was detected as a network device in OS X? I went out and bought an old macbook and have gotten to this exact point. Using sudo doesn’t seem to work like it did in linux.
I’m using libusb from macports and am under the impression that perhaps I need a “codeless .kext” to claim the Versaloon? .. my attempts at that have failed or I’m going down the wrong path. Not sure.
#6 by tim on March 20, 2011 - 7:34 pm
Quote
… nevermind: I finally gave up and googled “versaloon on a mac” and found Simon’s post on the topic. I don’t think it’s the most ideal solution, but it works.
#7 by zied on March 26, 2011 - 6:48 pm
Quote
yesterday I succeeded flashing the versaloon binary on the the st-link of st vl discovery, and bring it up, but I lost the original firmware. is it available somewhere for download?
#8 by Jose Xavier on March 27, 2011 - 6:49 am
Quote
Hi, i have a stm32 discovery kit and i want to start develop to it.
If you are using windows why don’t you use keil?!
I’m in linux and i have a lot of trouble to start :s
1)The versaloon is a JTAG, SWD, etc, programmer!?
2)Why you need two stlinks?! I read your text but didn’t understand.
3)To use the stm32 discovery kit in linux what you recommend!?
Sorry for my english and thanks
#9 by tim on March 28, 2011 - 10:38 pm
Quote
as far as I know, it is not available.
#10 by tim on March 28, 2011 - 10:47 pm
Quote
Your English is just fine! I am currently not using Windows for stm32; I started on Ubuntu 10.10 and most recently I’ve started using a Mac with OS X 10.6.
1) Yes, the Versaloon is that and more.
2) Because we’re going to use one to reprogram the other. There are two stm32′s on each stm32-discovery; one is the target chip, the other is the one that runs the ST-Link software. You’ll be replacing the ST-Link binary with a Versaloon binary, so it will no longer work with ST-Link software, but instead would work as a Versaloon under Windows, Linux or Mac.
3) After you reprogram the st-link chip on the stm32-discovery to Versaloon, you can use code sourcery g++, openocd, and gdb to build and debug for stm32.
#11 by kostik on July 8, 2011 - 12:25 pm
Quote
I have a new stm32l-discovery, I found out you have to use sb8 instead of sb6 and sb12 instead of sb10 in the beginning(check the schematics of both). I can make some Photos if the author contacts me.
#12 by pppd on September 18, 2011 - 6:12 pm
Quote
I can’t seem to get this working. I have soldered the cables correctly, checked connection from the solder-points to the PA13/14 pins on the uC and they are just fine, no bridges or anything… yet the ST-Link just says ‘No target connected’ :/
Of course the target board is powered from the master and the jumpers were removed from the CN3, both boards are fine as when I put the jumpers back onto CN3 ST-Link detects the target value line uC.
What am I missing? Any ideas?
#13 by Matthias Simon on November 10, 2011 - 7:17 am
Quote
Thank you very much for this howto. But I have still some questions. I don’t own two stm32vl boards but only one (and several stm8s’s), and I am wondering if it’s possible to flash a stm32vl board with the help of a stm8s board?
If so, how do it achieve that? I realized that these boards are using different protocols (SWD vs. SWIM), so I’ll have to improvise a little. Is it correct that sb6 and sb10 are the target’s SWDIO and SWCLK ports? Is there also a SWIM-Pin on the target, or is — better — is stm8s’s st-link somehow capable of SWD? I would be really glad if you could help me out a little.
Regards
#14 by Jake on January 21, 2012 - 9:53 pm
Quote
Nice writeup! Thanks!
I was wondering how this was all figured out? The Versaloon board seems to be down… I’d like to figure out a slightly easier connection method.
What would happen if you removed SB 3,5,7,9 and connected SB 4,6,8,10? It seems pretty obvious that those bridges should be on one side or the other. Maybe the other side is for programming the F103 through the SWD connector?
#15 by Jake on January 21, 2012 - 11:58 pm
Quote
So… I tried this twice and it didn’t work. The first time I tried removing SB 3,5,7,9 and connecting SB 4,6,8,10. But I think I tried connecting with SWD (CN2) instead of CN3. Anyways it didn’t work so I redid it as in your writeup. It didn’t work, and as I was fooling around with it the SB6 wire came off, with the pad, so I figured maybe I fried the trace. So I switched it around and tried using them in reverse. But again after not working the SB6 came off with the pad on the wire, so maybe I fried the trace AGAIN? Anyways, watch out for frying that trace. I’ll try everything again tomorrow with new boards. Both boards still work just fine, except for the SB6 connection being gone, so I didn’t loose anything except the possibility of flashing that F103. SB 10 hasn’t given me any problems so tomorrow I’ll try soldering SB10 and just holding the wire to SB6.
I really want the F103 to run iNemo and access a gyro/accel module and share with the F100 and do USB communication with a PC. That’s down the road though. First I need to get the F103 communicating through USB, then communicating with the F100, then doing I2C with the gyro. I’ll post how it goes.
-Jake
#16 by tim on January 22, 2012 - 9:32 pm
Quote
Hi Jake,
Take a look at page 22 of this document from ST http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/CD00267113.pdf
It has the schematics to show how switching the SBs around does make it possible to program the F103 through CN3. I think you figured that out, though. If you’re brave, you can try to get a line on pin 37 of the F103 to get access to the JTCK you lost when the SB6 pad lifted.
Good luck.
-Tim
#17 by tim on January 22, 2012 - 9:38 pm
Quote
Also … I just updated the link to the versaloon post. It looks like the versaloon site has moved to a forum on yahoo, and the location of the old forums changed. Hopefully it will remain available at this new location.
Pingback: Converting a STM32VLDISCOVER on versalon programmer « Jonny Zone : hrkki eitkf
Trackback: cuit vapeur
Trackback: Brock
Trackback: personal loans low interest rate
Trackback: Angela
Trackback: Angrybirdsjournal.com
Trackback: BBW Hookup
Trackback: Gold Earrings
Trackback: Russell
Trackback: Monika
Trackback: Dalene
Trackback: National Payday Loan
Trackback: Www.Amigofever.Com
Trackback: click through the next webpage
Trackback: lms.Auaf.edu.af
Trackback: Read the Full Content
Trackback: wiki.utp.edu.co
Trackback: http://moodle.bakalka.cz/user/Profile.php?id=7363
Trackback: televizor
Trackback: simply click the following article
Trackback: get real money Online
Trackback: http://4youpaydayloans24h.co.uk/
Trackback: get a part time job online
Trackback: Berniece
Trackback: good ways To Make Extra Money
Trackback: online slots For cash
Trackback: Blanca
Trackback: how to Find jobs
Trackback: click through the following web page
Trackback: Commercial Property
Trackback: Dominique
Trackback: visit the following internet site
Trackback: online jobs easy