Update texane stlink

vitor_boss
Posts: 66
Joined: Wed Apr 19, 2017 9:50 am

Update texane stlink

Post by vitor_boss » Mon Aug 28, 2017 6:46 pm

I bought a ST-Link clone from Aliexpress and it works with STM32 ST-LINK Utility but couldn't upload on arduino.

After some digging I found texane stlink utility inside libraries, but is only 4 years outdated(v0.5.6), after download the last version(1.3.0) compiled for windows(I try but don't success) and a small change on stlink_upload.bat it worked.

EDIT: The last release is 1.4.0

Is possible to update and set as default st-link program on all systems?

fpiSTM
Posts: 317
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Update texane stlink

Post by fpiSTM » Mon Aug 28, 2017 7:17 pm

I've made the job here for the 1.3.0
https://github.com/stm32duino/Arduino_T ... ab4af1f14e
It could help as it's based on the same script. Main issue was for the library path.

vitor_boss
Posts: 66
Joined: Wed Apr 19, 2017 9:50 am

Re: Update texane stlink

Post by vitor_boss » Mon Aug 28, 2017 8:32 pm

fpiSTM wrote:
Mon Aug 28, 2017 7:17 pm
I've made the job here for the 1.3.0
https://github.com/stm32duino/Arduino_T ... ab4af1f14e
It could help as it's based on the same script. Main issue was for the library path.
My knowledge in C is very small, I have downloaded Cygwin64 to try compile it for windows but only got errors. The version 1.3.0 have a small bug, v1.3.1 fixed it

fpiSTM
Posts: 317
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Update texane stlink

Post by fpiSTM » Mon Aug 28, 2017 8:46 pm

Fix in 1.3.1 is mainly for build. Not required as we provide the binary. I do not compile it for windows as we provide st-link utility for windows.
I mainly shared for script update as there are the same for linux/MacOs ;)

vitor_boss
Posts: 66
Joined: Wed Apr 19, 2017 9:50 am

Re: Update texane stlink

Post by vitor_boss » Mon Aug 28, 2017 8:51 pm

fpiSTM wrote:
Mon Aug 28, 2017 8:46 pm
Fix in 1.3.1 is mainly for build. Not required as we provide the binary. I do not compile it for windows as we provide st-link utility for windows.
I mainly shared for script update as there are the same for linux/MacOs ;)
st-link utility for windows don't work with st-link clones but texane's do

fpiSTM
Posts: 317
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Update texane stlink

Post by fpiSTM » Mon Aug 28, 2017 9:09 pm

I know. I have already asked myself the question to add it to Arduino_Tools repo and let user choose his preferred stlink tools. At least to have the same tools for all host OS.
I will give a try ;)

fpiSTM
Posts: 317
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Update texane stlink

Post by fpiSTM » Tue Aug 29, 2017 9:41 am

Hi, @vitor_boss
I've built the texane stlink 1.4.0 for Windows (64bits), it is available here if you want make a try
https://github.com/fpistm/stm32_tools/r ... -win64.zip

vitor_boss
Posts: 66
Joined: Wed Apr 19, 2017 9:50 am

Re: Update texane stlink

Post by vitor_boss » Tue Aug 29, 2017 8:50 pm

fpiSTM wrote:
Tue Aug 29, 2017 9:41 am
Hi, @vitor_boss
I've built the texane stlink 1.4.0 for Windows (64bits), it is available here if you want make a try
https://github.com/fpistm/stm32_tools/r ... -win64.zip
It's alive, worked like a boss. Thank you.

You will include and let it default for windows?

Code: Select all

rem: ------------- use STLINK CLI
rem:stlink\ST-LINK_CLI.exe -c SWD -P %str% 0x8000000 -Rst -Run

rem: Using the open source texane-stlink instead of the proprietary STM stlink exe
texane-stlink\st-flash.exe write %str% 0x8000000
I just change those lines to get working.

fpiSTM
Posts: 317
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Update texane stlink

Post by fpiSTM » Wed Aug 30, 2017 6:57 am

In fact, this need more stuff.
This should be great to align to the same version but this need to build for all platform. Linux is not an problem but currently I could not build it for MacOs. Moreover, I think the windows version need to be build for win32 instead of win64.

Just FYI, I do not have special issue to the build, only issue with ST proxy. I've downloaded manually the libusb and the full install of mingw64.
Maybe you missed to update the path for cmake and mingwin the .bat script file?

vitor_boss
Posts: 66
Joined: Wed Apr 19, 2017 9:50 am

Re: Update texane stlink

