Help with st-link v2

CrtSuznik
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Help with st-link v2

Post by CrtSuznik » Sun Apr 23, 2017 6:46 pm

Hey guys. I'm a total beginner and I could really use your help with this.

I just got a blue pill. And along with it I bought a St-link V2 to program it. After a long search I've figured out how to hook things up:
(3.3v)---(3.3v)

(T_SWCLK)--(DCLK)

(T_SWDIO)--(DIO)

(GND)----(GND)

Please correct me if I'm wrong here.

Now my problem is...i want to upload a sketch with the Arduino IDE (still using 1.6.9). A simple Serial.println("something"); would do...just to test it.
However when I plug in the ST-link (and the board connected to it), the port doesn't seem to be recognised.

I've downloaded the drivers (i hope they're the correct ones), so when I plug in the st-link my pc does recognize it.

I have no idea if I should select something differently in the settings or what ever else I'm doing wrong.

Btw, the bluepill does work, since i've uploaded sketches onto it through the TTL usb thingy before, but now I wanna use the ST-link.

Please heeeelp

stevestrong
Posts: 1505
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Help with st-link v2

Post by stevestrong » Sun Apr 23, 2017 6:48 pm

Have you selected the correct upload method from Arduino IDE Tools menu?
You don't need any port for STLink.

CrtSuznik
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Re: Help with st-link v2

Post by CrtSuznik » Sun Apr 23, 2017 6:53 pm

I select the board (Generic STM32F103C Series)
and the Upload method: STlink

Everything else I just left as is.

What should I select as the programmer? Also if I manage to upload a sketch, how can I see the output aka if I want it to print something onto the screen, how will i see it?

stevestrong
Posts: 1505
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Help with st-link v2

Post by stevestrong » Sun Apr 23, 2017 6:58 pm

How does the PC recognize the Stlink probe? What shows the device manager? Windows or Linux?
Can you post the Arduino message?

CrtSuznik
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Re: Help with st-link v2

Post by CrtSuznik » Sun Apr 23, 2017 7:03 pm

I'm using windows 7.
Device manager says it's "STMicroelectronics STLink dongle"

If I try to upload a program, it seems to upload it properly, even without a port selected, however I have no idea if it's actually on the board, since I want it to print to screen, but I can't see the message, since no port is selected.

If I try to open the Serial monitor in Arduino IDE, it says Board at COM3 is not available.

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

Re: Help with st-link v2

Post by zmemw16 » Sun Apr 23, 2017 7:46 pm

The regulator on the st link is NOT meant to supply the requirements of a Blue Pill, particularly if additional spi/i2c devices are added.

use the usb connection to supply the main power and only connect SWCLK/SWDIO and GND lines.
if you add displays etc, they in turn should have their own supplies. Only the GND is common.
stephen

CrtSuznik
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Re: Help with st-link v2

Post by CrtSuznik » Sun Apr 23, 2017 8:02 pm

Ok, I'm now powering it off of the usb port...and have only the 3 pins connected to the st-link. Still...no port

Also I've tried a blink sketch. I set PC13 as output and then do a digitalWrite, but the LED does nothing :S

stevestrong
Posts: 1505
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Help with st-link v2

Post by stevestrong » Sun Apr 23, 2017 8:26 pm

It is normal that you dont have any COM port, Serial usb must be enabled with the extra flag -DSERIAL_USB in boards.txt, if you use other upload method then USB DFU.
However, LED should blink, when set to 0.
Is BOOT0 jumper on "0"?
Last edited by stevestrong on Sun Apr 23, 2017 8:28 pm, edited 1 time in total.

CrtSuznik
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Re: Help with st-link v2

Post by CrtSuznik » Sun Apr 23, 2017 8:28 pm

stevestrong wrote:It is normal that you dont have any COM port, Serial usb must be enabled with the extra flag -DSERIAL_USB in boards.txt, if you use other upload method then USB DFU.
Is BOOT0 jumper on "0"?
So that means I should just copy and paste the -DSERIAL_USB in boards.txt?
I've tried the BOOT0 jumper on 0 and 1 posotion, nothing makes a difference

User avatar
Rick Kimball
Posts: 989
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Help with st-link v2

Post by Rick Kimball » Sun Apr 23, 2017 8:28 pm

CrtSuznik wrote:Ok, I'm now powering it off of the usb port...and have only the 3 pins connected to the st-link. Still...no port

Also I've tried a blink sketch. I set PC13 as output and then do a digitalWrite, but the LED does nothing :S
Are you talking about the bluepill serial port, or a serial port on the stlink/v2?

Are you using an stlink/v2 clone?
-rick

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest