• AVR Freaks

Hot!HARMONY USB HOST crash

Author
chri
Starting Member
  • Total Posts : 42
  • Reward points : 0
  • Joined: 2009/06/08 02:34:22
  • Location: 0
  • Status: offline
2019/01/18 01:14:12 (permalink)
0

HARMONY USB HOST crash

Hi,
my system is pic32mx470f512l harmony v2.06, drv usb host stack, hub usb, devices with bulk transfer. It happens that code fall in routine _DRV_USBFS_HOST_CalculateNonControlBW when i unplug a device. It's not systematic but it happens frequently.
I have tried to change the hub but without success!
Thanks
#1

11 Replies Related Threads

    Paul PortSol
    Super Member
    • Total Posts : 471
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: HARMONY USB HOST crash 2019/01/30 09:26:51 (permalink)
    0
    a) sufficient Heap size? Some of us using 10000 (on PIC32MZ). Haven't been able to get a formula for heap size for USB from Microchip support.
    b) large capacitor on USB power, like 150uF 6V
    See also are other posts in this forum about issues/solutions with USB Host when using USB Memory Sticks
    #2
    chri
    Starting Member
    • Total Posts : 42
    • Reward points : 0
    • Joined: 2009/06/08 02:34:22
    • Location: 0
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/04 04:42:40 (permalink)
    0
    Thank you Paul,
    I have tried to grow up the heap size but without success! I will check the solution b) but i think it's a software stack issue. It happens sometimes when the device detaches, on interface release and closing the bulk pipe!
    #3
    friesen
    Super Member
    • Total Posts : 2066
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/05 12:14:59 (permalink)
    0
    Just a guess, but are you making sure your io buffers are 16 byte aligned and/or non cached?

    Erik Friesen
    #4
    chri
    Starting Member
    • Total Posts : 42
    • Reward points : 0
    • Joined: 2009/06/08 02:34:22
    • Location: 0
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/09 03:43:05 (permalink)
    0
    Hi friesen,
    I've tried to set buffers I/O 16 byte aligned but same result! What do you mean with cached?
     
    #5
    friesen
    Super Member
    • Total Posts : 2066
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/09 06:34:14 (permalink)
    0
    Just a problem I have had. If you don't know what cache is you'll want to learn. What can happen is that the unused portion of the cache line can end up being your stack or similar, and if you or the framework are manipulating the cache, all of the sudden you have oddities.

    Erik Friesen
    #6
    friesen
    Super Member
    • Total Posts : 2066
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/09 06:36:07 (permalink)
    0
    Doesn't the mal support that device? It's a much lighter weight framework.

    Erik Friesen
    #7
    nigelwright7557
    Super Member
    • Total Posts : 276
    • Reward points : 0
    • Joined: 2006/11/06 08:15:51
    • Location: 0
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/17 11:47:29 (permalink)
    0
    I had a problem with mz corrupting a usb transmit buffer.
    I had to make the rx and tx buffers coherent.
     
    #8
    Paul PortSol
    Super Member
    • Total Posts : 471
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: HARMONY USB HOST crash 2019/02/18 08:10:47 (permalink)
    0
    How are you handling connect/disconnect events?
    - You can use the callback functions to cleanly handle connect and disconnect events for USB Devices (Mount/Unmount)
    - See example by using MHC App Generate Code (attached: MHC-Heap-UsbHost_20190218PR.zip)
    - Ensure lots of heap
    Paul
     
     
    #9
    chri
    Starting Member
    • Total Posts : 42
    • Reward points : 0
    • Joined: 2009/06/08 02:34:22
    • Location: 0
    • Status: offline
    Re: HARMONY USB HOST crash 2019/03/18 10:21:35 (permalink)
    0
    The problem appears with an hub and after the device is unplugged and a read operation has been done! I've tried to set the buffer aligned 16 but without success.
    #10
    skruegel1
    Starting Member
    • Total Posts : 78
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: offline
    Re: HARMONY USB HOST crash 2019/03/19 14:20:52 (permalink)
    0
    I have the same problem.  You can look at my post to see my source code.  For me, the bug only occurs when I have a CDC device plugged into a hub as well as a MSD.  When I unmount the MSD, the exact bug you've described occurs.  I updated to the latest Harmony, but it is present there, too.
    #11
    chri
    Starting Member
    • Total Posts : 42
    • Reward points : 0
    • Joined: 2009/06/08 02:34:22
    • Location: 0
    • Status: offline
    Re: HARMONY USB HOST crash 2019/03/20 07:21:10 (permalink)
    0
    Hi Skruegel1,
    i suppose there a bug on Microchip usb host HUB stack, the problem seems to be the pipe, the issue appears when there is a pipe opened and a device is unplugged from the hub. The possible way to resolve it could be to reset the USB when a device is unplugged, but how?
    #12
    Jump to:
    © 2019 APG vNext Commercial Version 4.5