Help with st-link v2

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
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
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
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
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
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
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
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”?

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”?

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


stevestrong
Sun Apr 23, 2017 8:30 pm
Well, it makes a difference.
BOOT0 must be set to 0.
And yes, you have to add the flag.
Restart IDE afterwards.

CrtSuznik
Sun Apr 23, 2017 8:33 pm
i’ve connected it like this:

USB=>st-link=>stm32

I’ve also tried powering the stm32 from a powerbank over the usb port and unhooked the 3.3 power coming off of the st-link

I bought the stlink on aliexpress, so I’m guessing it’s a clone

Add the flag…could you please tell me what exactly I need to type and where? (arduino/hardware…then boards in arduino or continue to the stm foulder and change the boards there?)


Rick Kimball
Sun Apr 23, 2017 8:34 pm
CrtSuznik wrote: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”?

Rick Kimball
Sun Apr 23, 2017 8:36 pm
You should focus on getting blink to work. If blink isn’t working then you are doing something wrong. Trying to make the usb stuff work before getting blink is a waste of time.

CrtSuznik
Sun Apr 23, 2017 8:39 pm
Rick Kimball wrote:CrtSuznik wrote: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”?

stevestrong
Sun Apr 23, 2017 8:47 pm
Thats the blue pill.
Set boot0 to 0.
As Rick said, concentrate on led blink.
Is the power led on?
Post here the build and upload messages from IDE.

CrtSuznik
Sun Apr 23, 2017 8:54 pm
stevestrong wrote:Thats the blue pill.
Set boot0 to 0.
As Rick said, concentrate on led blink.
Is the power led on?
Post here the build and upload messages from IDE.

stevestrong
Sun Apr 23, 2017 8:57 pm
I would like to see the clear text of the uploading message with the stlink dongle. It may be defective.

CrtSuznik
Sun Apr 23, 2017 8:58 pm
Trying to upload this:

void setup() {
pinMode(PC13, OUTPUT);
}

void loop() {
digitalWrite(PC13, HIGH);
delay(1000);
digitalWrite(PC13, LOW);
delay(1000);
}

Btw what should I select as the programmer? I have it set to AVRISP mkII


stevestrong
Sun Apr 23, 2017 9:03 pm
Sorry, without the upload message from the Ide i cannot help further.
Programmer shouldnt make any difference.

CrtSuznik
Sun Apr 23, 2017 9:05 pm
stevestrong wrote:Sorry, without the upload message from the Ide i cannot help further.

stevestrong
Sun Apr 23, 2017 9:08 pm
Good luck.

CrtSuznik
Sun Apr 23, 2017 9:10 pm
Also I have downloaded https://github.com/rogerclarkmelbourne/Arduino_STM32
unzipped it and pasted it into my arduino hardware folder. I haven’t changed any flahs…or should I have?
Do I need to comment or undomment something somehwere?

paksoft
Sat Aug 12, 2017 7:11 am
Both jumpers are set to 0. The power light is on.

Try again after this setting.
Both jumpers should not be 0, The one near reset button set to 0 and the other one set to 1.

STM32F103 with ST-LINK Jumpers Setting_1.jpg
STM32F103 with ST-LINK Jumpers Setting_1.jpg (115.98 KiB) Viewed 519 times

Leave a Reply

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