Help with st-link v2

stevestrong
Posts: 1813
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: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
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Re: Help with st-link v2

Post by 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?)
Last edited by CrtSuznik on Sun Apr 23, 2017 8:34 pm, edited 1 time in total.

User avatar
Rick Kimball
Posts: 1056
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: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"?
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
If you are using the correct board, "Generic STM32F103C series", with the STLINK upload, this is going to be set for you.


https://github.com/rogerclarkmelbourne/ ... s.txt#L215
-rick

User avatar
Rick Kimball
Posts: 1056
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: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.
-rick

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: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"?
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
If you are using the correct board, "Generic STM32F103C series", with the STLINK upload, this is going to be set for you.


https://github.com/rogerclarkmelbourne/ ... s.txt#L215

So if I understand correctly, I just paste the 215th line into my boards.txt
I did that and restarted the IDE...doesn't seem to help

p.s. this is the board i'm using
http://www.cnx-software.com/wp-content/ ... _Board.jpg

stevestrong
Posts: 1813
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: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
Posts: 16
Joined: Thu Oct 20, 2016 4:00 pm

Re: Help with st-link v2

Post by 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.
It compiles ok...
Sketch uses 12,876 bytes (19%) of program storage space. Maximum is 65,536 bytes.
Global variables use 2,816 bytes of dynamic memory.

When I try to upload it...it says the same and says Done uploading.

Both jumpers are set to 0. The power light is on.

The thing is...even if i only have the st-link plugged into the usb port and the stm32 disconnected it does the same thing aka Done uploading without any errors.

stevestrong
Posts: 1813
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:57 pm

I would like to see the clear text of the uploading message with the stlink dongle. It may be defective.

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: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
Posts: 1813
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Help with st-link v2

Post by 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.

Post Reply