cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link API in C/C++

Mathias89
Associate II

Hi everyone,

 

My program isn't establishing a connection to the controller.

FlashLoder and Data_Base are located right next to the .exe file in the /x64/Debug folder.

 

I've attached my program; maybe someone can point out where I'm going wrong.

 

It works fine with Example 2.

 

Thanks a lot

Best regards, Mathias89

 

5 REPLIES 5
Aziz BRIGUI
ST Employee

Hi @Mathias89

In the way your project is structured, you'll need to put the Data_Base folder at the same level as "STLink_V01_XXX" folder. I also suggest you set the displayCallBacks as done in the main API file to have better logging in case of issues. If that was set you would have had a message like this one:

AzizBRIGUI_0-1780327847326.png

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Mathias89
Associate II

Good morning,

 I've placed the Data_Base folder on the same level as the “STLink_V01_XXX” folder. It still doesn't work—I just can't establish a connection using the “connectStLink()” function. I'm getting error code -545.

Hi @Mathias89

I'm re-attaching the project to make sure we're in line. I just moved the Data_Base folder:

- Target linked

image.png

- No target linked

image (1).png

Have a good day !

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Mathias89
Associate II

Hello Aziz, 
i have found the problem and the system is running now. 
the LoaderPath want the files form (C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\api\lib)
I copied the folder and pasted it into my project. Now the connection to the MCU is established, and the download is working.
Most of the information you find refers to the bin folder, but in my opinion, that's not correct.

thx bb



Hi @Mathias89

I don't understand your point, you mean you managed to fix the issue without changing the data_base path? Could you attach a project to demonstrate this please?

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.