cancel
Showing results for 
Search instead for 
Did you mean: 

STVP DLLs report issue if connecting to ST-LINK v2

FMatt
Associate II

Hi all,

I started to develop a small console application in C++ , based on the following document : https://www.st.com/content/ccc/resource/technical/document/user_manual/90/cb/42/ef/2e/53/46/75/CD00060186.pdf/files/CD00060186.pdf/jcr:content/translations/en.CD00060186.pdf

I just copied the code from this document to my project with few modifications and everything works fine, until a DLL calls the "long CALLBACK AppendErrorText(const char* szMsg)" function with the following message :

"Cannot communicate with the tool.

Wrong tool selection or check tool power supply or check that a previous session is closed."

The ELoadFile(fileStr, iAreaId) function causes a dll to call one other callback with the percent of loading of my file image in the RAM of my computer. Which shows that up to there, it works. But as soon as I write this file in RAM to the port, I get the previous message...

Do you have an idea what is the source of this trouble? The HW I want to communicate with is a ST-LINK v2. Which doesn't appears in the list of hardwares given by tools.cnf. But if I start STVP, I see, the recognized HW is the ST-LINK and everything works fine...

Thanks!

2 REPLIES 2
FMatt
Associate II

Hi,

Everything works fine now. I wrote this : CSetWorkingDir(dllPath) with dllPath the path to the dlls used by STVP.

ST-LINK V2 is recorded with the HW name "ST-LINK" in the tool.cnf file.

Kind regards,

FMatt
Associate II

... And I had also to add the file "STLinkUSBDriver.dll" in the same folder as the .exe file.