FX2LP reset | Cypress Semiconductor
I have an issue with a FX2LP USB device not restarting after my linux-libusb based application has been killed with Ctl-c during data transfer.
It seems that the USB bus is going away while power is still applied (My device is using external power supply).
Only powercycling the device by replugging powwer cable helps.
What is the right way to solve this issue?
I implemented a dirty trick in the FX2 firmware that seems to solve the problem:
I implemented a user command (VX_11) that calls all the rutines implemented in TD_Init() (see code bellow).
I then call this user command in the device opening phase (in the libusb driver).
void TD_Init(void) // Called once at startup
void initialize_board(void) // Called once at startup
CPUCS = 0x10; // CLKSPD[1:0]=10, for 48MHz operation
IFCONFIG = 0xE3;
For some reason I don't quite understand, I need to send this user command twice otherwise the bus is still dead.
I am sure there is a better/clean way to solve this issue.
Note: The reset pin of the cypress chip is connected to VCC.
Thanks, malik cisse