Windows 10

Discuss the Integrated Development Environment (IDE)

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Windows 10

Post by David Barker » Sat Aug 08, 2015 3:39 pm

Having a very difficult time with windows 10 - unable to get virtual COM ports to work correctly. Would strongly recommend you avoid the update for the time being.

Has anyone got any experience / pointers with virtual COM ports with windows 10? Any help gratefully received!

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Windows 10

Post by Jerry Messina » Sat Aug 08, 2015 5:13 pm

I haven't tried it yet, but they changed usbser around in win10, and supposedly it's easier to use now. I think it might need a new .inf file. Checkout https://msdn.microsoft.com/en-gb/librar ... 85%29.aspx
.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Windows 10

Post by David Barker » Sun Aug 09, 2015 10:20 am

That's a useful link Jerry, thanks.

I ended up reverting back to windows 7 for the time being, there were too many problems, the main ones being (1) excessive CPU usage and (2) unable to get the swordfish or firewing loader to work correctly with the windows 10 virtual COM port. I couldn't even get an *.inf file to force an install (kept coming up with "latest driver installed"). Basically, the loaders failed on windows 10 (timeout errors) but worked fine when I rolled back to 7. I've never had this problem in all my years of using windows with the same application code used to connect to a COM port (win95 onwards).

I guess I could have persisted but the whole experience really pissed me off and for the time being, I'm sticking with 7. I will revisit a few months down the road. Comments from any other users using windows 10 for PIC development are most welcome!

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Windows 10

Post by Jerry Messina » Sun Aug 09, 2015 11:16 am

It's probably a bit late, but from looking at the info in that link:
In Windows 10, a new INF, Usbser.inf, has been added to %Systemroot%\Inf that loads Usbser.sys as the function device object (FDO) in the device stack. If your device belongs to the Communications and CDC Control device class, Usbser.sys is loaded automatically. The driver is loaded based on a compatible ID match similar to other USB device class drivers included in Windows.

USB\Class_02

USB\Class_02&SubClass_02

If you want to load Usbser.sys automatically, set the class code to 02 and subclass code to 02 in the Device Descriptor. For more information, see USB communications device class (or USB CDC) Specification found on the USB DWG website. With this approach, you are not required to distribute INF files for your device because the system uses Usbser.inf.
Most of the PIC USB device code we've been using has the CDC descriptor set for Class 02 & SubClass 00. It might be worth a shot changing the descriptor to:

Code: Select all

