2025-02-14 1:27 AM
Hi everyone,
I'm working with an STWINBX1 board and using ST-LINK V3MINI for debugging and serial communication. However, I can't see any output on PuTTY (COM3 @ 115200 baud), even though everything seems correctly configured.
:white_heavy_check_mark: Checked and confirmed USART3 is initialized in main.c
:white_heavy_check_mark: Added debug messages via HAL_UART_Transmit(&huart3, ...)
:white_heavy_check_mark: Toggled an LED before sending UART data (LED toggles, so the function executes)
:white_heavy_check_mark: Checked in STM32CubeMX that USART3 is mapped to the correct GPIOs
:white_heavy_check_mark: Verified ST-LINK V3MINI appears as COM3 in Device Manager
:white_heavy_check_mark: Tried enabling/disabling "VCP UART" in STM32CubeProgrammer
:white_heavy_check_mark: Tested different baud rates in PuTTY
Any help would be greatly appreciated!
Solved! Go to Solution.
2025-03-02 10:46 PM
As I might have mentioned, I am not really versed CubeIDE.
Although the screenshots seem to indicate the serial link is correct so far.
You would have to check is that PD5 and PD6 are not connected to other external circuitry that prohibit usage as UART. A good ("bad") example are some Discovery boards with LCD or external memory, where the external bus interface consumes most of the peripheral connections & options.
Looking it up, ST's website says :
> For wired connectivity, it includes a USB Type-C® port that can be used for power supply, data transfer and STM32 programming via DFU, and an RS-485 transceiver.
This is a relatively broad statement, I would check the user manual about details.
RS-485 is very similiar to "normal" RS-232, but not compatible on electrical level.
I would first check what works, and what doesn't.
Flash an application that transmits regularly via UART2, and then check the UART signals (Tx) near the target MCU, at the debug connector, and finally at the ST-LinkV3 (Rx). A scope would be optimal, but a logic analyser works, too.
If the STWinbx1 board has a MCU reset button, you don't even need to fire up the CubeIDE debugger. Just connect the probe, and press rest. You should see at least UART signals on the UART2.Tx pin of the target MCU.
2025-02-14 1:55 AM
@Mahdouch wrote:2. Should I use USART1 instead of USART3, or does ST-LINK only work with specific USARTs?
The ST-Link neither knows nor cares what UART you use - all it does is send data out of its 'send' pin, and all it sees is data arriving at its 'receive' pin. It doesn't even know that you're using an STM32 at all!
Start by doing a basic application which just transmits from the UART - nothing else - to prove basic connectivity.
https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART
https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Step3_Introduction_to_the_UART
Some tips on debugging serial comms:
2025-02-14 2:18 AM
Hello @Andrew Neil
Thanks for the links and suggestions! I’m having a look at them now and will explore the resources provided. I’ll keep you updated on my progress.
Best regards,
Mahdouch
2025-02-24 2:43 AM - edited 2025-02-24 2:55 AM
Welcome back!
I carefully read those links and tried everything, but I still can't get it to work. I understand that the ST-Link doesn’t care which UART is used—it just transmits and receives data. I even tested a basic UART transmission, like printing 'Hello World,' but it didn’t show up on PuTTY.
Interestingly, when I used the B-U585I-IOT02A, I was able to see real-time accelerometer data in PuTTY, but with my main board, the STEVAL-STWINBX1, nothing appears. I’ve done everything possible, but I can’t figure out what’s wrong.
here is the stlink that i use to debug with stwinbx1
STLINK-V3MINI - STLINK-V3 compact in-circuit debugger and programmer for STM32 - STMicroelectronics
2025-02-24 3:03 AM
@Mahdouch wrote:when I used the B-U585I-IOT02A, I was able to see real-time accelerometer data in PuTTY, but with my main board, the STEVAL-STWINBX1, nothing appears.
So look carefully at the differences between those 2 boards, and your setups using those boards.
In particular:
2025-02-24 3:14 AM
> Interestingly, when I used the B-U585I-IOT02A, I was able to see real-time accelerometer data in PuTTY, but with my main board, the STEVAL-STWINBX1, nothing appears. I’ve done everything possible, but I can’t figure out what’s wrong.
I think I can tell you what's wrong.
> here is the stlink that i use to debug with stwinbx1
> STLINK-V3MINI - STLINK-V3 compact in-circuit debugger and programmer for STM32 - STMicroelectronics
The former board has an onboard ST-Link.
The latter one, which you have problems with, is a separate board.
Check the schematics of the B-U585I-IOT02A board - you will find UART pins of the target MCU are wired to respective UART pins on the onboard ST-Link.
If you have a separate ST-Link, you need to do the wiring yourself. Or can attach a serial-USB converter directly to the target (without the ST-Link).
2025-02-25 10:04 AM - edited 2025-02-25 10:18 AM
@Ozone @Andrew Neil , first of all thank you all for your help
but the last step " If you have a separate ST-Link, you need to do the wiring yourself. Or can attach a serial-USB converter directly to the target (without the ST-Link). "
i didn't understand it since my St-link v3mini is connected to my stwinbx1 board via this cable directly (image below) and then from St-link V3mini to my pc via USB-b, that's it.
14-pin STDC14 Cortex Ribbon Cable - 50 mil pitch | Tag-Connect
if there is something else I'm missing ?
2025-02-25 10:29 AM
@Mahdouch wrote:my St-link v3mini is connected to my stwinbx1 board via this cable directly
Are you sure that cable (and the place where you connect it) carries a UART connection?
Could be just SWD ... ?
2025-02-25 11:20 AM - edited 2025-02-25 11:21 AM
At this point i don't really know but the main board itself (Steval-stwbxcs1a) carries UART connection and for the ST-link v3mini also "images below"
i think this could be the issue yet i don't really know how to solve it
2025-02-25 10:57 PM
> i didn't understand it since my St-link v3mini is connected to my stwinbx1 board via this cable directly (image below) and then from St-link V3mini to my pc via USB-b, that's it.
This cable provides the debug connection.
You would need to check the documentation of the adapter and the schematics of your board to see if this connection provides the serial connection required.
Here the respective parts of the schematics from another STM32 baord, with onboard ST-Link.
And in the detailed schematics:
ST-Link ...
... and the MCU.
The board this example is from is the F746 Nucleo I had at hand.
As you can see, the serial connection between onboard ST-Link and target MCU exists on board level.
With your board, this is obviously not the case.
Since I don't have either of your boards (STWINBX1 or ST-Link V3MINI), you would need to check yourself.