windows - Make USB virtual COM device persistent through reboots

30
2014-06
  • StephenH

    EDIT: Having rethought the issue, perhaps my question can be summarized like this: Is there an existing COM terminal type program that will automatically detect when a COM port becomes unavailable and reconnect when it becomes available?

    I have an embedded control that uses a STM32 Microcontroller which uses its USB port to communicate with the computer as a 'virtual COM port'. I am currently running a cycle test where the control is automatically cycled on for 5 minutes and off for 10 seconds. This is to catch an error that will appear every 50-200 restarts.

    The device is already outputting debug messages through the Virtual COM Port, but when the device restarts, the USB device disconnects and reconnects. Then whatever program I was using to monitor the output (putty, Tera Term, etc.) loses connectivity and I must manually unplug and replug the USB cable and restart whatever COM application I am using.

    My goal is to set up Tera Term or putty to keep the COM port open and just write the entire session to a log file, but because of the restart the USB device isn't persistent.

    Is there any way that I can 'virtualize' the USB port or modify the .ini file in anyway to make the USB port persistent? Here is what I believe is the relevant section of the .ini file

    [USBtoSer.nt.Services] 
    AddService=usbser, 0x00000002, DriverService
    
    [DriverService] 
    DisplayName=%USBIOMport% 
    ServiceType=1
    StartType=3
    ErrorControl=1
    ServiceBinary=%12%\usbser.sys 
    

    I cannot modify the embedded application running on the STM32 and can only interact with it through a pre-programmed terminal via the USB

    EDIT: Here is a link to information from Microsoft that explains what the above does. I haven't had any luck determining which change would work for my application, so I may start trial and error with different ErrorControl and StartType (though from what I read, I hardly doubt they will solve my issue)

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    usb - Configure connection to embedded device with virtual COM port in Windows 7
  • Lstor

    I want to set up a connection between my Windows 7 computer and an embedded device connected on a virtual COM port using a USB cable. I already have a driver for for COM port emulation.

    How do I configure the connection?

    In windows XP, the answer is to go to: Create new connection -> Advanced connection -> Direct connection from PC to PC

    And then configure it. What's the corresponding approach for Windows 7? I've been searching through the "Network and Sharing Center" for ages without figuring it out, and I couldn't find much help in Google, either. Any help would be very much appreciated.


  • Related Answers
  • Lstor

    I found the answer:

    • Go to Network and Sharing Center
    • Set up a new connection or network -> Set up a dial-up connection
    • Enter a dummy number (not used) and choose 'Connect'.
    • Edit the connection in order to configure (e.g. select COM port)
    • Connect.