Hi All,
I develop the USB CDC firmware(Modify the sample code from ST) using STR912FAW44 and keil MDK. The Adum 4160 is added to implement the USB isolation. The pull up 1.5K resistor is tied to 3.3V. The firmware works proberly if the USB cable is attached. However, the firmware will hang if the USB cable is detached and power up the device. I use the debug mode and find it always jumps to the suspend state. My schematic for adum4160 is similar to the Figure 7 in the link paper electronix.ru/.../index.php
Can someone have experience with it and how I can get rid of suspend state?
Thank you for your any suggestions.
Best Regards,
Lillian
Hi Tsuneo,
I try the first method you mentioned last post. I comment out the source code when in suspend mode.
void Suspend(void) { u16 wCNTR; fCellSuspended= TRUE; /* suspend preparation */ /* ... */ #if 0 /* macrocell enters suspend mode */ wCNTR = _GetCNTR(); wCNTR |= CNTR_FSUSP; _SetCNTR(wCNTR); /* ------------------ ONLY WITH BUS-POWERED DEVICES ---------------------- */ /* power reduction */ /* ... on connected devices */ /* force low-power mode in the macrocell */ wCNTR = _GetCNTR(); wCNTR |= CNTR_LPMODE; _SetCNTR(wCNTR); /* switch-off the clocks */ /* ... */ #endif }
When the USB cable is disconnected to PC. The firmware doesn't hang anymore. However, when I attach the USB cable back, the firmware goes to resume with RESUME_ESOF state, and PC shows "USB Device Not Recognized".
Could you please help me what else I need to do and fix this issue?
Thanks
Hi Lillian,
I am also facing same problem while dettaching the USB cable. Are you able to solve this issue? If so please explain me about it.
Thank you, P. Nageswara Rao
Hi,
I try the second way which Tsuneo suggests and add the circuit to fix the issue.
Regards,