Go Down

Topic: max. UART speed possible? (Read 129 times) previous topic - next topic


I tried to test - what is the maximum UART baudrate I can use?

Never mind the fact that it looks like the Portenta can send a short string also with 4915200 as baud rate, the question is:

How fast can CM7 receive UART characters (strings) and echo it?

I would need the fastest UART speed in order to let run Python scripts on host PC, sending commands,
as fast as possible, w/o to lose any character (not from an interactive typing user).

But, as 'usual', I see (again) - there is not any flow control on USB VCP (UART).
And the buffer size for Serial Rx is unknown (and looks pretty small).

It fails even with a baud rate 115200 set:
- the Portenta CM7 cannot keep up with constantly sent characters from host (from file or script)
- there is not a flow control on USB VCP UART (a well known issue, OK, but it could be solved
   via large buffers, fast processing, INT or DMA based UART device ...)
- the internal UART Rx buffer seems to be very small (it looks like I get just the last 80 characters
   sent, all before is lost, including garbage seen at the end)
- If I see the garbage which I get on terminal - I assume there is also an issue with the buffer management:
  it seems to forward older characters, when an 'overflow' happened on the UART Rx buffer
  (buffer management does not handle overruns and provides garbage in such a case)

How to use the Portenta Serial, UART (via USB-C), with a baud rate as (at least) 1,843,200 without
to lose any character, able to send large files or strings (from a script)?

How to set the Rx buffer size?
Is Serial (UART) Interrupt or DMA based? (or even running in polling mode? hopefully not)
Is the Serial (UART) tested for cases where RX could overrun buffer?

If I use TeraTerm as UART terminal - it does not matter what I configure as baud rate.
So, it tells me: the Portenta USB VCP driver does not act on host requests to set a baud rate.
Instead, the baud rate is just defined and hard-coded in the CM7 setup code.
(not really the intended way to do: Portenta should act on USB requests and set requested baud rate
defined by the UART terminal program, a quite simple USB request processed in the driver).

What is the maximum UART speed for automatically sent UART strings (not from a user typing, from
a script running or sending a file via UART)?
What is the maximum RX buffer size?
How to extend this RX buffer size?

Right now, I guess, my intention to send (longer or several) UART command strings from a script or file, is not really possible.

Go Up