From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK/V2 Programmer with LabVIEW (VISA)

Solved!
Go to solution

Dear all,

 

I'm trying to automate programmation of microcontroller STM32F410 with ST-LINK/V2 programmer on LabVIEW, using VISA Library.

First, I've generated the ".inf" driver with NI-VISA Driver Wizard, signed and installed it. It's seems to be OK, because in Device Manager I can see that the STM32 moves from "Périphériques Universal Serial Bus" to "NI-VISA USB Devices".

 

Device Manager with ST-Link device as USB DeviceDevice Manager with ST-Link device as USB Device --> Device Manager with ST-Link device as NI-VISADevice Manager with ST-Link device as NI-VISA

 

But impossible to see my device on MAX :

 

NIMAX.PNG

 

The device seems to be properly defined as VISA ressource, it is not yet accessible for the software STM32 ST-LINK Utility.

 

I've tried to uninstall and install again my driver, restart my computer, but impossible to see my programmer in MAX. I've do the same operation with another driver (SEGGER JLink Base Compact programmer), and all is in order.

 

I work with:

- Windows 10 Enterprise version 1903

- LabVIEW 2018 SP1 version 18.0.1f4 (32-bit)

- NI-VISA 19.5

- NI-MAX 19.5.0f0

 

 Programmer information (driver)

- access path: USB\VID_0483&PID_3748\5&A6A6D4&0&2

- supplier: STMicrolectronics

- Vendor ID: 0x0483

- Product ID: 0x3748

 

Can someone help me with this programmer? Have I made Something bad?

 

Thank you per advance!

 

Francis M
Message 1 of 22
(8,979 Views)

More iniformation… when I've generated the driver.inf file, I had an error when I've selected my device:

 

visa1.PNG visa err.PNG

 

To solve it, I've choose "Other…" in the Device List and manually set Names and IDs.

 

Maybe this error can be the cause of my problem...

 

Thank you!

 

Francis M
0 Kudos
Message 2 of 22
(8,969 Views)

Why not use VISA for a normal serial port connection instead via the USB wizard.

The serial connection will also use the USB port if you have a USB to serial converter and you can use the normal serial commands at high speed anyway.

 

No need to do the low level USB programming yourself.

greetings from the Netherlands
Message 3 of 22
(8,955 Views)

Hello Albert,

 

Thank you for your response. It's good idea, but I'm not sure to good understand...

I've usb to serial converters, but I use it to connect devices RS232 with DB9 connector to an usb port. Maybe you talk about a driver, like a "Virtual COM Port"? I Don't know if  can do this with this programmer...

Francis M
0 Kudos
Message 4 of 22
(8,951 Views)

Hi

I checked now to see what the communication system really is and found this:

https://www.st.com/content/ccc/resource/technical/document/user_manual/65/e0/44/72/9e/34/41/8d/DM000...

A problem will be next sentence on page 15

The ST-LINK/V2 requires a dedicated USB driver.

 

So you probably need third party software

Or the guy who already have done something like that

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/VI-package-for-St-Link-V2/td-p/3859063?profi...

greetings from the Netherlands
Message 5 of 22
(8,929 Views)

Hello,

 

I've asked ST some days ago, their advice was to use CLI version of ST-Link with a batch file called from LabVIEW. I know how to do a batch file, how to call it from LabVIEW but I've difficulties to link it with STM32 ST-Link Utility CLI... I've asked ST support again for help.

Francis M
0 Kudos
Message 6 of 22
(8,906 Views)
Solution
Accepted by topic author Cisco

I've finally find the way to call CLI of ST-LINK from LabVIEW. It runs properly. I share the code, if somebody else need it...

 

prog stm32.png

Many thanks to  for the help!

 

Regards,

Francis M
Message 7 of 22
(8,901 Views)

Thanks for sharing the solution

greetings from the Netherlands
Message 8 of 22
(8,897 Views)

Hi Francis M

i am also developing the same application to automate the program flash into STM8S105X6 micro controller using ST link/V2.

can you please share the application VI.

and i have some more queries since i am new to this type of application.

Do i need STM 32 programmer with this or i can transfer hex file directly from LabVIEW application by ST link/V2?

Regards

Anuj S

0 Kudos
Message 9 of 22
(8,553 Views)

Hi Anu S,

 

The vi I use to program my microcontroler is the one I've posted as solution (VI snipped). You can use it directly. The vi doesn't directly program the hex file, it call the commande line interface of STM32 (C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe) and send instructions to do this -->  STM32 ST-Link Utility has to be installed. It's like a scripting of ST Link instructions in command lines.

Regards,

Francis M
0 Kudos
Message 10 of 22
(8,541 Views)