This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simultaneous multiple serial port access

MDK-ARM Development Question:
Using the Keil MDK-ARM Microcontroller Development Kit and the standard C Library, how does one implement access to multiple serial ports (UARTs) simultaneously when using the retargeting scheme of rewriting the lower level I/O functions? I am writing code for an STM32F103ZG which has five UARTs on board, all of which I need to access simultaneously.

It seems like, in the provided example (Blinky project), rewriting the lower level I/O routines (fputc(), fgetc(), etc.) just allows you to retarget to a single serial port.

In your code, when you use a higher level I/O function, such as printf(), there is only one corresponding lower level fgetc() routine to be called. So it would appear that you can only retarget to a single serial port.

I’ve got to believe that folks do this all the time, so what am I missing? Any suggestions on the simplest way to implement access to multiple UARTs would be greatly appreciated.

0