This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UARTStdio with multiple UART ports ?

Hi all,

I need to use 2 UART ports of the TM4C123 with the buffering functionality provided by UARTStdio. However UARTStdio is designed to work with a single UART port. The solution I see is to duplicate all the necessary functions and variables in UARTStdio.[ch], or even the whole files to something like UARTStdio2.[ch]
, however I was wondering if anyone has come up with a more elegant and less time consuming solution.

Note that I would prefer not to modify the original UARTStdio functions to the point that it breaks compatibility with existing application that are already using them.

Any suggestions appreciated,

Giannis

  • Hello Giannis,

    As the name suggests, UARTStdio was designed to mimic standard C Printf functionality using UART to print to a console. That is the reason why it supports only one UART. Also when communicating with other devices over UART, it is more efficient to write own code based on the functionality, as most of the functions provided are not required for a typical embedded application.

    Why do you need two UARTs to use UARTStdio? Is the second UART also acting as a Console?

    Thanks,
    Sai
  • Hi,

    I have exactly your situation. I'm developing one UART for console / logging purpose and an other UART for communication with a device. I like the tivaware uartstdio library as it has all the software components that I need (primarily buffered mode, additional FIFO).

    I just spent 1 hour today to configure UART5 for TM4C129 by duplicating standard uartstdio functions and tested it out. (Works ATM). I need to integrate and test UART0/JTAG and UART5 together tomorrow (Hope it works). But, as far as I understand this problem, if we want the functionality of uartstdio on an other UART channel, there is no other option but to rewrite or duplicate uartstdio.

    Nevertheless, I'll follow this thread if anyone has elegant solution to this problem.

  • I do not need the full functionality of UARTStdio, mostly the buffering, especially in the receiving direction. Off course I could make my own implementation, but I would like to have a single UART module and not have to switch between my own version and UARTstdio.

  • Perhaps a simple addition of a 'ui32Base' parameter to UARTprintf, which must be passed to UARTvprintf, which itself must be passed to UARTwrite, which *finally* passes to UARTPrimeTransmit... Should be a simple undertaking?