[solved] pic32mz_ef_sk_int_dyn FreeRTOS9 Harmony 2.04, cdc_com_port_dual usb never enum...

Author
jcandle
Senior Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2011/09/19 22:01:53
  • Location: 0
  • Status: offline
2017/10/06 22:55:56 (permalink)
0

[solved] pic32mz_ef_sk_int_dyn FreeRTOS9 Harmony 2.04, cdc_com_port_dual usb never enum...

I have been beating my head against a wall on USB with a custom board, so I punted and went to the EF starter and the 2.04 demo.  I added FreeRTOS in the configs which forces USB to use TMR2.
 
edit - punted harder and tried single port, no RTOS, same issue.
 
sysObj.drvTmr0 = DRV_TMR_Initialize(DRV_TMR_INDEX_0, (SYS_MODULE_INIT *)&drvTmr0InitData);
is creating timer 2.
sysObj.sysTmr  = SYS_TMR_Initialize(SYS_TMR_INDEX_0, (const SYS_MODULE_INIT  * const)&sysTmrInitData);
is succeeding
sysObj.drvUSBObject = DRV_USBHS_Initialize(DRV_USBHS_INDEX_0, (SYS_MODULE_INIT *) &drvUSBInit);
sysObj.usbDevObject0 = USB_DEVICE_Initialize (USB_DEVICE_INDEX_0 , ( SYS_MODULE_INIT* ) & usbDevInitData);
These appear to trace successfully but are both 0...
 
The first loop, hDriver->timerHandle == o
Then in the task, hDriver->timerHandle == SYS_TMR_HANDLE_INVALID forever
 
            /* Start the delay here - 3 sec */
            hDriver->timerHandle = SYS_TMR_DelayMS(_DRV_USBHS_MODULE_RESET_DURATION);
 
            if(hDriver->timerHandle != SYS_TMR_HANDLE_INVALID)
            {
                /* Reset the PHY. This is a workaround
                 * for an errata */
                PLIB_USBHS_SoftResetEnable(usbID);

                /* Delay has started. Move to the next state */
                hDriver->state = DRV_USBHS_TASK_STATE_WAITING_FOR_DELAY_COMPLETE;
            }

            break;

        case DRV_USBHS_TASK_STATE_WAITING_FOR_DELAY_COMPLETE:

            /* Check if the delay is complete */
            if(SYS_TMR_DelayStatusGet(hDriver->timerHandle)) 
            {
                /* This means the delay is complete. Clear the Soft Reset */
                PLIB_USBHS_SoftResetDisable(usbID);

                /* Setup the USB Module based on the selected
                 * mode */


post edited by jcandle - 2017/10/07 10:59:40
#1

2 Replies Related Threads

    jcandle
    Senior Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2011/09/19 22:01:53
    • Location: 0
    • Status: offline
    Re: pic32mz_ef_sk_int_dyn FreeRTOS9 Harmony 2.04, cdc_com_port_dual; usb never enumerates 2017/10/07 09:19:42 (permalink)
    0
    Using the untouched project in D:\microchip\harmony\v2_04\apps\rtos\freertos\cdc_com_port_dual it enumerates.
    This is frustrating since I spent hours last night reinstalling all the latest tools to clean up uny corrupted files!
     
    Now lets see if I can migrate this to the custom board to at least test hardware.
     
    but first, if I send a burst of characters to one port, only the first character makes it.  Typing (if that is what you would call my interactions with a keyboard) work, so it is clearly a buffer size and transfer mode issue.
     
    My application will use one port as a console of sorts (maybe the actual console?) e.g. to configure WINC1500, and the other will burst packets of the form [length uint16][port byte][data bytes, 0 - length; max is 513], so up to a 516 byte chunk.  They will be put on one of two queues.  The packets go out one of two UARTS at 250Kbs with some custom BREAK/MARK framing. I need to keep up with one packet every 20-25ms from both sources (or as close to 100 packets/s and 500kb as practical).  http://www.microchip.com/forums/m962184.aspx suggests that something close to this is possible.
     
    A byte-by-byte serial port is not quite the answer.
     
    The USB is one source and a WINC1500 (probably two sockets for packet by packet transfer, if that can turn around 100 packets/second)
    post edited by jcandle - 2017/10/07 09:37:53
    #2
    jcandle
    Senior Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2011/09/19 22:01:53
    • Location: 0
    • Status: offline
    Re: pic32mz_ef_sk_int_dyn FreeRTOS9 Harmony 2.04, cdc_com_port_dual; usb never enumerates 2017/10/07 10:58:56 (permalink)
    0
    So, corrupted Harmony files and http://www.microchip.com/forums/m1018551.aspx 
    Every time I try to make a new configuration
    a) Harmony decides I must want FRC and not my 24MHz HS
    b) Harmony writes code for PGx1, not PGx2
     
    c) Harmony insists on putting BSP back in
    even though I set config bits and clock page explicitly...
     
    Marking this solved and now to research how to send more than 
    o
    n
    e
     
    c
    h
    a
    r
    a
    c
    t
    e
    r
     
    a
    t
     
    a
     
    t
    i
    m
    e
    .
    #3
    Jump to:
    © 2017 APG vNext Commercial Version 4.5