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).