2025-10-19 11:14 PM
I'm working on some automation for our project using the STLINK-V3PWR. For that, I need to control the GPIOs.
Based on the information from this page, I managed to get a working solution.
Unfortunately, when compiling on Windows, I ran into a linker issue with the provided STLinkUSBDriver.dll. It seems that I'm missing the corresponding .a file for the linker.
I also tried using dlltool, but it appears that some of the required functions are not present in the DLL.
Has anyone managed to successfully generate a working import library for Windows/Cygwin?
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x31): undefined reference to `STLink_FreeLibrary()'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x7e): undefined reference to `STLink_FreeLibrary()'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x15f): undefined reference to `STLink_GetLibApiVer()'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x1e2): undefined reference to `STLink_Reenumerate(TEnumStlinkInterface, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x203): undefined reference to `STLink_GetNbDevices(TEnumStlinkInterface)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x29f): undefined reference to `STLink_ReenumerateTcp(TEnumStlinkInterface, unsigned char, char*, char*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x2d8): undefined reference to `STLink_GetServerVersion(STLink_ServerVersionT*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x34b): undefined reference to `STLink_Reenumerate(TEnumStlinkInterface, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x364): undefined reference to `STLink_GetNbDevices(TEnumStlinkInterface)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x43f): undefined reference to `STLink_ReenumerateTcp(TEnumStlinkInterface, unsigned char, char*, char*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x498): undefined reference to `STLink_GetServerVersion(STLink_ServerVersionT*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x512): undefined reference to `STLink_GetDeviceInfo(TEnumStlinkInterface, unsigned char, TDeviceInfo*, unsigned int)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x57c): undefined reference to `STLink_Reenumerate(TEnumStlinkInterface, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x5c2): undefined reference to `STLink_GetNbDevices(TEnumStlinkInterface)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x6a6): undefined reference to `STLink_GetServerVersion(STLink_ServerVersionT*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x713): undefined reference to `STLink_GetDeviceInfo2(TEnumStlinkInterface, unsigned char, TDeviceInfo2*, unsigned int)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x785): undefined reference to `STLink_Reenumerate(TEnumStlinkInterface, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x7b7): undefined reference to `STLink_GetNbDevices(TEnumStlinkInterface)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x886): undefined reference to `STLink_ReenumerateTcp(TEnumStlinkInterface, unsigned char, char*, char*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x8a3): undefined reference to `STLink_GetServerVersion(STLink_ServerVersionT*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x923): undefined reference to `STLink_OpenDevice(TEnumStlinkInterface, unsigned char, unsigned char, void**)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0x9b0): undefined reference to `STLink_OpenDeviceTcp(TEnumStlinkInterface, unsigned int, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0xad6): undefined reference to `STLink_GetDeviceInfo2(TEnumStlinkInterface, unsigned char, TDeviceInfo2*, unsigned int)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0xc7d): undefined reference to `STLink_CloseDevice(void*)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0xccb): undefined reference to `STLink_CloseDeviceTcp(unsigned int, unsigned char)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0xd5e): undefined reference to `STLink_SendCommandTcp(unsigned int, TDeviceRequest*, unsigned int)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0xdc7): undefined reference to `STLink_SendCommand(void*, TDeviceRequest*, unsigned int)'
/usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: STLINK-V3-BRIDGE/src/sharedStlk/common/stlink_interface.o:stlink_interface.cpp:(.text+0xf93): undefined reference to `STLink_GetNumOfDeviceClientsTcp(unsigned int)'