Skip to content
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

SAMD21 USB does not enumerate on Windows #33

Open
deanm1278 opened this issue Sep 5, 2018 · 6 comments
Open

SAMD21 USB does not enumerate on Windows #33

deanm1278 opened this issue Sep 5, 2018 · 6 comments

Comments

@deanm1278
Copy link
Contributor

Hello!
I can no longer get Circuit Playground to enumerate on Windows 10. Works on Linux, Mac, iOS. It does work on the Makecode live site, but does not work when I compile regular codal from the current master branch.
Note that I tried reverting my recent PR #32
it still does not work

here is the code I am using:

#include "CircuitPlayground.h"
#include "USB_HID_Keys.h"
#include "HIDKeyboard.h"
CircuitPlayground cplay;
CodalUSB usb;
USBHIDKeyboard hid;
static const char *string_descriptors[] = {
    "Example Corp.", "PXT Device", "42424242",
};
void typeDot(Event)
{
    hid.type(".");
}
void typeDash(Event)
{
    hid.type("-");
}
int main()
{
    usb.stringDescriptors = string_descriptors;
    usb.add(hid);
    usb.start();
    //we need a bit of a delay for USB
    cplay.sleep(500);
    cplay.messageBus.listen(DEVICE_ID_BUTTON_A,DEVICE_BUTTON_EVT_CLICK,typeDot);
    cplay.messageBus.listen(DEVICE_ID_BUTTON_B,DEVICE_BUTTON_EVT_CLICK,typeDash);
    release_fiber();
}
@ladyada
Copy link

ladyada commented Oct 2, 2018

@jamesadevine @pelikhan @mmoskal hihi poking this, if anyone has any suggestions or can try replicating? (both dean and i found this bug)

@jamesadevine
Copy link
Contributor

Thank you for the poke @ladyada.

After some LED debugging (my favourite kind), I realised that the program above was not even hitting main.

A bad change on my part to the Serial interface meant that it was using an uninitialised pin instance (I don't know how I didn't catch this on my test... compiler magic?).

Anyway, fixed:

lancaster-university/codal-circuit-playground@326efd9

and tagged:

lancaster-university/codal-circuit-playground@5b11a92

@finneyj
Copy link
Contributor

finneyj commented Oct 2, 2018

thanks @jamesadevine.

@jamesadevine
Copy link
Contributor

@finneyj The enumeration issue still exists on Win 10, that I have not fixed yet. I have reproduced locally, just acquiring the correct software to debug...

@finneyj
Copy link
Contributor

finneyj commented Oct 2, 2018

ahh... I was about to print you a gold star. ;)

@jamesadevine
Copy link
Contributor

If only I could ever be worthy... 😉

From my usb analyser now know the reason for non-enumeration on win10 – it's because the cplay does not return a device descriptor, it says there is "No such device". More debug required, but I got to dash.

@mmoskal do you have any cycles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants