-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB_CompositeDevice_MSC_CDC example on MAX32666FTHR will not enumerate after USB disconnect/reconnect #722
Comments
Hi @khpeterson, our MAXUSB expert recently transitioned to a different team. I've reached out to see if they are still available for some guidance. In the meantime... I have limited experience with USB but conceptually I think you've illustrated the issue very well. So apologies if my follow-up questions are off-base... Starting with the basics... I wonder if differential pair is being grounded after the first disconnect? I think the idea that the host is never seeing the re-connect is worth investigating. AFAIK the host detects the presence and speed class of the device based on a pull-up on DM or DP, but I don't see a pull-up on either the FTHR or EVKIT. So perhaps the POR state manages the signal levels correctly, but something about the disconnect logic is grounding them and preventing the reconnect from being detected. Can you probe the DM/DP pins after the second reconnect? This is a really hacky potential workaround, but you could try issuing a system reset on the VBUS disconnect event. The micro's state should be almost identical to a POR. It's definitely ugly, but might make an interesting data point at least... |
Thank you @Jake-Carter, I don't have a way to probe DM/DP until next week (and will do then) but FYI, your workaround suggestion to issue a full system reset on VBUS disconnect does do the right thing and enumeration completes successfully. |
Hi @khpeterson, |
@Jake-Carter - I probed DP and DM (on U2 pins 4 and 3) on the first and second VBUS connects... I see the pull-up action on DP (DM stays low) on the first VBUS connect but nothing triggers on the second VBUS connect. Here's what I see on DP the first connect: @sanjayjaroli - I probed VDDB on one side of C27 and here's what that looks like when VBUS is disconnected - I hope the timescale is long enough to be useful to you. |
Thanks @khpeterson, we're looking at the VDDB behavior on the FTHR a little deeper. It's a little suspicious that it doesn't drop to 0 on disconnect. |
I know this app was written for the EvKit and not the FTHR but I am trying to integrate this functionality into a FTHR based application. Running the app on the EvKit works fine - it will enumerate each time USB on CN2 is connected to a host:
However, because VBUS on CN1 is providing power to the EvKit, the VBUS Disconnect event is never generated.
On a MAX32666FTHR powered with a LiPo battery, disconnecting produces VBUS Disconnect as expected but the Suspend, Bus Reset (and Done) events do not follow VBUS Connect as they do after power on:
I instrumented the usb.c driver to save the first 8 sets of interrupt flags handled by MXC_USB_IrqHandler():
After the normal startup sequence that history looks like:
Resetting the history idx after the VBUS Disconnect and tracing the re-connection shows:
I have tried forcing a shutdown/softreset/re-init when handling the VBUS Disconnect event:
to mimic POR conditions but no go - the RESET interrupt never triggers after the second VBUS Connect. I have not confirmed that the host is initiating the second RESET but FWIW, I do see the same behavior on macOS 12.6.8 and win10.
I will keep digging but any suggestions from a MAXUSB expert would be greatly appreciated. It would be helpful if this example app showed the necessary steps to disconnect and reconnect USB when powered by something other than USB.
The text was updated successfully, but these errors were encountered: