Skip to main content
Associate III
March 11, 2026
Question

uart data mismatch

  • March 11, 2026
  • 3 replies
  • 510 views

I am using stm32f407 and stm32wb series for sending the data usimg uart.
first i send th data using the stm32wb uart to the stm32f407 uart the data is correctly sent.

After receiving the data i will return the data back to the stm32wb from the stm32f407 but this time the data is corrupted.

I am using the hal_uart_receiveto_idle and hal_uart_transmit_it to send and receive the data. 

I will share the code please review and tell me if i need to make any changes.

3 replies

Technical Moderator
March 11, 2026

Hello @TejasK 

Did you connect the GND between the two board?

"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.Saket_Om"
TejasKAuthor
Associate III
March 11, 2026

Yes @Saket_Om  i have checked the connections one more time gnd is connected between the 2 boards. then what may be the other issue.

 

Andrew Neil
Super User
March 11, 2026

You haven't told us what board(s) you are using.

Please see: How to write your question to maximize your chances to find a solution

 


@TejasK wrote:

After receiving the data i will return the data back to the stm32wb from the stm32f407 but this time the data is corrupted.


How, exactly, is it "corrupted" ?

Have you used an oscilloscope and/or logic analyser to see what's happening on the wires?

Have you tested & verified the stm32wb and stm32f407 separately?

 

Tips on debugging serial comms.

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.
TDK
Super User
March 11, 2026
> HAL_UART_MspDeInit(&huart1);
> HAL_UART_MspInit(&huart1);

Don't call these while a transfer is in progress.

"If you feel a post has answered your question, please click ""Accept as Solution""."
TejasKAuthor
Associate III
March 12, 2026

I have removed these in the code.

Andrew Neil
Super User
March 12, 2026

And what was the result?

 

You still haven't answered:

  1. what board(s) are you using ?
  2. How, exactly, is it "corrupted" ?
  3. Have you used an oscilloscope and/or logic analyser to see what's happening on the wires?
  4. Have you tested & verified the stm32wb and stm32f407 separately?

 

Please see: How to write your question to maximize your chances to find a solution - the better the information you supply, the more likely you are to get a good & quick solution

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.