Author Topic: DigiCDC  (Read 28062 times)

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #15 on: January 10, 2015, 12:05:07 pm »
It felt odd having a running example so I tried to break it adding this to the end and it worked with plain text - so I decided to put in F() to see it break - and it did not.  The RAM must be the critical factor [269 okay , over 300 and pulling any flash strings breaks] - NOTE: these LONG strings are printing full speed (9).  Except for defining 'unsigned long time = 0;' the above example was unchanged - with this segment replacing the last if(Serial ...).  This sample at delay speed (9) in the DigiCDC is 1.67 secs and with a delay of (45) it is 7.5 secs.

Code: [Select]
  if ( 0 == SerialUSB.available() ) {
    SerialUSB.println (HP_columns);
    blink_swap(10);
    if ( time ) time = millis() - time;
    blink_swap(10);
    if ( 14 < time ) {
      SerialUSB.print(F("]END["));
      SerialUSB.refresh();
      SerialUSB.print("[[time>");
      SerialUSB.refresh();
      SerialUSB.println( time );
      SerialUSB.refresh();
      SerialUSB.print(F("Too1MuchRamDontBreak"));
      SerialUSB.refresh();
      SerialUSB.print(F("Too2MuchRamDontBreak"));
      SerialUSB.refresh();
      SerialUSB.print("TooMuchRamDontBreak");
      SerialUSB.refresh();
    }
  }
« Last Edit: January 10, 2015, 01:42:59 pm by defragster »

JeffRand

  • Newbie
  • *
  • Posts: 44
Re: DigiCDC
« Reply #16 on: January 10, 2015, 02:23:16 pm »
I'll have to try your sketch after I figure out a way for my PC's to recognize the devices. I've tried both my Digispark originals and my Digispark Pros. Both give the "Invalid Configuration Descriptor" error messages. What OS are you using?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #17 on: January 10, 2015, 02:34:54 pm »
Running Win7 x64 primarily. Some Win8.1 that work when I last used those machines.

This is a decent sketch as it runs on a RAW board with just a USB cable.  Though I'm not sure it will work well until the pending release after 1.5.8B

This is an oddity 'assertion' error - I just figured I should write it down in case anything ever comes of it as it is the only error I see that is out of the blue and it comes from the IDE during upload - possibly from hitting reset at the wrong time if the upload started.

I don't recognize your 'descriptor' error.  My Pro's typically connect and work as expected.  They are only a USB device for 5 seconds - unless your sketch is running USB support.  Other than that they are just there for the power, until a reset or re-plug to upload.  I've done OLED and Serial sketches, and recently the CDC that is a USB device and they work reasonably.  I did the driver install as in the Wiki (either from the download .exe or the zip and run the driver install).  Once that was done the system complains or works but no drastic errors other than 'device not recognized' as expected.  If the error persists try the usual random shuffle changing: Cable / Port / Hub.  I've seen too many changes too fast can get the USB lost and then seems to stabilize after 5 minutes.
« Last Edit: February 10, 2015, 02:06:22 am by defragster »

JeffRand

  • Newbie
  • *
  • Posts: 44
Re: DigiCDC
« Reply #18 on: January 10, 2015, 02:53:38 pm »
I've had no trouble with any of my Digisparks at all and use them for all sorts of things. I'm only having trouble with CDC giving the descriptor error. I've tried cold booting everything and various hubs, cables and PC's and all give the descriptor error that the original poster was also seeing. I'll have to try one of my XP or Windows 7 machines when I get a chance. I would just like to get it working on my 8.1 machines, as I use them for all of my dev work now.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #19 on: January 11, 2015, 09:40:01 pm »
On my Win8.1 machine - works with OLED (old and new) code - can download the CDC too - but gives 'device not recognized' error [same as win7], so it isn't seeing valid USB.

I recreated my User Account - so this is a fresh install.

Had a bad cable that failed any uploads - never saw device, other cable here uploads anything fine.

Yet to see any error like: "Invalid Configuration Descriptor
« Last Edit: February 10, 2015, 02:05:49 am by defragster »

JeffRand

  • Newbie
  • *
  • Posts: 44
Re: DigiCDC
« Reply #20 on: January 12, 2015, 08:00:43 am »
Yes, that is the message you see from the taskbar. But, if you look at the device manager, you will see the "Invalid Configuration Descriptor" error message.


defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #21 on: January 12, 2015, 01:31:57 pm »
In going to my NEW Win 8 box for the 3rd time in a year (wow faster!) I realize it was using the OLD 1.5.8B CDC - I'll have to run the GitHub stuff there.

Never bothered looking deeper as the message only came up when expected.

Would be interesting to know if that same problem description info presents running BLINK and CDC sketches.  If the CDC code description is unique from the BLINK error detail might be interesting - if the same it just says 'device not acting like a known usb device'

http://blogs.msdn.com/b/usbcoreblog/archive/2012/06/08/new-for-windows-8-problem-descriptions-for-usb-devices-and-hubs-in-device-manager.aspx

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #22 on: January 12, 2015, 02:44:03 pm »
Non USB sketch for OLED not showing 'unknown device' error message in Win8.

USB CDC sketch for 'unknown device' DevMan indeed shows the extended:
Quote
Windows has stopped this device because it has reported problems. (Code 43)

The USB device returned an invalid USB configuration descriptor

Then the IDE spews this NEW message on connecting to the COM1 it shows (usually no COM# seen when in error):
Quote
>> Micronucleus done. Thank you!
processing.app.SerialException: Error opening serial port 'COM1'.
   at processing.app.Serial.<init>(Serial.java:145)
   at processing.app.Serial.<init>(Serial.java:90)
   at processing.app.SerialMonitor.open(SerialMonitor.java:93)
   at processing.app.Editor.handleSerial(Editor.java:2537)
   at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:357)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: jssc.SerialPortException: Port name - COM1; Method name - openPort(); Exception type - Port busy.
   at jssc.SerialPort.openPort(SerialPort.java:164)
   at processing.app.Serial.<init>(Serial.java:141)
   ... 35 more
Error opening serial port 'COM1'.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #23 on: January 12, 2015, 03:14:50 pm »
Tried again compiling on Win8 with a different sketch that worked on Win7 and the heartbeat blink is running the TEST ECHO output, the device is in the error code 43 state , but the IDE sees COM1 and opens the SMonitor and thinks it is sending - but the heartbeat doesn't change so (with the device in error) it is not receiving/sending.

INDEED: Taking that same device immediately to my Win7 box the IDE sees COM21 and connects and the sketch is running as expected, including the SLOW LONG OUCH delay(45) on serial writes.

So I see a Win 8 problem it seems connecting to the GitHub Pending 1.5.8C release CDC library code.

And further: I modified the CDC code delay(45) to a delay(9) and reprogrammed on Win8 to the same failed end, walk to Win7 and it is powered up and running and responding FAST as expected.

Quote
NOTE: I have a MOUSE sketch that I uploaded and it is working on Win8:
> First with the library from 1.5.8B
> AGAIN using the GitHub pending 1.5.8C

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: DigiCDC
« Reply #24 on: January 12, 2015, 04:16:06 pm »
@JeffRand, defragster, and all - it looks like I need to do something special with the inf file for this to work on certain versions of Win8 - it works fine on my win8 but I'll test some more this week and see if I can duplicate the issue - thanks for all the details!

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #25 on: January 15, 2015, 03:01:10 pm »
I don't know if this relates to Win 8 - I will try ASAP, I'll bet double or nothing it does:

@EK: I refined my idea on the delay in DigiCDC:
void DigiCDCDevice::begin(){
    usbBegin();
   if (millis() <1000)
      DigiCDCDevice::delay(1000 - millis() );
}

My OLED can print millis() as fast as 375.
I then immediately:
  SerialUSB.begin();
  oled.println(millis());
And the next number I see is 1001 for Millis.  And all is well on USB CDC.



CURIOSITY: Infinite REBOOT LOOP with this code and a dozen variations if you do too much too fast with oled - but print millis() ok.
Code: [Select]
void setup() {
  // initialize the digital pin as an output.
  oled.begin();
  oled.clear(); //all black
  oled.setCursor(0, 0); //top left
  oled.setFont(FONT6X8);
  oled.println(millis());
  SerialUSB.begin();
  oled.println(millis());
  SerialUSB.setDelay(6);
  SerialUSB.print(F("Too1MuchRamDontBreak1_"));
  oled.println(millis());
}

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #26 on: January 15, 2015, 10:32:12 pm »
1.5.8C release:
Timing adjustment ( various attempts ) didn't keep Win8 from failing to recognize the device - and from with the OLED I saw that the PRO reboots when the first serialUSB.print is done.  With the ~6 second in delays the USB came online so the IDE could see it - then poof - gone.

OTG on my Phone with "Android USB Serial Monitor Lite" and it failed too - PRO does the same and reboots.

Wondering if the 'computer' asks device to reset when the recognition fails?

MSFT on code 43: http://technet.microsoft.com/en-us/library/cc725873(v=WS.10).aspx

and "When you get this error with USB devices it’s because one of the drivers controlling the device notified the operating system that the device failed in some manner"
http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/error-code-43-when-usb-not-recognised/6a2a5531-8b80-4798-9aa6-ee2dcb705c7f

Since my 'fall 2014' phone and Win8 act the same it seems there is a failure to 'comply with expectations', the second link (from 2010) above has directions to trace and log the event, will post results if it runs.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiCDC
« Reply #27 on: January 15, 2015, 10:48:30 pm »
Found ref that gave a trace file - huge and not human readable - opens in Event Viewer.

Reference was here: http://msdn.microsoft.com/en-us/library/windows/hardware/jj151573(v=vs.85).aspx

It was on USB 3 port - same net effect on USB 2.  In this log for time sync on the code 43 see this time frame:

Source:        Microsoft-Windows-USB-USBHUB3
Date:          1/15/2015 10:42:40 PM
Event ID:      43
Task Category: Prepare Hardware
<Data Name="fid_DeviceDescription">Digispark Bootloader</Data>

Source:        Microsoft-Windows-USB-USBHUB3
Date:          1/15/2015 10:42:48 PM
Event ID:      43
Task Category: Prepare Hardware

Source:        Microsoft-Windows-USB-USBHUB3
Date:          1/15/2015 10:42:53 PM
Event ID:      43

** Tried repeat on USB 2 port to log and there was no Device recognized to fail, but it did power - cycle - and restart
« Last Edit: January 15, 2015, 11:17:50 pm by defragster »

metatron99

  • Newbie
  • *
  • Posts: 1
DigiSpark Virtual Com Port INF is invalid
« Reply #28 on: April 10, 2015, 08:24:53 pm »
I am also having the same problem. The Device manager shows that the DigiSpark com port is recognized. But has a failure which is this...

A Service installation section in this INF is invalid

which usually means it is looking for a particular setup that's it deems is incorrect.

I am on window 8 pro. And everything works just fine except trying to get the virtual com port working.

cromagn

  • Newbie
  • *
  • Posts: 2
Re: DigiCDC
« Reply #29 on: August 15, 2015, 04:17:54 pm »
I solved  this issue for windows 7 changing the DigiSerial.inf file in this way

[DriverInstall.NTamd64.CopyFiles]
usbser.sys
lowcdc.sys


More detailed info on my blog http://cromagn.blogspot.it/2015/08/usb-cdc-for-digispark-serial-on-windows.html