// Device Descriptor
public const device_dsc(USB_DEV_DSC_SIZE) as byte = (                                         'usbdsc.c
    sizeof(USB_DEV_DSC),            // bLength - size of this descriptor IN bytes
    DSC_DEV,                        // bDescriptorType - device descriptor type
    $00,                            // bcdUSB (low byte)  - USB Spec Release Number IN BCD format (2.0)
    $02,                            // bcdUSB (high byte) - USB Spec Release Number IN BCD format (2.0)
    CDC_DEVICE,                     // bDeviceClass - class Code
    $02,                            // bDeviceSubClass - subclass code << change SubClass for win10 support
and see if the built-in win10 driver loads. Looking at the driver examples from the Microsoft page it seems that the INF file is calling out some different dll's, so if you leave SubClass = 0, you'll have to supply the files and I'm not sure if existing .inf files will work w/win10.

From what they're saying that's one of the new features... you don't need to supply an INF file anymore if you do it that way. Also, supposedly the new win10 driver finally recognizes device removal/insertions, so there's a chance that you can finally unplug/plug the device with a terminal app open and not have it go bonkers. Both of those would be a welcome change.

I'd be interested in seeing feedback on others' experiences, too. It's going to be a while before I get up the nerve to install yet another version of windows.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Windows 10

Post by David Barker » Mon Aug 10, 2015 10:08 am

Hi Jerry

Yes, I did see that too late - I had uninstalled after you posted that link. I obviously need to look at this in more detail, but it won't be for a while given the other problems I experienced with Win10 (I would suggest people give some serious thought to installing win10 on a development machine). However, in some cases (like the Firewing development board) changing the firmware isn't really an option (for legacy support). I'm hoping it can be sorted via driver configuration in the future.

Thanks again for this link though, much appreciated...

be80be
Registered User
Registered User
Posts: 90
Joined: Mon Feb 23, 2009 2:15 am
Location: tn

Re: Windows 10

Post by be80be » Thu Aug 20, 2015 10:10 pm

Com ports work fine if you wait till the windows start's to start and hold the shift key you can turn off driver signing I didn't have any problems there but the dang thing isn't using some of the library's Like ADC for one

be80be
Registered User
Registered User
Posts: 90
Joined: Mon Feb 23, 2009 2:15 am
Location: tn

Re: Windows 10

Post by be80be » Fri Aug 21, 2015 3:46 pm

The only problem I had was driver signing windows 10 let's you turn off driver signing but how it's setup to do that is a little crazy.
You have to hold the shift key down when it start's up windows that let's you get to startup stuff and setting you can't change will running the desktop.

But It works great after turning off driver signing ..
I had only one problem with com ports and it was because I had not used the driver in windows 7.

After all windows 10 doesn't think you have a com port on your pc LOL those been gone for year's I just fixed up a dell with a p4 2.8 ghz and a real com port it's 10 years old LOL and had windows 7

Turn off driver signing youll be good to go

Ralph
Posts: 15
Joined: Tue Apr 01, 2008 3:15 am
Location: Melbourne, Australia

Re: Windows 10

Post by Ralph » Mon Nov 23, 2015 6:17 am

Hi all,

I am really struggling with Win10 and the new usbser.sys issue.

The application I have developed is an industrial control product, developed using Swordfish and the USB1.43 library (essentially my product is a serial to USB converter with some 'smart stuff' in the middle) which has been running reliably for more than a year on many Win7, Win8 and Win8.1 machines.

On Win10 however, the USB connectivity is very unreliable, somewhat difficult to install my .inf file and halts my 18F4550 after connecting for only a few seconds.

I have tried Jerry's suggestion and set the class and subclass to 02, and I'm starting to have some success!!! Instead of using my own .inf driver file, Win10 now "connects" and uses its own usbser.inf, which is as expected from reading the MS link posted previously. The downside is that a check in Device Manager just shows a generic "USB Serial Device" type message instead of "My Product Name" which it used to. But this is only a minor inconvenience and a small price to pay if it works properly on Windows 10.

Does it work? Well yes, sort of. The MCU still halts after a few seconds, but if I go into Device Manager, select the serial port and reinstall the driver EACH TIME, it then runs perfectly from then on. That is, until I unplug and plug it in again, then I need to repeat the driver reinstall issue.

Of course, it may be that I have a second issue, that is only becoming apparent when using Win10 - so I will continue my experiments to try and isolate the issue further.

Clearly I cannot ask my users to reinstall the USB serial Driver every time they connect my product. So, before I lose my sanity altogether, I wonder if anyone else has made any headway on this issue? I regret my knowledge of USB and my ability to debug more complex issues like this is somewhat limited.

Cheers,
Ralph Parkhurst
Melbourne.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Windows 10

Post by Jerry Messina » Mon Nov 23, 2015 10:40 am

Taking a stab in the dark here -

You might check to make sure that it's not using any sort of power management with the device... not sure how to do that with Win10, but make sure it leaves the port on all the time. There's also a new Selective Suspend mode. Check to see if that's enabled and try turning it off if it is.

Ralph
Posts: 15
Joined: Tue Apr 01, 2008 3:15 am
Location: Melbourne, Australia

Re: Windows 10

Post by Ralph » Mon Nov 23, 2015 12:35 pm

Thanks Jerry - I will certainly follow that up.

Some further tests have revealed that a blocking call in the CDC.Writebyte subroutine is where the program "hangs", in particular right here in the USBCDC module:

Code: Select all

While ((FTXPos = (TX_BUFFER_SIZE - 1)) And Attached)
        _service()
    End While
The code sits in this loop until I "Update the Driver Software" on the USB Serial Device, then off it runs happily.

I will report backl with further findings as they come to hand.

Ralph
Posts: 15
Joined: Tue Apr 01, 2008 3:15 am
Location: Melbourne, Australia

Re: Windows 10

Post by Ralph » Wed Nov 25, 2015 12:14 am

Further investigation suggests that the issue I am experiencing is limited to my particular laptop running Windows 10. The good news is that after the changes were made which set bDeviceSubClass to $02 in the CDC Descriptor, (as previously suggested by Jerry), the USB connection is working perfectly using the built-in Windows 10 driver on another system.

On my particular laptop (An Acer Aspire), there seems to be some sort of compatibility issue which prevents Win10 using the inbuilt driver with Plug and Play.

The only workaround I've been able to find to solve the USB connectivity issue on my laptop is to:
a) Boot my laptop WITH my USB product already plugged in, or
b) Plug my USB device in at any time, but then put the laptop to sleep and then immediately wake it up again, or
c) Plug my USB device in at any time, then disable the USB To Serial driver in Device Manager and then immediately enable it again.

Although disabling "Selective Suspend" hasn't helped, I suspect Jerry that you are on the right track with your suggestion of it being related to some sort of USB Power Management problem, I just haven't been able to find it yet.

Thanks for your help and I hope this gives others with similar issues some confidence with Virtual Com ports underWin10 - except those using Acer Aspire laptops! :roll:

Warm regards,
Ralph

Post Reply