cancel
Showing results for 
Search instead for 
Did you mean: 

uart data mismatch

TejasK
Associate III

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.

10 REPLIES 10
Saket_Om
ST Employee

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

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

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
> 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".
TejasK
Associate III

I have removed these in the code.

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.

1. I am using the STM32WB55REV6 and STM32F207VCT6.

2. The values received from the gateway side is corrupted.

3. I have seen the values on the watch window.

4. Yes i have tested and verified the boards separately.
i am sharing the projects so rectify me if there any error.


@TejasK wrote:

2. The values received from the gateway side is corrupted.


That doesn't answer the question, "How, exactly, is it 'corrupted'?"

 

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

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.

I have not tested using the oscilloscope or logic analyser. what i noticed is gateway is sending the data correctly but the server is not receiving properly.i will give u the screenshot of the buffer from the gateway and server.