Post by vitor_boss » Wed Aug 30, 2017 11:19 am

No, I did everything needed but always return error. mingw64-build.bat:

Code: Select all

@echo off
set PATH=C:\Program Files (x86)\CMake\bin;C:\Program Files\CMake\bin;C:\Program Files\mingw-w64\x86_64-7.1.0-win32-sjlj-rt_v5-rev2\mingw64\bin;%PATH%
cmake -G "MinGW Makefiles" ..
mingw32-make
mingw32-make install DESTDIR=_install
mingw32-make package
This is error log:

Code: Select all

Performing C SOURCE FILE Test C_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS failed with the following output:
Change Dir: C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp

Run Build Command:"C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/bin/mingw32-make.exe" "cmTC_5f98f/fast"
C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_5f98f.dir\build.make CMakeFiles/cmTC_5f98f.dir/build

mingw32-make.exe[1]: Entering directory 'C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp'

Building C object CMakeFiles/cmTC_5f98f.dir/src.c.obj

C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\gcc.exe   -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS   -Wmissing-variable-declarations -o CMakeFiles\cmTC_5f98f.dir\src.c.obj   -c C:\Users\Vitor\Desktop\stlink-1.4.0\scripts\CMakeFiles\CMakeTmp\src.c

gcc.exe: error: unrecognized command line option '-Wmissing-variable-declarations'; did you mean '-Wmissing-declarations'?

mingw32-make.exe[1]: *** [CMakeFiles\cmTC_5f98f.dir\build.make:65: CMakeFiles/cmTC_5f98f.dir/src.c.obj] Error 1

mingw32-make.exe[1]: Leaving directory 'C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp'

mingw32-make.exe: *** [Makefile:125: cmTC_5f98f/fast] Error 2


Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test C_SUPPORTS_WSHORTEN_64_TO_32 failed with the following output:
Change Dir: C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp

Run Build Command:"C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/bin/mingw32-make.exe" "cmTC_ef504/fast"
C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_ef504.dir\build.make CMakeFiles/cmTC_ef504.dir/build

mingw32-make.exe[1]: Entering directory 'C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp'

Building C object CMakeFiles/cmTC_ef504.dir/src.c.obj

C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\gcc.exe   -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WSHORTEN_64_TO_32   -Wshorten-64-to-32 -o CMakeFiles\cmTC_ef504.dir\src.c.obj   -c C:\Users\Vitor\Desktop\stlink-1.4.0\scripts\CMakeFiles\CMakeTmp\src.c

gcc.exe: error: unrecognized command line option '-Wshorten-64-to-32'

mingw32-make.exe[1]: *** [CMakeFiles\cmTC_ef504.dir\build.make:65: CMakeFiles/cmTC_ef504.dir/src.c.obj] Error 1

mingw32-make.exe[1]: Leaving directory 'C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp'

mingw32-make.exe: *** [Makefile:125: cmTC_ef504/fast] Error 2


Source file was:
int main(void) { return 0; }
Determining if the include file sys/mman.h exists failed with the following output:
Change Dir: C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp

Run Build Command:"C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/bin/mingw32-make.exe" "cmTC_d75c6/fast"
C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_d75c6.dir\build.make CMakeFiles/cmTC_d75c6.dir/build

mingw32-make.exe[1]: Entering directory 'C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp'

Building C object CMakeFiles/cmTC_d75c6.dir/CheckIncludeFile.c.obj

C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\gcc.exe   -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -Wimplicit-function-declaration -Wredundant-decls -O2 -Werror    -o CMakeFiles\cmTC_d75c6.dir\CheckIncludeFile.c.obj   -c C:\Users\Vitor\Desktop\stlink-1.4.0\scripts\CMakeFiles\CMakeTmp\CheckIncludeFile.c

C:\Users\Vitor\Desktop\stlink-1.4.0\scripts\CMakeFiles\CMakeTmp\CheckIncludeFile.c:1:10: fatal error: sys/mman.h: No such file or directory

 #include <sys/mman.h>

          ^~~~~~~~~~~~

compilation terminated.

mingw32-make.exe[1]: *** [CMakeFiles\cmTC_d75c6.dir\build.make:65: CMakeFiles/cmTC_d75c6.dir/CheckIncludeFile.c.obj] Error 1

mingw32-make.exe[1]: Leaving directory 'C:/Users/Vitor/Desktop/stlink-1.4.0/scripts/CMakeFiles/CMakeTmp'

mingw32-make.exe: *** [Makefile:125: cmTC_d75c6/fast] Error 2

Post Reply