cancel
Showing results for 
Search instead for 
Did you mean: 

I'm not able to run c++ examples, CubeProgrammer ver. 2.3.

Cristian1
Associate

CubeProgrammer_API.dll is a 64bit dll while the .lib is for 32bit. Generating a new 64bit lib from the dll do not solve the issue since the other dlls are mixed.

Here's a list:

CubeProgrammer_API.dll 64 bit

libgcc_s_seh-1.dll 64 bit

libstdc++-6.dll 64 bit

Qt5Core.dll 64 bit

Qt5SerialPort.dll 64 bit

Qt5Xml.dll 64 bit

STLinkUSBDriver.dll 64 bit

FileManager.dll 32 bit

HSM_P11_Lib.dll 32 bit

libeay32.dll 32 bit

libgcc_s_dw2-1.dll 32 bit

libwinpthread-1.dll 32 bit

mfc120.dll 32 bit

msvcp120.dll 32 bit

msvcr120.dll 32 bit

stlibp11_SAM.dll 32 bit

xerces-c_3_1.dll 32 bit

Thank you in advance.

Cristian

2 REPLIES 2
PPete.3
Associate

I have exactly the same problem (CubeProgrammer 2.3).

For me generating a 64bit lib and using 64bit dlls (most of them can be found in "STM32CubeProgrammer/bin") works.

  1. Open a Visual Studio Developer Command Line and cd to "STM32CubeProgrammer/api/lib"
  2. Enter "dumpbin /export CubeProgrammer_API.dll > CubeProgrammer_API.exports"
  3. Create a copy of CubeProgrammer_API.exports called CubeProgrammer_API.exp
  4. Open CubeProgrammer_API.exp, delete everything but the function names and put "EXPORTS" in the first line (i used Notepad++ together with Alt+Select)
  5. Delete the decorated function names _Z***
  6. CubeProgrammer_API.exp should look like below now
EXPORTS
AddedLoadersToMenu
Alloc
CloseSession
CoreReset
...
...
...
writeMemory
writeUserKey

Enter "lib /def:CubeProgrammer_API.def /machine:x64 /out:CubeProgrammer_API.lib" to create the 64bit lib.

Copy *.dll files from "STM32CubeProgrammer/bin" to "STM32CubeProgrammer/api/lib" (You might skip msvc*.dll and mfc*.dll)

Copy the following files from "C:\Windows\System32" to "STM32CubeProgrammer/api/lib" (for Visual Studio 2019):

msvcp140d.dll
ucrtbased.dll
vcruntime140d.dll

Configure the 64bit Platform in the Cube Programmer API example according to the "Win32" platform and create a Project Configuration "Debug/x64" that derives from "Win32" but uses "x64" platform.

Build.

Run.

This of course is a work-around. Is there a Win32 build of the DLL available as well?

Thanks in advance,

Philipp

Cristian1
Associate

Thank you Philipp.

I had not noticed that the missing 64bit DLLs were in the BIN folder!

Cristian