Skip to main content
debugging
Lead
November 27, 2024
Solved

STLINK-V3MODS UART API

  • November 27, 2024
  • 3 replies
  • 1785 views

Hello,

 

The documentation and flyers of the STLINK-V3MODS specify that the product includes an USB to UART bridge. My custom board with the V3MODS works for JTAG/SWD, I2C and Virtual UART. However, the documentation and sample code does not contain an API for the UART. Is such feature planned for the future  ?

In the mean time the manual states that CAN has not been tested with real CAN bus. has this already been done ?

 

Best answer by AM_it

Hello,

You can refer to the STLINK-V3MODS reference manual and TN1235 Overview of ST-LINK derivatives to find how to activate the Bridge UART signals. The Bridge UART functionality is only provided as a second Virtual COM port (not as a dedicated UART API).

"Bridge UART
UART signals with hardware flow control (CTS/RTS) are available on MB1467 CN2 pins 1,2, 3, and 11. They need dedicated firmware to be programmed on the main module before being used. Without this firmware, the Virtual COM port function must be used instead (no hardware flow control)."

TN1235:

"1.2.2 USB interface selection,  Figure 2. STLINK-V3 firmware selection for a second Virtual COM port"

For CAN BRIDGE API, yes: in the meantime, it has been tested with a STLINK-V3SET + an internal validation board  with a CAN transceiver connected to a STM32 evaluation board target having a CAN transceiver.

Best regards

3 replies

AM_it
AM_itBest answer
ST Employee
November 27, 2024

Hello,

You can refer to the STLINK-V3MODS reference manual and TN1235 Overview of ST-LINK derivatives to find how to activate the Bridge UART signals. The Bridge UART functionality is only provided as a second Virtual COM port (not as a dedicated UART API).

"Bridge UART
UART signals with hardware flow control (CTS/RTS) are available on MB1467 CN2 pins 1,2, 3, and 11. They need dedicated firmware to be programmed on the main module before being used. Without this firmware, the Virtual COM port function must be used instead (no hardware flow control)."

TN1235:

"1.2.2 USB interface selection,  Figure 2. STLINK-V3 firmware selection for a second Virtual COM port"

For CAN BRIDGE API, yes: in the meantime, it has been tested with a STLINK-V3SET + an internal validation board  with a CAN transceiver connected to a STM32 evaluation board target having a CAN transceiver.

Best regards

debugging
debuggingAuthor
Lead
November 28, 2024

Thanks, but the documentation made it look like it was accessed via the bridge API. I assumed that was the case while still using the storage feature.

I downloaded the STlink upgrade package, and ran the udev rules.

I had to change form java-8 to jdk-21 openjdk version then run

java -jar STLinkUpgrade.jar

Then found the "type" option and changed it, and it now there are now two Virtual UARTS :)

P.S what is the use of the storage media ? For what purpose it can be used?

AM_it
ST Employee
November 28, 2024

Hello

I am happy you solved the java issue and found the second VCP.

Mass storage feature was implemented mainly for ARM-MBED Drag and Drop programming support with the Nucleo/Discovery boards embedding an STLINK. However, it can now be considered outdated, and it is recommended to use STM32CubeProgrammer software to program your target. (you may find more information and an issue example in this post https://community.st.com/t5/stm32-mcus-boards-and-hardware/st-link-stlink-mass-storage-drag-and-drop-programming-issues/m-p/586348 )

Best regards

 

Andrew Neil
Super User
November 27, 2024

What do you mean by, "API for the UART" ?

At the microcontroller end, it's just a UART - you send async serial data to it, and receive async serial data from it

At the Host end, it's a standard USB CDC/ACM, which the Host OS presents as a virtual COM port (a virtual tty on Linux)

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
AM_it
ST Employee
November 27, 2024

Hello Andrew,

It means that the STLINK-V3SET/MODS bridge UART signals can be used by the USB host using the second USB Virtual COM port interface (as you said) but not using the USB Bridge interface (used for Bridge I2C, SPI, ... with STLINK-V3-BRIDGE API, https://www.st.com/en/development-tools/stlink-v3-bridge.html ). I hope this clarifies.

Best regards