cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753: Can't receive the data the controller is sending

jhi
Senior

I'm using the UART (USART5) with RS485 and I have enabled the read to be on also when sending. I need to read back the data that was sent to see if it is correct. The problem is, that I do not receive what was sent. But if I send the same data from other device (without changing any code), I will receive the data. So the receive works, but not the same time with sending.

Initialization - FIFO is also enabled.

 

BaudRate = PARALLEL_BAUD_RATE;
DataWidth = LL_USART_DATAWIDTH_8B;
Parity = LL_USART_PARITY_NONE;
StopBits = LL_USART_STOPBITS_1;
HardwareFlowControl = LL_USART_HWCONTROL_NONE;
OverSampling = LL_USART_OVERSAMPLING_16;
PrescalerValue = LL_USART_PRESCALER_DIV1;
TransferDirection = LL_USART_DIRECTION_TX_RX;

 

And data sending is done with LL_USART_TransmitData8. The half-duplex is not enabled.

What could block the receive when sending?

38 REPLIES 38

Sorry that it took so long to respond, but I was on vacation.

So I still have the same problem(s). Here are the screenshots of logic analyzer and from the configuration registers. Have you yourself tried if this works on your controller, or did you just assume that it "should" work? The same goes to my other question.

Sorry for replying so late, I was on vacation. I posted images from the logic analyzer and configuration (see reply to TDK post). For the experience - I have been doing embedded HW/SW over 20 years and this is the first controller I have problem with to receive what I send.

I could only add 3 files to my post, so here are the ISR flags.

I can confirm that USART works on the STM32H7 chips, if that's what you're asking. If you post the full code, it's likely someone can spot the bug. I don't see any issues in the snippets you've provided.

If you feel a post has answered your question, please click "Accept as Solution".

Yes, I know that UART works. As I said I can receive data, if it is sent from another device (also STM32H7). But I can't understand why I do not get the data if the MCU itself is sending it and it is echoed back by the RS485 driver chip. What I'm asking is If you have tried to read back what you send (not in loopback mode).

Yes, connecting TX to RX I can read back what I sent.

The chip doesn't know where the signal is coming from.

If you feel a post has answered your question, please click "Accept as Solution".

Could you post your code, so that I can test it with my board?

Pavel A.
Evangelist III

UART RX can be blocked because of receiver overrun flag set. Make sure to check and clear it (and other errors).

The UART5 - ISR.png shows all the flags after running awhile, and there are no errors coming.

Pavel A.
Evangelist III

So you keep the UART registers open in the debugger view. mmm...