Hot!cdc_com_port_single example loses comms long-term

Page: 12 > Showing page 1 of 2
Author
Jason Watton
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2015/02/24 04:52:41
  • Location: 0
  • Status: offline
2017/07/03 02:40:27 (permalink)
0

cdc_com_port_single example loses comms long-term

Using the PIC32MZ EFM Starter Kit (PIC32MZ2048EFM144) and Microchip's sample code ONLY...
 
If I run the Microchip example 'cdc_com_port_single' then characters typed are echoed back +1 as expected and the message 'PUSH BUTTON PRESSED' appears if I press SW1. So far, so good.
 
Leave the board, connected, for 5 minutes.
It's now dead.
No "echo+1" and no "PUSH BUTTON PRESSED".
 
The only way to resurrect comms is to disconnect and reconnect the USB port.
 
Surely I can't be the only one with this problem...?
#1

27 Replies Related Threads

    Tez
    Moderator
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/03 19:17:40 (permalink)
    0
    Which version of Harmony are you using? Are you running the demo in debug mode or program mode? Are you seeing this issue with other Harmony USB Device demo applications
    #2
    Jason Watton
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2015/02/24 04:52:41
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 06:59:57 (permalink)
    0
    > Which version of Harmony are you using?
     
    Environment:
    PIC32MZ EFM Starter Kit (PIC32MZ2048EFM144), MPLAB X IDE v3.45, Harmony v2.01b, XC32 v1.42, Windows 7.
     
    If someone can confirm a version/environment that doesn't exhibit this behaviour I am more than willing to migrate all my [that's more than a few] projects to use it.
     
    > Are you running the demo in debug mode or program mode?
     
    Program mode.
     
    > Are you seeing this issue with other Harmony USB Device demo applications
     
    I have not conducted a survey of all of Microchip's USB Device demos. Only this one.
     
    I am seeking independent confirmation that this happens - it is ridiculously simple to reproduce.
    post edited by Jason Watton - 2017/07/04 07:09:41
    #3
    RISC
    Super Member
    • Total Posts : 4209
    • Reward points : 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 07:02:31 (permalink)
    0
    Jason,
    Any specific reason why you use Harmony v2.01b rather than the actual version v2.03b ?
    Regards
     
    #4
    Jason Watton
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2015/02/24 04:52:41
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 07:13:37 (permalink)
    0
    Because of multiple projects in development and the cost in time and effort of migrating Harmony versions.
     
    I am working in a commercial environment with multiple dispersed project personnel and multiple customers each with multiple products attempting to use Microchip PIC32MZ chips. I can't glibly "use the latest version".
     
    And from previous experience migrating Harmony versions the customer doesn't appreciate later software builds having more bugs in it.
     
    However, if anyone wants to talk about this further please, with the greatest of respect, let's go to another thread. I don't want to detract from the problem in front of me.
     
    post edited by Jason Watton - 2017/07/04 07:33:36
    #5
    RISC
    Super Member
    • Total Posts : 4209
    • Reward points : 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 09:43:52 (permalink)
    0
    Hi,
    Which configuration are you using in the 'cdc_com_port_single' project ?
    It seems there are several configurations (at least in v2.03) : polling / interrupt ?
    which one do you use ?
    Regards
    #6
    Jason Watton
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2015/02/24 04:52:41
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 10:46:28 (permalink)
    0
    Hi RISC,
     
    Configuration: pic32mz_ef_sk_poll_dyn
     
    But - as far as I remember - pic32mz_ef_sk_int_dyn also exhibits the same behaviour. The polling option was chosen to avoid any notion of interrupt bugs.
     
    Jason.
    #7
    qhb
    Superb Member
    • Total Posts : 5034
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 15:09:42 (permalink)
    0
    Is the PC this is connected to attempting to enter some "low power mode" after 5 minutes of inactivity?
     
    #8
    Jason Watton
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2015/02/24 04:52:41
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 16:16:51 (permalink)
    0
    As it's this PC I'm posting to the forum on, if you mean hibernation or sleep, no.
     
    And regardless, isn't the Microchip USB stack meant to field such a request should it occur?
    #9
    qhb
    Superb Member
    • Total Posts : 5034
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/04 16:52:15 (permalink)
    4 (1)
    Jason Watton
    As it's this PC I'm posting to the forum on, if you mean hibernation or sleep, no.

    No, just a "save power" mode. It could possibly ask USB devices to go into a power saving mode, which could be tripping up the MC software
     

    And regardless, isn't the Microchip USB stack meant to field such a request should it occur?

    Who knows. I wouldn't trust any software that came from the MPLABX programmers.
    I'm just suggesting a possible mechanism that might cause something to happen after a given time.
    Just check in the "Power" applet on control panel, and see if anything is set to change after 5 minutes.
     
    #10
    Jason Watton
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2015/02/24 04:52:41
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/06 14:56:29 (permalink)
    0
    I have tried turning off all power saving features via the Control Panel Power Options, including disabling USB selective suspend.
    The problem is still there - leave cdc_com_port_single running on the DevKit and the USB comms locks up (note: the 5 minutes mentioned is merely a 'reasonable' test period, not a measured time before failure).
     
    As a footnote... disabling USB selective suspend and running on maximum power does seem to lengthen the time before USB comms is lost... [which gives credibility that the Microchip USB stack doesn't handle power requests successfully]...
    post edited by Jason Watton - 2017/07/07 03:09:52
    #11
    Tez
    Moderator
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/10 23:44:49 (permalink)
    0
    You are trying this with console program. When you see that the demo is not replying, could you try restarting the console program, specifically to check if the COM port is still visible to the console program? 
     
    When the demo does not respond, what is the state of the LEDs on the starter kit?
     
     
    #12
    RISC
    Super Member
    • Total Posts : 4209
    • Reward points : 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/11 02:40:54 (permalink)
    0
    Hi,
    I flashed the same demo as you 'cdc_com_port_single'  on the PIC32MZ EFM Starter Kit and I selected the configuration pic32mz_ef_sk_poll_dyn.
    After 15mn I pushed the sw1 and typed characters and everything works fine...I cannot reproduce the issue you see.
    I doubt that there is a difference between this version of Harmony and the previous ones regarding com_port project. It has always worked with me since early versions.
    Is your board connected directly to one of your PC USB ports ?
    Did you try several USB ports ?
    Maybe you want to try another PC ?
    I personally use USBdeview freeware to see the status of my USB peripherals
    Regards
     
    PS : still OK after 2 hours. The board does send the text string on Push button press and characters are echoed. No disconnect
    post edited by RISC - 2017/07/11 10:54:55
    #13
    Tez
    Moderator
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/11 06:44:37 (permalink)
    0
    I agree with RISC. Could you try with other PCs or other Host ports on your PC.
    #14
    newfound
    Super Member
    • Total Posts : 1788
    • Reward points : 0
    • Joined: 2003/11/07 12:35:49
    • Status: online
    Re: cdc_com_port_single example loses comms long-term 2017/07/11 18:29:55 (permalink)
    3 (1)
    Does appear to be related to the well known fault (noise) intolerance that plagues CDC with windows where the bulk in endpoint is silently dropped due to the "three strikes and you're out" USB policy. Windows 10 may address the problem better as it does fix other CDC issues. Terminating resistors on the D=, D- lines might also help.
    #15
    Tez
    Moderator
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/15 23:33:53 (permalink)
    3 (1)
    newfound
    Does appear to be related to the well known fault (noise) intolerance that plagues CDC with windows where the bulk in endpoint is silently dropped due to the "three strikes and you're out" USB policy. Windows 10 may address the problem better as it does fix other CDC issues. Terminating resistors on the D=, D- lines might also help.




    Thank you for sharing this. This can be confirmed if the console program is re-started and the affected COM port is no more available in the system.
    #16
    LostInSpace
    Senior Member
    • Total Posts : 96
    • Reward points : 0
    • Joined: 2016/03/11 22:47:59
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/16 18:41:13 (permalink)
    0
    Jason - Funny, I was just testing cdc_com_port_single myself, so I tried to leave it open 15 minutes plus, and I still have a connection. I was using my Win 7 x64 Pro PC the entire time lurking the forums here, but I only sporadically checked the CDC connection through a simple .NET serial port terminal program I use (Based on 'Termie').
     
    My advice is the usual Microsoft garbage advice - Try another PC?   ;-)
     
    Tonight when I go to bed, I will leave it on and see if it is still connected in the AM, stand by....
     
    [EDIT] My overnight experiment ran without a hitch. That was a 9 hour connection that was idle. Still was connected when I came back 9 hours later.
     
    BTW - I am running this on a PIC32MZ EF Starter Kit.
     
    HTH - Steve H.
    post edited by LostInSpace - 2017/07/17 06:38:55
    #17
    Matt.AU
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/07/13 23:33:24
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/16 23:58:30 (permalink)
    0
    I was just testing cdc_com_port_single now. 
    PC recongnized it, installed the driver automatically and showed a new COM, but can not communicate. I checked the property of the new COM, it shows USB\VID_04D8&PID_00DD&REV_0100&MI_00. it is different with MHC setting (PID 0x000A).
    How can I fix it. thanks.
    #18
    Tez
    Moderator
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/17 08:11:33 (permalink)
    0
    Could you try uninstalling the driver against the COM port and using the INF file provided along with the demo?
    #19
    RISC
    Super Member
    • Total Posts : 4209
    • Reward points : 0
    • Status: offline
    Re: cdc_com_port_single example loses comms long-term 2017/07/17 08:20:00 (permalink)
    0
    Hi,
    PID must be the same or it means something is wrong somewhere.
    I check on my side and it is definitely PID = 000A
    Can you please use USBdeview freeware to see what happens as the board enumerates ?
    Click on the column connected in USBdeview to see the currently connected USB devices.
    So you are rcognized easily when COM port enumerates that it is the one you just plugged.
    The current PID you see is another board / device from Microchip ( VID = 0x04D8 )
    Your COM port was not enumerated...
    Regards
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2017 APG vNext Commercial Version 4.5