- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a PSoC5LP device with a USBFS module in the fabric. The USB is connected to a Renesas USB 3.0 hub which is not connected to a computer.
When the PSoC starts, USBFS_Start function is called to initialize the core. However, it seems that this line inside the generated USBFS_Start function causes the hub to reset the 5V on the device causing a system reset.
(line 634 in USBFS.c)
/* Enable D+ pull-up and keep USB control on IO. */ | |
USBFS_USBIO_CR1_REG = USBFS_USBIO_CR1_USBPUEN; |
The interesting part is sometime it seems to work without resetting when the hub is unplugged from a computer.
When the hub is connected to a computer, it does not reset. The program executes just fine.
We had a previous generation of products based on microchip using the same hub and never experienced this problem.
Is this problem speaking to someone who experienced it in the past? Or maybe someone more experienced than me in USB can help me understand the reason behind this power reset.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The line USBFS_USBIO_CR1_REG = USBFS_USBIO_CR1_USBPUEN enables the second bit of the USBFS Control Register.
This bit controls the connection of the internal 1.5 k pull up resistor on the D+ pin. 0- No effect. 1- Apply internal USB pull-up resistor to D+ pad.
From you description of the issue I understand that when the HUB is not connected to the Computer there is no reset ("The interesting part is sometime it seems to work without resetting when the hub is unplugged from a computer"). When the HUB is connected to the computer there is a reset. Please let me know if my understanding of the issue is not correct.
PSoC 5LP supports USB 2.0 Full Speed, and will reset whenever a reset condition is detected (Condition that occurs when D+ and D- are both driven low, and this lasts for 10ms).
So it seems that the host drives the USB lines low causing the reset to occur. It is normal for the Host to reset the USB device as a part of the enumeration.
Could you please clarify exactly when the reset occurs? This will help me to understand where things are going wrong.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The line USBFS_USBIO_CR1_REG = USBFS_USBIO_CR1_USBPUEN enables the second bit of the USBFS Control Register.
This bit controls the connection of the internal 1.5 k pull up resistor on the D+ pin. 0- No effect. 1- Apply internal USB pull-up resistor to D+ pad.
From you description of the issue I understand that when the HUB is not connected to the Computer there is no reset ("The interesting part is sometime it seems to work without resetting when the hub is unplugged from a computer"). When the HUB is connected to the computer there is a reset. Please let me know if my understanding of the issue is not correct.
PSoC 5LP supports USB 2.0 Full Speed, and will reset whenever a reset condition is detected (Condition that occurs when D+ and D- are both driven low, and this lasts for 10ms).
So it seems that the host drives the USB lines low causing the reset to occur. It is normal for the Host to reset the USB device as a part of the enumeration.
Could you please clarify exactly when the reset occurs? This will help me to understand where things are going wrong.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re reading myself, I completely inverted the scenarios. It should be: it resets when it is unplugged and when usb is connected it starts correctly.
Unplugging the cypress usb from the hub prevents the reset and if I connect it and add external pull ups on the data line, it seems to prevent the reset, but disable usb communication for obvious reasons.
So it's seems your theory is right. Basically the system starts, After the bootloader exits the main program loads. In the main program, the USBFS_Start function is called and then the system resets at the line mentioned in the original post and we go back to the bootloader.
Now knowing this and that there is no way for me to access the VBus on the hub to detect usb connection before starting the usb module. Is there something I can do firmware side to fix this?