-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Digispark CDC library doesn't work #10
Comments
Very interesting: the DigisparkKeyboard/Keyboard.ino demo works and the computer recongizes the USB device. But not with the CDC sketch.. |
FWIW, CDC (serial port) works but is very unstable under Linux (it makes eventually the Linux general host USB stack hang). |
@d-a-v Thanks for the info. |
The same behavior occurrs btw with the original core (https://github.com/digistump/DigistumpArduino/). There are some forum topics about this (http://digistump.com/board/index.php/topic,2720.msg13422.html#msg13422) with some posts like
Another post (http://digistump.com/board/index.php/topic,2321.msg13159.html#msg13159) talks about deactivating Windows's driver signing and installing a magic driver (https://github.com/protaskin/LowCDC-Win10x64). I don't want to risk a BSOD like in the issue of that repo though 😅. |
So I think, it is a good idea to extend the examples with these links and a warning. I will do this... Update: Done 😀 |
Is there any alternative way of serial communication directly from usb? or at least any other possible software based way, except from deactivating Windows's driver signing? (I'm looking for a way to communicate between a Digispark and a PC's USB port) it’s been bugging me for hours now.. |
Has anyone ever tried TinyUSB with this core ? |
Personally, I wish i could but my knowledge on this subject is quite a bit baffled... and so I'm not that sure about how i could manage to get it working right now [...] |
The general DigisparkUSB and also DigisparkCDC library use V-USB as the underlying USB library, and it also has a few words on CDC
which we don't observe here.. so I'm not sure if any USB CDC actually works on modern operating system with non-hacked drivers with the low-speed AVRs. On the other hand, here's a echo example, from what I see it uses a generic HID USB class here. The USB functions HID set report and HID get report are used to transfer data to the device. And this looks like a nice easy tool to send and receive HID reports for data exchange. Maybe you can even use libusb or some python libs. |
Not working for me either. Anyone has any recommendations for some similar libraries? |
I recommend cleaning the chip manually first. This command will clear the chip.
Then return to IDE and try flashing the chip again. |
@simonovich so you have the situation that it does work in the Arduino IDE but not over PlatformIO, or have you not tested it via PlatformIO? |
Sorry, I don't know anything about PlatformIO. |
None of the DigisparkCDC examples are working on macOS. Please remove them. There is no way to get Arduino's Serial Monitor to work. |
I have Ubuntu LTS. |
There are questions about the work of Serial on CDC.
|
I recall having gotten DigisparkCDC to work in the past on modern Windows but I have no idea how I did it. I tried now to change some of the settings in the the I changed the setting on line 328 from |
I will try to install the driver on older versions of Windows and give updates. I'm curious if we can update the V-USB part of DigisparkCDC, as it may be an older version.
So I have figured out the driver install error, the driver was attempting to install a service using the When the |
Long story short, I got it working, at least for my use-case. Since the plain echo-sketch ( https://gist.github.com/brandsimon/0cf7166eefb2282bbeaa405f8cac8f8c#file-echo-ino ) worked (more or less) reliable with less then 36 characters, I took time to dig deeper. It turns out, that the device does still work after the first 8 characters, if a character is sent back. Since my communication is line-based, I choose the new line character. Here is my longer story, I wrote down some of my observations as I made them:
I improved the situation a bit by increasing the RX ring buffer size, but the board does still not work reliable. The problem is definitely the receiving side, since a lot of longer hard-coded prints work like a charm.
I just copied the files from
However it did not fix my problem. The changes seam also quite minor to me. When I got my digispark, I had problems on one laptop, while another worked fine. After some research I found out that these problems are common. The bitbanged USB support is known to be unreliable due to timing issues. However, using a USB-hub did not solve my issue with DigiCDC. Since I thought the problem is related to timing issues, I tried to fix them in the In my research I found out that all rev3 boards of the digispark are counterfeit https://digistump.com/wiki/digispark/quickref and sadly I have one of them. I have the impression, that digistump did not produce digisparks for years. So I don't know if I have problems because of cheap/wrong parts in my digispark. I also have a weird behavior when using a big global variable: https://gist.github.com/brandsimon/0cf7166eefb2282bbeaa405f8cac8f8c#file-echo_broken-ino |
Tested with the reference sketch
https://github.com/ArminJo/DigistumpArduino/blob/master/digistump-avr/libraries/DigisparkCDC/examples/CDC_LED/CDC_LED.ino
Uploading works fine, but as soon as the bootloader exits and the USB CDC device is supposed to be created..
Translated: "USB device was not recognized. The last USB device that has been connected to this computer, did not work ordinarily and wasn't recognized by Windows."
Device manager says
"The USB device has returned an invalid USB configuration descriptor".
Tested board is the http://digistump.com/products/1
Selected Arduino IDE settings
Drivers were installed as per https://github.com/ArminJo/DigistumpArduino#driver-installation.
The text was updated successfully, but these errors were encountered: