cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H563ZIT6 cannot receive RS485 at high baud rates (e.g. 12 Mbaud)

MES98
Associate III

TX works but RX interrupt not triggered

 

Hello,

I am currently using a custom board based on STM32H563ZIT6. My goal is to establish communication over RS485 between the STM32 and a PC (using Hterm). The system is designed to receive a command and send a response.


Communication Details:

  • Interface: RS485 (half-duplex)
  • PC Tool: Hterm
  • Converter: USB COM 485 PLUS 4
  • Packet size: Very small (typically 4 bytes)
  • Transmission interval: ≥ 300 ms

Current Situation:

  • Communication works perfectly between 115200 and 2,000,000 baud
  • I am trying to increase the baud rate up to 12 Mbaud

Problem:

At 12 Mbaud:

  • STM32 → PC communication works correctly
    (I can see transmitted data on Hterm)
  • PC → STM32 communication does NOT work
    • STM32 does not receive any data
    • RX interrupt is not triggered at all
    • It behaves as if no data is arriving

Additional Notes:

  • I have checked the termination resistor, and it seems correct
  • The data sent from PC is valid (verified from Hterm)
  • UART baud rate is configured up to 12.5 Mbaud in CubeMX
  • The issue only appears at very high baud rates

What I Suspect:

  • Possible limitation of RS485 converter at high baud rates
  • UART sampling/timing issues at 12 Mbaud
  • Interrupt-based reception may not be sufficient at such speeds
  • Hardware limitations (signal integrity, cable, etc.)

Questions:

  1. Is it realistic to achieve 12 Mbaud over RS485 in this setup?
  2. Could this be a limitation of the USB-RS485 converter?
  3. Are there any specific STM32 UART settings required for such high speeds?
  4. Should DMA be used instead of interrupt for reliable reception?
  5. Are there known limitations for STM32H5 series UART at these speeds?

Any insights or similar experiences would be very helpful.

Thanks in advance!

41 REPLIES 41

Yes, I checked the signals with an oscilloscope, including at the STM32 RX pin, and everything looks fine.

Also, communication works without any issues up to 2 Mbaud.


@MES98 wrote:

I also verified with an oscilloscope that the data is physically coming out of the converter, so the signal is present on the line.


and is it in good condition: clean edges, valid timing, no noise, correct levels, etc, etc ... ?

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.
Andrew Neil
Super User

@MES98 wrote:
  • Communication works perfectly between 115200 and 2,000,000 baud
  • I am trying to increase the baud rate up to 12 Mbaud


Use the scope to see what's different (apart from just bit timing) between 2M and 12M baud.

Have you tried to narrow down where the failure actually starts between 2M and 12M ?

eg, try 7M - ie, halfway between 2 & 12

  • If that works, try 9.5M - ie, halfway between 7 & 12
  • If that fails, try 4.5M - ie, halfway between 2 & 7

etc, etc, ...

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.

According to the datasheet, the converter supports up to 12 Mbaud.

Also, when I test the USB COM485 PLUS 4 by looping its own RS485 lines, communication works successfully at 12 Mbaud.

So based on these tests, it seems that the converter itself is capable of handling this baud rate.

MES98
Associate III

Thank you for your suggestion.

I enabled the UART error interrupts, but no error flags are triggered.

I also checked the Windows adapter settings. The latency timer was set to 16 ms by default, and I reduced it to 1 ms, but this did not make any difference.

For clarification, my communication is very light:

  • Packet size: 4 bytes
  • Communication rate: once per second
  • Operation: PC sends a 4-byte command → STM32 sends a 4-byte response

For testing:

  • When STM32 transmits data periodically (once per second), I can see it correctly on Hterm even at 12 Mbaud
  • However, when I send data from Hterm at 12 Mbaud, it seems that STM32 does not receive anything

I also verified with an oscilloscope that the data is physically coming out of the converter, so the signal is present on the line. At this point, it looks like the data reaches the STM32 pin, but it is not being captured or processed by the UART peripheral.


@MES98 wrote:

I also verified with an oscilloscope that the data is physically coming out of the converter, so the signal is present on the line.


Again:

  •  is it in good condition: clean edges, valid timing, no noise, correct levels, etc, etc ... ?
  • Have you tried to narrow down where the failure actually starts between 2M and 12M ?

 

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'm attaching the signal from the converter at 12M baud. With the converter, data is reaching HTerm from the STM32 at 12M, 10M, 8M, and 6M baud rates, but it is not being received on the STM32 side. Communication works properly at 4M, 2M, and lower baud rates.

From what I can see, there is no noticeable noise or signal distortion that would prevent communication or cause data loss. You can also take a look with your scope if you like.

Kalpak
Associate

I see a huge negative going spike at the start of frame, at all baud rates.

Will this cause a problem for start detection?

Can you also check if the probe ground is connected by a very short wire to circuit ground? Not the usual long tail crocodile.

 

> I see a huge negative going spike at the start of frame, at all baud rates.

Basically on every falling edge.
I suppose this is an artifact, because the probe and the way it is attached are not appropriate for RF.

Mind you, a digital (square-wave) signal requires a bandwidth significantly higher than the bps number.


@Kalpak wrote:

I see a huge negative going spike at the start of frame, at all baud rates.

Will this cause a problem for start detection?

Can you also check if the probe ground is connected by a very short wire to circuit ground? Not the usual long tail crocodile.

Exactly.
OP needs this:

7OPgl.jpg

This should reduce ringing from probe ground inductance.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.