I want to upload the led blinking code through the ftdi module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 03:36 AM - last edited on ‎2025-01-27 05:05 AM by SofLit
Hi, I am using the STM32 NUCLEO-F401RE board and have already use the HAL APIs to blink the led. now I want to blink the onboard user led [LD2] using the FTDI module and want to use the USART6 for it can anyone please help and explain me in detail that how I will be doing this?
Solved! Go to Solution.
- Labels:
-
Bootloader
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-03 10:09 PM - edited ‎2025-02-03 10:21 PM
USART1_stmconnection
USART1_FTDIconnection
power supply
Connecting to the UART Bootloader on STM32
After much trial and error, I successfully connected to the UART bootloader on the STM32. Below are the steps I followed:
- Connect the USART1_RX pin of the STM32 to the TX pin of the FTDI module.
- Connect the USART1_TX pin of the STM32 to the RX pin of the FTDI module.
- Ensure a common ground between the STM32 and the FTDI module.
- Set the BOOT0 pin high to enter boot mode by connecting it to the VDD pin (do not use any other pin).
- Power the STM32 via USB by connecting it to your host, and also power the FTDI module via USB by connecting it to your host.
- Open Device Manager and locate the FTDI module’s port (not the STM32 port). Select that port in STM32CubeProgrammer, set the baud rate to 115200, parity to even, and tap on connect. It should connect successfully.
Q1: Why was I experiencing errors and unable to connect my UART Bootloader?
Answer: Initially, I was powering the FTDI module using the STM32 by connecting the VCC of the FTDI to the VCC of the STM32. While this can work if your power output is adequate, to avoid the issues I faced, I recommend powering the FTDI module directly from the host. Ensure you have a common ground between the STM32 and the FTDI module.
I hope this helps the community! and special thanks to the @Andrew Neil and @SofLit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 03:42 AM
Welcome to the forum
I'm not entiorely clear what you're actually asking:
- Your title suggests that you want to upload code via a UART;
- But the post sounds more like you just want to control the blinking via a UART?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 03:48 AM
Yes, my main task is that I want to upload the firmware via uart because stlink is connected to the uart2. and I want to use the other uart. that's why inquiring about how I can upload the code via another uart and bipass the st-link?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 03:54 AM
Hello @mohite25 and welcome to the community,
Need to refer first to the AN2606 / Section 31 STM32F401xD(E) devices:
These are the USARTs and theirs respective pins that you can use with the bootloader for this product:
And you cannot use other pins.
Hope that helps.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 04:07 AM - edited ‎2025-01-27 04:17 AM
@mohite25 wrote:I want to upload the firmware via uart because stlink is connected to the uart2.
That doesn't really make sense.
The ST-Link has two connections to the Target microcontroller:
- The SWD connection - used for programming and debugging;
- A separate UART connection.
So using the ST-Link for programming (downloading) does not preclude using the UART for comms.
PS:
Or, if you want to disconnect that UART from the ST-Link, you can do that and still retain the SWD programming connection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 04:27 AM
Thank you, @SofLit, for taking the time to answer my question! I really appreciate your help.
Based on the guidance in AN260, I have followed the necessary steps to use USART1 for communication. Here’s what I have done so far:
- I connected UART1_TX of the STM32 to the RX pin of the FTDI module and UART1_RX to the TX pin of the FTDI module.
- The VDD pin of the STM32 is connected to the FTDI module to ensure proper power supply.
- A common ground is established between the Nucleo board and the FTDI module.
- To enter boot mode, I set the BOOT0 pin to HIGH by connecting it to the E5V pin using a jumper cable.
After making these connections, I connect the FTDI module to my laptop and follow these steps:
- Press the reset button on the STM32 board.
- Open STM32CubeProgrammer, select UART mode, and choose the correct COM port and baud rate settings.
- Click the Connect button.
However, despite following these steps, I am still encountering an error. Could you please help me troubleshoot this issue? Any suggestions would be greatly appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 04:42 AM - edited ‎2025-01-27 04:47 AM
@mohite25 wrote:However, despite following these steps, I am still encountering an error. Could you please help me troubleshoot this issue?
For a start, you'd need to say what error, exactly, you are encountering.
Please post a screenshot showing the error(s) and/or copy & paste the error text.
For pasting error text, see: https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/725146/highlight/true#M54
Also show your connections between the Nucleo board and the FTDI UART-to-USB converter.
I'm still unclear why you want to go through all the hassle of using a UART when you have a perfectly good ST-Link which will do it far more conveniently via the SWD connection?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 04:43 AM - edited ‎2025-01-27 04:45 AM
Which USART1 Tx/Rx pins you have used? PA9 and PA10?
Also check your connections and check your FTDI module (Are you sure your FTDI is normally working either on Tx or on Rx?).
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 04:47 AM
I am encountering the above error, and for clarity, my goal is to flash the firmware using the UART bootloader.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 04:50 AM
@mohite25 wrote:
I am encountering the above error, and for clarity, my goal is to flash the firmware using the UART bootloader.
Are you sure the FTDI is on COM12?
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
