• AVR Freaks

AnsweredHow Set up USB in Harmony 2.02b

Page: < 12 Showing page 2 of 2
Author
kuku
Senior Member
  • Total Posts : 145
  • Reward points : 0
  • Joined: 2012/03/03 08:05:54
  • Location: 0
  • Status: offline
Re: How Set up USB in Harmony 2.02b 2019/04/10 06:50:47 (permalink)
0
I will agree with you if we talk with other(complicated) demo aplication- in this way I run TFT screen. With HOST example I'm really suprised that it compile with cosmetic change only. Also main loop is simple and easy to check.
I must get back my MEBII, I remember that long time ago I burn this firmware to this dev board and they works. 
yesterday I try to make USB host bootloader from nothing, trough MHC "clicking". Here also look's like still wait for usb stick, so today I try to run naked USB. So today I play with USB only...
--------
When I connect stick then D+ change from L to H, and I not see any other reaction at D+/- line.
--------
@Paul,  hmm here really something can not match to my PIC, in routine SYS_MODULE_OBJ DRV_USBHS_Initialize in  drv_usbhs.c I see like this:

if (DRV_USBHS_OPMODE_HOST == drvObj->usbDrvCommonObj.operationMode)
                {
                    /* For Host the ID pin needs to be pull down */
                    PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_ID_0, PORT_CHANNEL_F, PORTS_BIT_POS_3 );
                }

I think that this is used in EF device(?). My MZ2064DAH176 not share USB ID (leg 52) line with other ports(?)
post edited by kuku - 2019/04/10 07:38:05
#21
kuku
Senior Member
  • Total Posts : 145
  • Reward points : 0
  • Joined: 2012/03/03 08:05:54
  • Location: 0
  • Status: offline
Re: How Set up USB in Harmony 2.02b 2019/04/11 05:16:30 (permalink)
0
It run on microchip dev board if I compile it with BSP usage.

in system_init.c and BSP I get:
const DRV_USBHS_INIT drvUSBHSInit =
{
    /* Interrupt Source for USB module */
    .interruptSource = INT_SOURCE_USB_1,
    
    /* Interrupt Source for USB module */
    .interruptSourceUSBDma = INT_SOURCE_USB_1_DMA,

    /* System module initialization */
    .moduleInit = {SYS_MODULE_POWER_RUN_FULL},

    /* Operation Mode */
    .operationMode = DRV_USBHS_OPMODE_HOST,

    /* Operation Speed */
    .operationSpeed = USB_SPEED_HIGH,
    
    /* Stop in idle */
    .stopInIdle = false,

    /* Suspend in sleep */
    .suspendInSleep = false,

    /* Identifies peripheral (PLIB-level) ID */
    .usbID = USBHS_ID_0,
    
    /* Root Hub Port indication */
    .portIndication = NULL,
        
     /* Power Enable */
    .portPowerEnable = BSP_USBVBUSPowerEnable,
    
    /* Over Current detection */
    .portOverCurrentDetect = BSP_USBVBUSSwitchOverCurrentDetect,
     
     /* Available Current */
    .rootHubAvailableCurrent = 500,
};

 
and somewhere....
void BSP_USBVBUSPowerEnable(uint8_t port, bool enable)
{
    /* Enable the VBUS switch */

    PLIB_PORTS_PinWrite( PORTS_ID_0, PORT_CHANNEL_B, PORTS_BIT_POS_5, enable );
}

bool BSP_USBVBUSSwitchOverCurrentDetect(uint8_t port)
{
    return(false);
}

 
When I try to compile it without BSP, then driver init look's like here:
const DRV_USBHS_INIT drvUSBHSInit =
{
    /* Interrupt Source for USB module */
    .interruptSource = INT_SOURCE_USB_1,
    
    /* Interrupt Source for USB module */
    .interruptSourceUSBDma = INT_SOURCE_USB_1_DMA,

    /* System module initialization */
    .moduleInit = {SYS_MODULE_POWER_RUN_FULL},

    /* Operation Mode */
    .operationMode = DRV_USBHS_OPMODE_HOST,

    /* Operation Speed */
    .operationSpeed = USB_SPEED_HIGH,
    
    /* Stop in idle */
    .stopInIdle = false,

    /* Suspend in sleep */
    .suspendInSleep = false,

    /* Identifies peripheral (PLIB-level) ID */
    .usbID = USBHS_ID_0,
    
    /* Root Hub Port indication */
    .portIndication = NULL,
     
     /* Over Current detection */
    .portOverCurrentDetect = NULL,
    
    /* Power Enable */
    .portPowerEnable = NULL,
     
     /* Available Current */
    .rootHubAvailableCurrent = 500,
};


So, they don't have control at VBUS pin(?). I try to fix this place, but without success, maybe in other place MHC also set "NULL", I don't know, I give up.
post edited by kuku - 2019/04/11 05:18:20
#22
Paul PortSol
Super Member
  • Total Posts : 639
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: How Set up USB in Harmony 2.02b 2019/04/11 05:23:11 (permalink)
0
You should really start a fresh thread if you are looking for help, this thread over 2 years old!
Also specify exactly what versions you are using (are you really still using old harmony V202)?
Versions: PIC32xxx, MPLABX, XC32, Harmony, MHC
 
#23
Paul PortSol
Super Member
  • Total Posts : 639
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: How Set up USB in Harmony 2.02b 2019/04/11 05:29:44 (permalink)
0
Suggest you use minimal project to debug your issue,
then put what you learned back into your full project.
 
Try this: MHC_CreatingProjectWithoutBSP_v00PR.txt
Paul
 
#24
kuku
Senior Member
  • Total Posts : 145
  • Reward points : 0
  • Joined: 2012/03/03 08:05:54
  • Location: 0
  • Status: offline
Re: How Set up USB in Harmony 2.02b 2019/04/11 05:48:40 (permalink)
0
I made it from zero. Choose from MHC tree USB, file system, clock, and other necessary parts


-----
Fixed, I have wrong clock configuration.
post edited by kuku - 2019/04/17 04:51:32
#25
Page: < 12 Showing page 2 of 2
Jump to:
© 2021 APG vNext Commercial Version 4.5