2023-02-23 10:57 PM
I am using UART to transmit and receive data. for transmitting I am using polling method function HAL_UART_Transmit(&hart1, buf, 8,1000) and for receiving i am using HAL_UART_Receive_IT(&hart, Rx_buf,8);
receiving is working fine but after transmitting any data the receive callback is getting fired and after that the receiving interrupts are not getting fired even though I am transmitting data from another device.
Solved! Go to Solution.
2023-02-27 10:57 PM
uint8_t RX_Buf[8];
uint8_t i;
uint8_t TX_Buf[8]={1,2,3,4,5,6,7,8};
uint8_t Uart_status;
these are the variables I am using.
Answers to your questions
2023-02-27 10:58 PM
I am using STM32H743BIT6 and i selected STM32H743BI
2023-02-27 11:00 PM
@Guenael Cadier please have a look
2023-02-27 11:40 PM
Sorry @Anwar.786 i'm a bit lost. I'm afraid I don't uderstand your issue.
From my understanding, if data that are sent on Tx are echoed on rx, it is normal in my opinion, that Rx complete callback is triggered in the use case you described :
Please correct me if I'm wrong.
2023-02-27 11:51 PM
@Guenael Cadier
2023-02-28 12:10 AM
So it looks like there's a connection between your Tx and Rx pins on sender side.
If you look at RX pin signal with a logic analyzer, what do you see when you are sending your 8 bytes ?
Either bytes are really echoed by distant part, or it is a hw issue on your sender device.
What happens if you disconnect anything from the sender device ? Is your Rx callback still executed ?
2023-02-28 07:07 AM
So it comes down to how the hardware is connected. Is this a custom board with a STM32H743BIT6? I assume you are using a USB<>Serial adapter to connect to Docklight and if so what is the part # or link to the adapter? A block diagram of your connections would help a lot.
2023-02-28 10:45 PM
@Guenael Cadier Thanks for your help.
I found the issue, as you said the real issue is with the hardware, I am using Uart to RS485 with an auto direction circuit that auto direction circuit is causing an echo of transmitted data in Rx line since Receiver is configured in interrupt mode it is generating the interrupt.