cancel
Showing results for 
Search instead for 
Did you mean: 

I want to upload the led blinking code through the ftdi module.

mohite25
Associate

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?

16 REPLIES 16

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?

 

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?

 

SofLit
ST Employee

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:

SofLit_0-1737978853880.png

And you cannot use other pins.

Hope that helps.

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
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/support.

@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:

  1. The SWD connection - used for programming and debugging;
  2. A separate UART connection.

So using the ST-Link for programming (downloading) does not preclude using the UART for comms.

AndrewNeil_1-1737979624124.png

 

PS:

Or, if you want to disconnect that UART from the ST-Link, you can do that and still retain the SWD programming connection.

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:

  1. Press the reset button on the STM32 board.
  2. Open STM32CubeProgrammer, select UART mode, and choose the correct COM port and baud rate settings.
  3. 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!


@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?

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?).

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
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/support.

mohite25_0-1737981884582.png

I am encountering the above error, and for clarity, my goal is to flash the firmware using the UART bootloader.


@mohite25 wrote:

mohite25_0-1737981884582.png

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?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
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/support.