Hot![SOLVED] Harmony 1.07 USB host example -- msd_basic doesn't work

Author
kseg
Starting Member
  • Total Posts : 63
  • Reward points : 0
  • Joined: 2016/05/26 07:30:47
  • Location: 0
  • Status: offline
2017/06/09 10:15:26 (permalink)
0

[SOLVED] Harmony 1.07 USB host example -- msd_basic doesn't work

Hello all,
 
I use MPLABX v3.30, XC32 v1.40 and Harmony v1.07.
My hardware board is PIC32MZ EC start kit (pic32mz2048ech144).
I tried two usb device examples of Harmony,  they worked nice.
Then I go to try the usb host example -- msd_basic.
usb drive(FAT32) is attached on the board. JP1 is connected.  heap size is 1024.  after programming, I see that msd_basic never works. 
 
case APP_STATE_WAIT_FOR_BUS_ENABLE_COMPLETE:
            if(USB_HOST_BusIsEnabled(0))

 
I debug it and find it is blocking in APP_STATE_WAIT_FOR_BUS_ENABLE_COMPLETE, The USB_HOST_BUS cannot be enabled.
 
Then I find the reason of  USB_HOST_BUS not enabled is the DRV_USBHS_Tasks() is blocked.
case DRV_USBHS_TASK_STATE_WAITING_FOR_DELAY_COMPLETE:

            /* Check if the delay is complete */
            if(SYS_TMR_DelayStatusGet(hDriver->timerHandle))
            {

 
I put a breakpoint on the line of "if(SYS_TMR_DelayStatusGet(hDriver->timerHandle)) "
I see that if condition is alway false. seems that the timer delay cannot complete.
 
Does anybody face this problem?
Any comments are welcome.
Thanks.
post edited by kseg - 2017/10/12 08:08:49
#1

3 Replies Related Threads

    kseg
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/05/26 07:30:47
    • Location: 0
    • Status: offline
    Re: Harmony 1.07 USB host example -- msd_basic doesn't work 2017/06/10 03:17:18 (permalink)
    0
    bool SYS_TMR_DelayStatusGet ( SYS_TMR_HANDLE handle )
    {
        return SYS_TMR_ObjectCountGet(handle, 0) == 0;
    }

     
    Above is the SYS_TMR_DelayStatusGet() function code.
    This function seems to waiting the timer  round up(actually, I don't know which timer, I am new to harmony), but the timer count doesn't round up to zero.
     
    every time, hit to SYS_TMR_ObjectCountGet(), I get the timer count keeps the same value 0x2331. 
    The timer count never change, why?
     
     
    #2
    kseg
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/05/26 07:30:47
    • Location: 0
    • Status: offline
    Re: Harmony 1.07 USB host example -- msd_basic doesn't work 2017/06/11 06:34:12 (permalink)
    0
    The delay is not complete, maybe this problem is not about the timer, because I change to use the core timer to instead of the timer,  the problem still not be fixed.
     
    I found after the program calling the function "PLIB_PORTS_PinWrite( PORTS_ID_0, PORT_CHANNEL_B, PORTS_BIT_POS_5, enable )",  a softreset occurs. 
     
    This function is to do USB VBUS power enable, something is wrong, have no idea how to fix it.
     
    #3
    kseg
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/05/26 07:30:47
    • Location: 0
    • Status: offline
    Re: Harmony 1.07 USB host example -- msd_basic doesn't work 2017/10/12 08:08:14 (permalink)
    0
    msd_basic got working now.
     
    I think it is connection issue.
     
    msd_basic works fine when the connection like below:
    install thumb drive to J5, leave J4 alone ( can't connect J4 to PC with USB cable), connect J3 to PC with USB cable, and install the jummper to JP1.
    #4
    Jump to:
    © 2017 APG vNext Commercial Version 4.5