If I understood your question correctly, you have connected your USB Device (FX3 / CX3) to a Host with Linux OS.
You want to send a reconnect command from the USB Device to the Host Linux PC. (Please correct me if I understood wrongly).
As per USB Specification, a USB Device is a slave which cannot send a command or data of its own to the host without being asked.
The host has to keep pinging the device asking for a user defined status / data that tells the host that it must disconnect and reconnect. This can be implemented using Vendor Specific Control Request implementation.
Yes I have connected my device on Linux
I'm using the MonoUsbDevice Class with is part of LibUsbDotNet.LudnMonoLibUsb.
I can remap all the commands that I use on windows and everything's going well included streaming with bulk EP Except the Reconnect.
In Windows CyUSB.net, The Reconnect command is part of the CyUsbDevice Class.
My question is : I would like to have the Reconnect available on Linux but it is not included in the MonoUsbDevice.
Is there a way to implement and add it to Linux OS ?
NB : I don't want to initiate a Reconnect from the device, only from the host as I do on Windows with CyUsbDevice.Reconnect().
Some news on that issue ?
I am not sure if the linux libraries you have mentioned have this facility. However if you are able to send a vendor specific command this should be possible.
I am understand that you have a concern against performing the reconnect in the device. But I assure you that it should not be a problem. The host will be able to handle this very well.
- Madhu Sudhan
Thanks for the reply but this answer is not really a solution "But I assure you that it should not be a problem. The host will be able to handle this very well."
I understand the only way to implement the reconnect on Linux is to implement that in the device itself upon vendor specific command AND to send this command from the Host.
On my side:
- I know how to handle a vendor command in the device
- I know how to send a vendor command on the host
- I'm not sure which function to use in order to do the disconnect in the device :
- CyFx3BootUsbConnect() from EZ-USB FX3 API linrary ?
- a full µC reset, in this case how to handle it with the SDK ?
Or CyU3PUsbHostPortReset() ?
1 of 1 people found this helpful
You need to call CyU3PConnectState (CyFalse, CyFalse); and then CyU3PConnectState (CyTrue, CyTrue); (first API is for disconnection, second API is for reconnection.
- Madhu Sudhan
Thanks for the reply.
I'll test that next week with another modification in the usb desc.required for win10 (a solved case from Cypress support).
I'll keep you informed.
Are you looking for a function like "libusb_reset_device()" in libusb library? Following is a URL for the online manual.
I know some operating system issues the "SET CONFIGURATION" request multiple time. So, I think it is worth to connect several kind of operating system as a test.
The CyU3PConnectState (CyFalse, CyFalse) and CyU3PConnectState (CyTrue, CyTrue) are working well.
For interested people what I'm doing is :
1- Set a flag _reconnectRequest in _USBSetupCB() callback upon a specific vendor request
2- Reset this flag in ApplicationStart (upon CY_U3P_USB_EVENT_SETCONF event) and also in ApplicationStop (upon CY_U3P_USB_EVENT_RESET or CY_U3P_USB_EVENT_CONNECT or CY_U3P_USB_EVENT_DISCONNECT event)
3- Check if this flag is set in a low priority parallel thread and do the reconnect request:
_reconnectRequest = 0;