I am working with c8051f340 mcu on usb device project. when I am debugging my device using si labs ide(adapter) sometimes I had removed my usb in middle or after running program and when plugging it in it shows "the device is malfunctioned" I had realised that the reboot is not happening correctly due to the program is running from middle way when usb plugged in...so, descriptor transfers are not happening. I tried to use vbus interrupt ISR for restarting device...but it is not going well
I want my device to reboot and enumerate again whenever usb plug out and plug in...even when it is debugging. can anyone help me what to do,please
I think the software running on your device needs a way to know that the USB has been disconnected and issues a USB reset to restart the USB enumeration process once the USB reconnects. The USB_HID blinky example in the 8-bit SDK covers a lot of the USB_API, and it might be helpful in this case. The example is located in CUSTOM_DIR\Examples\C8051F34x\USB_HID\Firmware\BlinkyExample
The CUSTOM_DIR is where the 8bit SDK is located on your device. The USB0_Main and USB0_InterruptServiceRoutine would be the source files to focus on.
Sometimes when I am plug in usb it is enumerating and device is identifying correctly every time Iam plugging in and out but sometimes at first it is identifying as usb and after two to three times it is not responding ... and showing device descriptor failed..If there is any problem it should not be identified at first time itself , why is it happening.
can any one give solution for this please