Skip to main content
Visitor II
May 23, 2024
Question

COM port drop out

  • May 23, 2024
  • 2 replies
  • 747 views

I have a written C# windows application that receive data continuously from MCP2221A. MCP2221A receive data from STM32 UART through receive data line. When the laptop goes for sleep (in battery mode), it send a suspend signal (it will go low) to the MCP2221A. And MCP2221A will goes for sleep. When the laptop wakes up, MCP2221A will wake up start to receive data and transmit. But since the wake up COM port is drop down on the C# windows application. And the windows application does not show data even though MCP2221A sending a data. I don't know what's going on there?

    This topic has been closed for replies.

    2 replies

    Graduate II
    May 23, 2024

    Do you close the COM port when Windows tells you it's about to shutdown?

    I can't speak to ST's VCP/CDC and driver robustness in this regard. Or Microchips'

    Unless you're in a position to work on those, I might suggest looking at how well a SiLabs USB-to-CMOS Serial works in the same scenario.

    On the STM32 side, you'd probably want to look at the UART to see if any noise or framing errors are stuck and need to be cleared.

    Super User
    May 23, 2024

    @cjaya.2 When your PC is about to sleep and after it resumes from sleep, Windows will send a notification to your app. Just handle these notifications correctly (close and reopen the COM port) and enjoy. Ask your favorite AI for example code or visit the Microsoft's .NET forums.