2024-12-04 06:17 AM - last edited on 2024-12-04 06:44 AM by Andrew Neil
Hello,
is it possible to change the baud rate VCP to USART bridge of the STLINK-V3EC on the Nucleo STM32H7S evalboards?
The documentation states the following:
Virtual COM port
The serial interface UART3 (PD8/PD9) that supports the bootloader is directly available as a Virtual COM port of
the PC connected to the STLINK-V3EC USB connector (CN5). The VCP configuration is the following:
• 115200 bps
• 8-bit data
• No parity
• One-stop bit
• No flow control
Since the stand-alone STLINKs have the feature to change the baud rate of the VCP to UART bridge I was wondering if this is also possible on the STLINK-V3EC.
Best regards
Basti
2024-12-04 06:43 AM
It would be easy to try it - just change the baud rate setting in your terminal app, and see what happens ...
2024-12-05 07:34 AM
Hello Andrew,
assuming I would do so, what UART Baudrate is exactly set? The baud rate of the MCU is derived from the MCO clock and the prescaler settings. So I cannot set any baud rate value. What will happen if I set something like 1.2345 MBaud?
Normally VCP ignores baudrate settings anyway.
Best regards
Basti
2024-12-09 05:32 AM
Hello
The baudrate that you set in the PC application (600,1200..., 921600) is transmitted to the ST-Link on the VCP interface, it is automatic. From that baudrate, the ST-Link will compute its prescaler (see below) to use for the UART interface that communicates with the MCU.
The ST-Link V3 Documentation section 14.2 tries to explain what baurates are possible:
in "high perf" mode (default configuration of the ST-Link):
"384 MHz / prescaler with prescaler = [24 to 31]"
i.e. 12 387 096, ..., 16 000 000 bauds
or
"192 MHz / prescaler with prescaler = [16 to 65535]"
i.e. 2929, ..., 12 000 000 bauds
So, to reuse your example of 1.2345 MBaud (assuming you have an app that allow to configure such a baurate), the ST-Link firmware should compute a prescaler of 192000000/1234500 ~= 155.
The level shifters on the Nucleo boards can introduce frequency limitation, I think this is the case for the H7S one.
For the baudrate to use to communicate with the bootloader please see AN2606
2024-12-09 06:07 AM - edited 2024-12-09 06:24 AM
That's the baud rate of the VCP; ie, the baud rate of the UART in the ST-Link on which the signals emerge.
EDIT - Here:
So you set your MCU's baud rate to match that.
@Basti_ wrote:Normally VCP ignores baudrate settings anyway.
No, it defines the baudrate of the physical connection emerging from the ST-Link.
2024-12-09 06:13 AM
@Mike_ST wrote:The baudrate that you set in the PC application (600,1200..., 921600) is transmitted to the ST-Link on the VCP interface, it is automatic.
Indeed.
So it is misleading of the document to say, "The VCP configuration is the following..."
because that is set by the host application - not the target.
2024-12-09 06:36 AM
Hi Andrew,
>> So it is misleading of the document to say, "The VCP configuration is the following..."
Yes, I know.
The intention of the writer was to say that the "out of the box" demonstration software, when there is one, is configured that way.