msdk icon indicating copy to clipboard operation
msdk copied to clipboard

MXC_UART_Write - Incomplete Transmission

Open BrentK-ADI opened this issue 2 years ago • 1 comments

This issue is found in RevB UART drivers at a minimum. Other revisions have not been checked.

The MXC_UART_Write function uses the MXC_UART_WriteCharacterRaw function to transmit each character.

  • MXC_UART_WriteCharacterRaw is non-blocking, and will return E_OVERFLOW if the TXFIFO is full
  • MXC_UART_Write exits on any error received from MXC_UART_WriteCharacterRaw
  • As a result, writing buffers larger than the FIFO size will result in an incomplete transmission.

In contrast, MXC_UART_Read is a blocking function, waiting until all requested characters are read.

Consider modifying MXC_UART_Write to use MXC_UART_WriteCharacter instead, which will block until the character is written. Alternately, if keeping the implementation, update the MXC_UART_Write documentation to inform the user of the behavior.

Note: This has an impact on the STDIO capabilities of the Maxim platform in the No-OS framework. Currently print statements in No-OS are truncated when built against this MSDK version. No-OS maxim_uart.c, Line 142

BrentK-ADI avatar Jun 13 '23 16:06 BrentK-ADI

Thanks @BrentK-ADI, sorry for the delay on this ticket.

@sihyung-maxim do you have any bandwidth to pick this up?

Consider modifying MXC_UART_Write to use MXC_UART_WriteCharacter instead

I'm in favor of this to keep our behavior consistent as we discussed in #285, but #283 got merged and hit all RevB parts.

Jake-Carter avatar Jul 13 '23 23:07 Jake-Carter