MCP2221A and STM32

Thread Starter

chandimajaya85

Joined Sep 27, 2023
25
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?
 

geekoftheweek

Joined Oct 6, 2013
1,266
Will it work if you restart the application?

I don't use Windows myself, but what it sounds like is something similar to a stale file handle. The application sees it as a valid handle (or whatever term is best here), but the system has detached it from the port. If it works when you restart the application you'll probably have to find a way to get a wake up notification from the system in your application and sync everything then.

Are your USB ports powered when the laptop goes to sleep? If not it will re-enumerate the USB ports when it wakes up and there is no guarantee the MCP2221 will be registered the same in the kernel as it was before

I really don't know and these are just my best guesses.
 
Top