Just want to confirm if the PSoC is switching the app when the COM Port Application has the particular COM Port opened? You have mentioned that you are sending switch app command via CDC. Ideally the COM Port needs to be disconnected i the PC application before actually disconnecting it in hardware?
Can you try opening the COM Port in any other terminal application while the custom application throws the error? Are you able to connect to the COM Port from there?
Yes i close the COM port (if already opened) in my C# application when before switching in another PSOC app. (After switching when i test the serialPort.isOpen() API in C#, it return false.
Yes i have try to open the COM port in realterm and putty after switching and same issue.
But yesterday i have resolved one case of my issue.
This case now works now:
Open CDC port / Send Switching CMD / Close CDC Port / PSOC5 Switching /Re-Open CDC port(PASS).
In this case i have just add the Close port Step, I thought it was not going to have time to close the port before the jump but i fact i have time.
But this second case doesn't works:
Open USB port / Send Switching CMD / Disconnect USB port(Com port never open) / PSOC5 Switching / Open COM port (FAIL!!)
If in the device manager i disable and enable my com port i can open it after.
This issue seems to be a Windows 7 issue, in fact on Windows 10 no issue all case work fine! Windows 10 seems better to handle COM port connection disconnection.
I am convinced now that my issue come from windows application and not Psoc5 firmwware, thank a lot for your support!