Emulation in Windows. Work with UART (Windows)

Hi!
Sorry for question. Anyone have work examples for work with com-port on windows in freertos emulation in windows?

You won’t be able to access the com port directly reliably from a FreeRTOS task (each FreeRTOS task runs in its own Windows thread) because it requires Windows calls that could block the Windows thread running the task. The FreeRTOS scheduler won’t know the thread got blocked by something outside its control, so won’t schedule another task, and so the system will most likely crash. Most likely you would be able to access it indirectly by sending UART output to a circular buffer, then have a windows thread (not a FreeRTOS task) read from the buffer and perform the actual IO. This is how logging to the console works in the Windows port (at least how the TCP/IP stack logs to the console).

1 Like

These demos show how to talk to a Cellular modem on a COM port in Windows simulator. This file implements the COM port specific part.

1 Like