• AVR Freaks

Hot!Exception when unmounting mass storage device

Author
skruegel1
Starting Member
  • Total Posts : 69
  • Reward points : 0
  • Joined: 2017/02/04 03:32:13
  • Location: 0
  • Status: online
2019/03/12 16:26:01 (permalink)
0

Exception when unmounting mass storage device

I created a Harmony 2.02b configuration with a USB Host hub driver, CDC client driver, and a MSD client driver.  I used the Explorer 16/32 development board with a PIC32 CAN-USB PIM for the host.  I used a MCP2220 dev kit for the hub, a SanDisk flash drive for the MSD, and the MCP2200 Breakout Module for the CDC.  After a few insertions and removals of the flash drive, I get an exception in drv_usbfs_host.c in the _DRV_USBFS_HOST_CalculateNonControlBW() method.  The pPipe pointer is invalid.  I wrote a test to check for this condition, and attached the file.  I've also attached the test driver I wrote.
 
Any ideas?
 
#1

10 Replies Related Threads

    Paul PortSol
    Super Member
    • Total Posts : 439
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Exception when unmounting mass storage device 2019/03/14 04:57:29 (permalink)
    0
    Just guessing, but how big is your Heap in MHC?
    Some examples have heap only 500, but some of us have found Heap 10000 or more can be necessary with filesystem or USB.
    Paul
    #2
    skruegel1
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/03/14 05:25:29 (permalink)
    0
    It was 1000.  I just changed it to 10000, but unfortunately the problem is still present.
     
    In this system, it would be possible to reset the entire USB interface when a device unmounts.  That's my current focus.  Another area I would like to explore is manual mount/unmount.
     
     
    #3
    skruegel1
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/07 06:04:06 (permalink)
    0
    By the way, this turned out to be a form of memory leak.  When a MSD was removed, sometimes the transfer object was not returned to the pool.  Eventually, there would be no transfer objects available.  The solution was to call a method I added to usb_host that checks all the global transfer objects when a MSD is removed, and return ones that were being used by the MSD to the pool.
    #4
    Paul PortSol
    Super Member
    • Total Posts : 439
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Exception when unmounting mass storage device 2019/06/07 12:21:39 (permalink)
    0
    Is this a Harmony Bug? if so please submit a ticket (unless it is already fixed in Harmony V2.06?)
    Paul
    #5
    skruegel1
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/10 05:23:16 (permalink)
    0
    I'd be glad to submit a ticket.  How do I do it?
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 17361
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/10 11:57:30 (permalink)
    #7
    NKurzman
    A Guy on the Net
    • Total Posts : 17361
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/10 11:59:38 (permalink)
    0
    Create an account.
    Login. 
    click "My Cases" at the Top the Page
    #8
    skruegel1
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/11 05:02:26 (permalink)
    0
    Done.
    #9
    skruegel1
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/11 05:02:26 (permalink)
    0
    Done.
    #10
    skruegel1
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2017/02/04 03:32:13
    • Location: 0
    • Status: online
    Re: Exception when unmounting mass storage device 2019/06/11 05:02:26 (permalink)
    0
    Done.
    #11
    Jump to:
    © 2019 APG vNext Commercial Version 4.5