stm32 uploading with stlink not uploading

Post Reply
jonghaboy
Posts: 9
Joined: Fri Mar 13, 2020 7:08 am

stm32 uploading with stlink not uploading

Post by jonghaboy »

hi

i am trying to upload a simple blink code to a bluepill using arduino ide and a st link.

i am currently following this video step by step

https://youtu.be/zUk0lN1oEwQ?t=382

I am having trouble with one computer while another computer works fine and is uploading code.

i have done all the steps exactly like the second half of the video where it explains how to use stlink

i have looked at the two computers and they give me different messages after uploading

can anyone fix this problem?

the computer that doesn't work gives me a message like this after uploading

Code: Select all

C:\Users\User\Desktop\Blink>rem @echo off 

C:\Users\User\Desktop\Blink>rem: Note C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win\ get path of this batch file 

C:\Users\User\Desktop\Blink>rem: Need to change drive if My Documents is on a drive other than C: 

C:\Users\User\Desktop\Blink>set driverLetter=C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win\ 

C:\Users\User\Desktop\Blink>set driverLetter=C: 

C:\Users\User\Desktop\Blink>C:

C:\Users\User\Desktop\Blink>cd C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win\ 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>rem: the two line below are needed to fix path issues with incorrect slashes before the bin file name 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>set str=C:\Users\User\AppData\Local\Temp\arduino_build_756723/Blink.ino.bin 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>set str=C:\Users\User\AppData\Local\Temp\arduino_build_756723\Blink.ino.bin 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>rem: ------------- use STLINK CLI 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>stlink\ST-LINK_CLI.exe -c SWD -P C:\Users\User\AppData\Local\Temp\arduino_build_756723\Blink.ino.bin 0x8000000 -Rst -Run -NoPrompt 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>rem: Using the open source texane-stlink instead of the proprietary STM stlink exe 

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win>rem:texane-stlink\st-flash.exe write C:\Users\User\AppData\Local\Temp\arduino_build_756723\Blink.ino.bin 0x8000000 

while the computer that works gives me this

Code: Select all

C:\Program Files (x86)\Arduino>rem @echo off 

C:\Program Files (x86)\Arduino>rem: Note C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win\ get path of this batch file 

C:\Program Files (x86)\Arduino>rem: Need to change drive if My Documents is on a drive other than C: 

C:\Program Files (x86)\Arduino>set driverLetter=C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win\ 

C:\Program Files (x86)\Arduino>set driverLetter=C: 

C:\Program Files (x86)\Arduino>C:

C:\Program Files (x86)\Arduino>cd C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win\ 

C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>rem: the two line below are needed to fix path issues with incorrect slashes before the bin file name 

C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>set str=C:\Users\jongha\AppData\Local\Temp\arduino_build_303798/Blink.ino.bin 

C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>set str=C:\Users\jongha\AppData\Local\Temp\arduino_build_303798\Blink.ino.bin 

C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>rem: ------------- use STLINK CLI 

C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>stlink\ST-LINK_CLI.exe -c SWD -P C:\Users\jongha\AppData\Local\Temp\arduino_build_303798\Blink.ino.bin 0x8000000 -Rst -Run -NoPrompt 
STM32 ST-LINK CLI v3.3.0.0
STM32 ST-LINK Command Line Interface

ST-LINK SN: Old ST-LINK firmware/ST-LINK already used
ST-LINK Firmware version: V2J17S4 (Need Update)
Connected via SWD.
Target voltage = 3.3 V
Connection mode: Normal
Reset mode: Software reset
Device ID: 0x410 
Device flash Size: 64 Kbytes
Device family: STM32F10xx Medium-density

Loading file...
Flash Programming:
  File : C:\Users\jongha\AppData\Local\Temp\arduino_build_303798\Blink.ino.bin
  Address : 0x08000000
Memory programming...
�������������������������������������������������� 0%
 0%���������������������������� 56%���������������������� 100%
Memory programmed in 1s and 360ms.
Programming Complete.

MCU Reset.

Application started.


C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>rem: Using the open source texane-stlink instead of the proprietary STM stlink exe 

C:\Users\jongha\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.3.13\win>rem:texane-stlink\st-flash.exe write C:\Users\jongha\AppData\Local\Temp\arduino_build_303798\Blink.ino.bin 0x8000000 

stevestrong
Posts: 185
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 5
Location: Munich, Germany
Contact:

Re: stm32 uploading with stlink not uploading

Post by stevestrong »

You have to install the STLink driver onto the non-working PC.

jonghaboy
Posts: 9
Joined: Fri Mar 13, 2020 7:08 am

Re: stm32 uploading with stlink not uploading

Post by jonghaboy »

i did insall the stlink driver just like the one that works

would there be any other reason?

stas2z
Posts: 118
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: stm32 uploading with stlink not uploading

Post by stas2z »

check C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win folder and ensure it contains stlink subfolder with ST-LINK_CLI.exe inside

jonghaboy
Posts: 9
Joined: Fri Mar 13, 2020 7:08 am

Re: stm32 uploading with stlink not uploading

Post by jonghaboy »

ok it did not contain those files

so i copied the files from the working comp to the not working comp

but the results were the same

what todo?

jonghaboy
Posts: 9
Joined: Fri Mar 13, 2020 7:08 am

Re: stm32 uploading with stlink not uploading

Post by jonghaboy »

i erased everything with a clean slate and started over, checked the AppDAta folder to see the files installed, tried again, but still didn't work

jonghaboy
Posts: 9
Joined: Fri Mar 13, 2020 7:08 am

Re: stm32 uploading with stlink not uploading

Post by jonghaboy »

to anyone with similar issues,

i checked

C:\Users\User\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.4.23\win

folder and ensure it contains stlink subfolder with ST-LINK_CLI.exe.

i double clicked on ST-LINK_CLI.exe and got som weird directX errors.

i updated directX and reinstalled visual C++ updates on windows and tried clicking on ST-LINK_CLI.exe.

what you should get is a cmd window with a bunch of lines showing you what commands you can use.

problem fixed.

Post Reply

Return to “STM32F1 based boards”