Using UART4 to stre...
 
Notifications
Clear all

Using UART4 to stream data to a Rpi4

2 Posts
2 Users
0 Reactions
14 Views
(@anateresafalcao)
New Member
Joined: 1 month ago
Posts: 1
Topic starter   [#1182]

Hello,

I saw in a previous post that the current firmware only supports MFAM streaming via Ethernet, and that UART5 isn't supported. I'm modifying the Dev Kit firmware to add TX output on UART4 instead, by adding a parallel Mailbox_post in spiTaskFxns.c to a new UART4 TX task/mailbox, at 460800 bps.

Before going further, I wanted to ask:

  1. Is there any hardware-level reason UART4 wouldn't work here, beyond it just not being implemented in the stock firmware?
  2. Does the existing SPI→Ethernet pipeline assume a single consumer, in a way that could cause timing issues if I add a second parallel mailbox post for UART4?
  3. Has anyone tried UART-based streaming from the Dev Kit before, and if so, any known pitfalls?

Thanks in advance!



   
Quote
(@easswar)
Member Moderator
Joined: 3 years ago
Posts: 1
 

Hey

There is no hardware limitation to use UART4 or UART5 for your application. The previous post you read was talking about UART not being implemented in the example code and not specifically about UART5.

The existing pipeline does assume a single consumer and you will run into race conditions if you only implement a mailbox_pend for your UART transmission. I would recommend that you either remove the TCP mailbox or create a new mailbox for UART.

We have tried UART streaming before without issue.

Transmitting the raw binary data will cause issues with some receiver implementations as the values 0x00(NULL char in ASCII), 0x0A or 0x0D which usually denote the end of a serial transmission occur regularly in the MFAM data.

Two options to avoid this issue:
1. Convert the fields you are interested in to ASCII before sending them over UART.
2. Send a fixed number of bytes and implement binary mode on your receiver and request the same number of bytes.

One other issue to watch out for in binary mode is if the receiver starts receiving data in the middle of a transmission the transmitter and receiver will be out of sync. There are two handshake signal lines available on the UART4 port on the DevKit called RTS and CTS(Request to Send and Clear to Send). You can use these lines to synchronize the transmitter and receiver. There are software options available as well to implement this synchronization.

Hope this helps.



   
ReplyQuote
Share: