Author Topic: DigiCDC on Win10 (blue screen)  (Read 2520 times)

impaire

  • Newbie
  • *
  • Posts: 1
DigiCDC on Win10 (blue screen)
« on: September 10, 2016, 08:19:38 am »
Hello,

Since hours, I'm trying to get this serial over USB libary working on a Win10 x64 PC, using the latest Arduino 1.6.11 IDE and a digispark (attiny85). Other sketches than DigiCDC/serial compile and work fine. I have a digispark with DigiMouse lib code sending mouse messages to this PC, that works.

When I try to load any DigiCDC basic examples (echo, read, LED, print), my Win10 computer crashes just after download, when the attiny85 starts the sketch. I each time get a "Sytem Thread Exception Not Handled (lowcdc.sys)" blue screen.

I noticed lowcdc.sys was recently updated for Win10 x64. I installed that version, but it still crashes, the same way:
https://github.com/protaskin/LowCDC-Win10x64

Are some extra steps known to get this DigiCDC/lowcdc.sys driver working on Win10 x64? I didn't find anything so far.

Would my PC behave the same with Digispark Pro, which is ATtiny167 based? Both 85 and 167 have 512 bytes of SRAM, CDC LED example sketch uses 214 bytes...

Best regards

Siana

  • Newbie
  • *
  • Posts: 1
Re: DigiCDC on Win10 (blue screen)
« Reply #1 on: October 24, 2016, 03:40:48 am »
Well it works for some other person who replied you on GitHub. But it also doesn't work for me, same issue. I experience BSOD with SYSTEM_THREAD_EXCEPTION_NOT_HANDLED in lowcdc.sys. Is this the same issue you're experiencing? In my Event Log category System, I find the following message:

The computer has rebooted from a bugcheck.  The bugcheck was: 0x0000007e (0xffffffffc0000005, 0xfffff80d9a9255a6, 0xffffb58149745ab8, 0xffffb581497452e0). A dump was saved in: C:\WINDOWS\MEMORY.DMP. Report Id: 20685e0b-44c2-4376-87e1-a55162c8882e.

I wonder what could be the culprit? Perhaps some other software, like chipset-specific drivers?
I've got AMD based mainboard with 760G and SB710 chipset, which reminds me, under prior versions of Windows, a USB filter driver was installed that fixes performance issues of bulk or isochronous endpoints, while under Windows 10, I have no longer seen it. I also have a signed version of hidusbf.sys (mouse overclocking driver) installed, which I wonder if might interfere. The board also employs a VIA xHCI USB3 host controller, correspondingly its drivers are installed, however I have used USB2 port in this instance.

If it works for some people but not for others, we need to start looking at what's common and what's different between these cases.


Rabbitduck

  • Newbie
  • *
  • Posts: 1
Re: DigiCDC on Win10 (blue screen)
« Reply #2 on: March 05, 2017, 06:17:12 am »
+1

gmos

  • Newbie
  • *
  • Posts: 1
Re: DigiCDC on Win10 (blue screen)
« Reply #3 on: April 22, 2017, 11:42:25 am »
+1. Micronucleus 2.0 A4.   
Windows 10 pro 64 bit

mrchad

  • Newbie
  • *
  • Posts: 1
Re: DigiCDC on Win10 (blue screen)
« Reply #4 on: June 24, 2017, 06:57:29 pm »
+1

PeterF

  • Hero Member
  • *****
  • Posts: 801
Re: DigiCDC on Win10 (blue screen)
« Reply #5 on: August 24, 2017, 05:21:52 pm »
Antyom (protaskin) created a digispark-support branch for the lowcdc.sys driver for Windows 10 (x64), so that would be worth checking out to see if it fixes the issue.

https://github.com/protaskin/LowCDC-Win10x64/tree/digispark-support

You can also see the explanation for why the different driver is needed here.

wop

  • Newbie
  • *
  • Posts: 4
Re: DigiCDC on Win10 (blue screen)
« Reply #6 on: August 26, 2017, 06:32:06 pm »
Thanks to Protaskin, It works now for my ATtiny85.

As the driver is not signed, it works in TESTSIGNING (permanent) mode.
It works also when boot with "Disable driver signature enforcement" advanced option, but it is not permanent.

1- Remove DigiSerial driver "Digispark Virtual Com Port" (VID_16D0/PID_087E), in order to avoid blue screens.
2- Set TESTSIGNIG mode using bcdedit shell command as administator.
3- Reboot
[ Windows10 "Test mode" ]
3- Rigth click on lowcdc.inf file and select "Install". Confirm "non signed installation".
4- Plug DigiStark device and wait for application boot. Update device using "list of device drivers" if not done automatically.

(driver package updated)
« Last Edit: August 31, 2017, 05:21:55 pm by wop »

Artyom

  • Newbie
  • *
  • Posts: 3
Re: DigiCDC on Win10 (blue screen)
« Reply #7 on: August 30, 2017, 12:58:56 pm »
Finally, someone have built and tested a Digispark driver package ;)

I'd prefer if you had used this version of lowcdc.inf, because it already supports both the V-USB and Digispark USB VID/PIDs, so I could merge it to the master branch.

But anyway. I've registered to write about importing the certificate from the catalog file, but funny thing! You don't have to import the certificate, Windows accepts the driver package despite this:

Quote
The test certificates that are used to embed signatures in driver files and to sign a driver package's catalog file must be added to the Trusted Root Certification Authorities certificate store and the Trusted Publishers certificate store.


But if the driver doesn't work, try to import the certificate. Run lowcdc.cat, click View Signature, click View Certificate, click Install Certificate..., choose the Local Machine certificate store, select Trusted Root Certification Authorities, finish the import. Add the certificate into the Trusted Publishers store similarly.

Run lowcdc.cat, check the status, the catalog file must be valid:


wop doesn't need to do that, because he has used createcat.bat, which added the certificate to the corresponding stores (check it by using certlm.msc).

Also, there is no need to disable Driver Signature Enforcement, enabling Test Mode should be enough.

P. S. I can confirm that this usbser_w7.sys is got from a Windows 7 distribution, I'm using the same version of the driver, and their hashes are the same (SHA-1 EFBF847CD0FAA8B2205D059195404B58C17B638C), lowcdc.sys is also unmodified.
P. P. S. Sorry for my clumsy English.
P. P. P. S. Be aware using Windows with the TESTSIGNING boot configuration option, Windows will load any type of test-signed kernel-mode code.

Edit: The certificate must be installed to the Local machine certificate store.
« Last Edit: September 03, 2017, 12:57:48 am by Artyom Protaskin »

wop

  • Newbie
  • *
  • Posts: 4
Re: DigiCDC on Win10 (blue screen)
« Reply #8 on: August 31, 2017, 05:59:22 pm »
Quote
I'd prefer if you had used this version of lowcdc.inf,
Oops, I used the green "Download (ZIP) button" to retrieve whole package.  I am not very familiar with GitHub.

I tried to import the certificate successfully but its copy doesn't work on another machine, nor on the same computer in non test-mode.
Quote
if %CreateCert% equ 1 (
Also, I removed CreateCert test in createcat batch and let certificate creation/adding only if certificate not exists.

ps: I have updated the package with the rigth lowcdc.inf file.
« Last Edit: August 31, 2017, 06:17:48 pm by wop »

Artyom

  • Newbie
  • *
  • Posts: 3
Re: DigiCDC on Win10 (blue screen)
« Reply #9 on: September 02, 2017, 12:10:15 pm »
Hello!

First, wop, could you please build a driver package once more, using this release? I don't mind if usbser.sys is renamed, but the certificate has a stupid name :) You probably will have to remove old certificates by using win+r → certlm.msc (for local computer certificates), certmgr.msc (for current user certificates). Thanks in advance.

Quote
Also, I removed CreateCert test in createcat batch and let certificate creation/adding only if certificate not exists.
It actually quite useful for testing or in case of losing certcopy.cer (athough it can be exported from certmgr).

Quote
I tried to import the certificate successfully but its copy doesn't work on another machine, nor on the same computer in non test-mode.
That's strange. Maybe you're doing something wrong. I've succesfully imported the certificate from both lowcdc.cat and certcopy.cer from the driver package you built.

Also, using the Microsoft terminology, the driver isn't "not signed", it's test-signed (for testing purposes).


Second, a couple days ago I've tried to install the driver package built by wop without importing the certificate, which has been used to test-sign the driver package, in order to confirm a missed step in his instruction, and, to my surprise, I was able to install the driver package and use it!

So I've conducted some experiments on a virtual machine today.
  • There is no way to install a driver package with TESTSIGNING=OFF.
  • There is no way to install a driver package without a catalog file.
  • A driver package with an unsigned catalog file can be added into DriverStore, but Windows prevents it being used.

  • A driver package with test-signed catalog file can be used without importing the certificate. This contradicts the Microsoft documentation. I suppose you can use it either way for now, but importing the certificate to the Local machine certificate store gives the following advantages:
    • This scary Windows Security window is avoided
    • The driver has this nice Authenticodeâ„¢ signature :)

P. S. Sorry for my English, I'm trying as best as I can.

Edit: The certificate must be installed to the Local machine certificate store.
« Last Edit: September 03, 2017, 12:52:25 am by Artyom Protaskin »

wop

  • Newbie
  • *
  • Posts: 4
Re: DigiCDC on Win10 (blue screen)
« Reply #10 on: September 05, 2017, 07:05:25 pm »
I have build a new driver package using the v1.0.1.6 release. [see attached Zip]
It works in test-mode and new certificate is correctly imported, this, even on another computer (in test-mode).
Driver works without certificate, but import certificate allows to automatically select the driver on first USB enumeration. No driver update has to be proceeded.

[using Test Mode]
1- Install certificate using rigth-click on certcopy.cer file into "Local Machine" / "Trusted Root Certification Authorities" store. Wait for confirmation ...
2- Install driver using rigth-click on lowcdc.inf file. Wait for confirmation ...
3- Plug and play !

May be a shell script could do that (1&2) automatically ...

For info, Virtual Comm allows data exchange using C ReadFile/WriteFile functions on COMx port. By this way, no need to create an additional LibUSB or WinUSB driver. I will post soon a sample mingw application demo.

Artyom

  • Newbie
  • *
  • Posts: 3
Re: DigiCDC on Win10 (blue screen)
« Reply #11 on: September 09, 2017, 01:47:42 am »
Thanks, wop.

Quote
but import certificate allows to automatically select the driver on first USB enumeration
Yep, I've tried this out, and it seems you're right. Good to know :)

Quote
May be a shell script could do that (1&2) automatically
It's certain that a certificate can be imported from a *.cer file using the certmgr /add command. Not sure if a certificate can be imported from a catalog file likewise. And I suppose that the pnputil /add-driver command should copy a driver package to the driver store.

wop

  • Newbie
  • *
  • Posts: 4
Re: DigiCDC on Win10 (blue screen)
« Reply #12 on: September 09, 2017, 09:29:19 pm »
Here is a console based application (DigiSFR.c) that allow to read/write ATtiny85 SFRs using LowCDC.
As LowCDC virtualizes USB as a serial COM port, application exchanges data using classic Win32 ReadFile/WriteFile.
Source file has been compiled using MinGW (gcc DigiSFR.c -o DigiSFR).
ATtiny85 requires its own application (DigiSFR.ino)

Demo1.bat batch configures and lights on/off PB1 Led target.

Demo2.bat batch configure and read 10-bit ADC temperature sensor target.
« Last Edit: September 10, 2017, 05:07:26 am by wop »