cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 UART RX + DMA, does not work if the RX is in inverse mode.

AlexPi
Associate II

If I don't enable RX line inversion, everything works fine. But when I enable inversion, I constantly get frame errors. The DMA operates in cyclic mode, without interruption. It's just like a ring buffer. In normal mode, everything works without problems. The signal source itself was tested on another device with a purely hardware signal inverter, and everything was fine. It's unclear why enabling inversion causes the problem. Perhaps someone can give me a hint as to what might be causing this? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
AlexPi
Associate II

The problem is basically solved.
Packets are received without problems. But there is one thing that is not clear. In direct mode, the UART is set to 8N2 and everything works, but in inverse mode it started working at 8E1. It seems that the hardware invert introduced some distortions.

View solution in original post

6 REPLIES 6
TDK
Super User

If it works in non inverted mode then the signal is not inverted. Getting frame errors would be expected.

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

Let me clarify the problem.
I have an STM32H743 processor, and I configure UART8 to receive in direct mode, without inversion, plus DMA.
A device whose serial port operates in inverse mode is connected to the RX line, but not directly, via a hardware inverter. Everything works fine.
Then, I connect this same device directly and set the RX line to inverse mode in the processor settings (STM32H743). However, the processor constantly returns a frame error instead of data.

Please help. Has anyone used the serial port in line inversion mode and knows the nuances of this operation?

> I have an STM32H743 processor, and I configure UART8 to receive in direct mode, without inversion, plus DMA.
A device whose serial port operates in inverse mode is connected to the RX line, but not directly, via a hardware inverter. Everything works fine.

Again, if it receives correctly in normal mode, all indications suggest the incoming data is not inverted.

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

What does "inversion" mean - swapping RX and TX pins or high/low active signal?

Try to test without DMA (in polled or interrupt mode). Will the problem still reproduce?

A device whose serial port operates in inverse mode is connected to the RX line, but not directly, via a hardware inverter. Everything works fine.

Is the RX pin on the STM32 side pulled up or down? Check the signal voltage relative to the STM32 ground in both cases.

 

 

> set the RX line to inverse mode in the processor settings

This is ambiguous, there is no "inverse mode" setting.

There is "RX Pin Active Level Inversion" and "Data Inversion". Both need selected if the channel has been inverted.

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

The problem is basically solved.
Packets are received without problems. But there is one thing that is not clear. In direct mode, the UART is set to 8N2 and everything works, but in inverse mode it started working at 8E1. It seems that the hardware invert introduced some distortions.