• AVR Freaks

Hot!Issues with MSD USB Host and Harmony V1.11

Page: 12 > Showing page 1 of 2
Author
NKurzman
A Guy on the Net
  • Total Posts : 18191
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
2019/11/21 12:32:11 (permalink)
0

Issues with MSD USB Host and Harmony V1.11

I am having some Issues with using USB as and MSD Host on a PIC32MZ2048EFH144 and Harmony 1.11
I am currently Stuck with V1.11 since Harmony is not very Backwards compatible.  But am not sure
 
1. I have a Bunch of cheap logo memory Sticks that do not work on my device.
The Harmony Debug screen shows:
"USB Host Layer: Bus 0 Device Attach detected. Starting Enumeration.Invalid pipe handle"
I plan to try this on the PIC32MZ Starter Kit and Harmony 2.06 and see if it works there.
 
2. Recently many units will randomly not recognize a USB stick. 
A power cycle fixes it.  a soft reboot does to, so I do not think it is ESD.
Has anyone seen this?  The USB code is untouched for years.  I am not sure what would bother it, or how.
I do not see and functions for debugging or getting the Status of the various layers.
Host, MSD, File System.  I need to instrument the code to try and figure out how to zero in on the Issue.
 
Any insight would be appreciated.
 
 
#1

25 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/21 16:32:57 (permalink)
    0
    Well the USB Sticks do not work with V2.06 either.
    #2
    TS9
    Super Member
    • Total Posts : 841
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/21 22:07:51 (permalink)
    5 (1)
    But I have used/worked msd_demo and various USB sticks successfully with V2_06.
    post edited by TS9 - 2019/11/21 22:14:14
    #3
    TS9
    Super Member
    • Total Posts : 841
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/21 22:07:51 (permalink)
    0
    But I have used/worked msd_demo and various USB sticks successfully with V2_06.
    post edited by TS9 - 2019/11/21 22:14:39
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/21 23:50:52 (permalink)
    0
    Most Sticks work fine. These do not.
    I asked my FAE if he wants to see them.
    The second issue is more important. I had hoped they were related.
    #5
    Paul PortSol
    Super Member
    • Total Posts : 553
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 10:29:48 (permalink)
    5 (1)
    a) Heap size? (10000+)
    b) USB 5V cap size and type (150uF 6V Ceramic + parallel 100nF ceramic)
    Paul
    #6
    sborden
    Super Member
    • Total Posts : 1960
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 10:38:29 (permalink)
    5 (1)
    I dealt with this several years ago. I had to tweak the USB drivers with extra timing. There were still some sticks that would not work. Swapping out the PIC and (sometimes) various components in the USB path (ESD, connectors, etc.) solved the issue. We had no choice as, sadly, we could not tell the customer to "get better USB sticks." And we had to operate the USB power lines on the PIC at 5V, not 3.3.
     
     
    #7
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 10:54:15 (permalink)
    0
    Any suggestions  about where to increase the timing?
    This thread is recent:
    https://www.microchip.com/forums/m1119244.aspx
     
    But I do not seem to be getting that far.
    it looks like it maybe getting a disconnect interrupt while connecting (maybe)
    I tried to increase the Peripheral disconnect timing , but that did not change anything.
    I am powering the USB with 5V,  though my cap is only an 100uF electrolytic.  I need to boost it.
     
    This is my first time debugging USB.  Total Phase has a bus Snooper, but it is expensive.
    #8
    Jim Nickerson
    User 452
    • Total Posts : 6430
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 11:18:17 (permalink)
    #9
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 12:00:21 (permalink)
    0
    The Problem is the Beagle USB 12 is 400 USD and only does Low and Full Speed.
    I would need the Beagle USB 480 for High Speed.  And that is 1000 USD.
    That would require capital expense approval.
    #10
    sborden
    Super Member
    • Total Posts : 1960
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 12:23:39 (permalink)
    5 (1)
    Unfortunately, no. I was under a lot of time pressure at the time and didn't... comment... where I modified. It was also four years ago and I don't remember. Being a Harmony thing, the file was embedded who knows where under who knows how many layers of... Harmony Code.
    #11
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/22 12:48:15 (permalink)
    0
    Oh well.
    #12
    Jim Nickerson
    User 452
    • Total Posts : 6430
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/23 07:33:17 (permalink)
    5 (1)
    NKurzman
    The Problem is the Beagle USB 12 is 400 USD and only does Low and Full Speed.
    I would need the Beagle USB 480 for High Speed.  And that is 1000 USD.
    That would require capital expense approval.


    I have used a USB Isolator to force target High speed to lower speed for debugging https://www.microchip.com/forums/FindPost/827629
    #13
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/23 10:06:28 (permalink)
    0
    That sound like a handy hint.
    Thanks.
    #14
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/26 16:06:30 (permalink)
    0
    As I dig Deeper I find 
    USBCSR2 = 0x060000FE  (The Reset Value?)
     
    so Only RESETIE and  RESUMEIE are enabled.  So it can not see the Stick is gone, or when it gets back.
    I assume there is a poorly handed error in the Driver.
    Now to dig through all the Abstractions to find where it is written.
    post edited by NKurzman - 2019/11/26 16:28:49
    #15
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/26 18:15:07 (permalink)
    0
    It looks like all the USBCSRX Registers are at their Reset Values.
    Any Ideas how that would happen?
    The Failure happens during Insertion.
    It will usually show 2 interrupts, then stop with the Registers having reset values.
    It will occasionally fail later one after several insertions.  Usually after sitting a while.
    I do not see any part of the Code that would write this.
    The Driver looks half written with Todo on Deinitialize and Reinitialize. 
    #16
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/11/27 17:27:12 (permalink)
    5 (1)
    Follow Up.  Setting the USBCSRx Registers back to the correct values restores Operation. 
    So I have a hack to fix it.
    I put in a support Ticket with Microchip to see if they can help.
    My F.A.E. never heard of it.  Lucky Me.
    #17
    sborden
    Super Member
    • Total Posts : 1960
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/12/03 13:35:54 (permalink)
    0
    I just posted this in another thread as well: You may need VUSB3.3 connected to 5V, not 3.3V. I had to do that, as is mentioned in Section 55 (IIRC) of the family reference guide to get the USB to work reliably as a host.
     
    Hope that helps.
    #18
    NKurzman
    A Guy on the Net
    • Total Posts : 18191
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Issues with MSD USB Host and Harmony V1.11 2019/12/03 16:34:18 (permalink)
    0
    Chapter 55?
    USB is Chapter 51.
    https://www.microchip.com/wwwproducts/en/PIC32MZ2048EFH144
    There is no FRM 55
     
     
    http://ww1.microchip.com/downloads/en/DeviceDoc/PIC32MZ-EF-%20Family-DS60001320F.pdf
    Page 669
    Parameter USB313, VUSB3V3, USB Voltage, 3.0 — 3.6 V
    #19
    sborden
    Super Member
    • Total Posts : 1960
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: Issues with MSD USB Host and Harmony V1.11 2019/12/03 17:52:40 (permalink)
    0
    From
     
    DS60001232A-page 51-4
     

    The device may be required to power the VBUS3V3 pin to 5V as the ‘A’ device of the connection(source of power and default host) or, as the ‘B’ device (default peripheral), to be able to wake the ‘A’ device by charging the VBUS3V3 pin to 2V. Outputs from the Hi-Speed USB OTG module indicate when these charging options are required.

     
    I had to run at 5V, or no/purely random USB memory stick function.
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5