-
Notifications
You must be signed in to change notification settings - Fork 228
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
[NUC123] USB driver bug fixes #244
[NUC123] USB driver bug fixes #244
Conversation
f7f7b58
to
395ec32
Compare
As an update:
|
@alexclewontin this is the pull request. I added the config from your USB testhal. I guess the board init may not be working. |
@fishman using your config, plus the updates in this PR, plus this:
added to the end of my
Actually I'm not even sure |
I tried your board and disabling mousekeys(not sure why that should matter) and it doesn't work. your testhal works(as in a usb device shows up), maybe you have some usb init in the usbcfg that's incompatible with the way qmk inits? It's a little frustrating to be honest. The hal and mcu config should be the same as yours except for usb_wait. Can you check the branch I posted above? |
@fishman Using your exact I'm sorry it's frustrating; unfortunately this is the nature of debugging embedded software remotely. I think we're making progress here though. Please give this a try |
The CI failure has nothing to do with this commit/platform |
ChibiOS stable branch is broken, I'll open a bug report |
Fix went live |
@alexclewontin still not working. What's frustrating about it isn't debugging. It's that it was working and since it's a complete rewrite it's not easy to see where the error is. I get that your code is a lot cleaner and better than the original implementation, so I appreciate that. |
I've just tested it again. The keyboard is detected, but only sometimes, so it's pretty unreliable. When it is detected it will work for one keypress and then get stuck. |
@fishman right and I get how it is frustrating, but the original driver did not work for some pretty basic test cases. Re the problems: I can reproduce the single keypress & getting stuck (I had assumed that was an issue with the mock GPIO driver I rigged up, but clearly not), but not the unreliability of connection (I can see the keyboard connect every time I plug into the computer). Can you make sure you are using the most recent commit in this PR? If you are, can you set |
f61a553
to
4a84293
Compare
4a84293
to
2d00c0f
Compare
@fishman Okay, I have identified what was causing it to get stuck after one keypress (a continuation of the known hardware bug discussed earlier in this thread) and fixed that issue. As I mentioned, I cannot reproduce the unreliability issue (it shows up every time I connect on my computer), but I have added a couple of delays in the initialization routine, in case that helps. When you try this out, make sure you pull down a fresh copy of this branch, because I squashed the new fix into 891a0b3, as it is essentially one single bug. |
@alexclewontin LGTM, thank you. I noticed this delay missing compared to the other driver. Can you please also removed the unused variable on line 501? |
@alexclewontin I know why you don't see the connection issue. Try to connect your device through a hub and you'll probably run into this issue. |
2d00c0f
to
8c16b4f
Compare
@fpoussin @alexclewontin i'd probably recommend to merge this and add the rest in a separate pr. |
Thanks :) |
@fishman without knowing the exact configuration you're using to build QMK it's hard to say anything for certain, but here are a couple of things I've fixed that may help.
2. I reverted the wake-up/suspend/resume handling to the way the driver handled it previously. My QMK build was (and continues to) having some issues where it was getting stuck asleep. I don't think this is a USB issue, and This more likely has something to do with the dummy matrix scan function I injected not waking the board properly, but on the off chance it might help you, I've changed this back.3. I changed the order of handling bus events & endpoint events. There were situations where the ISR was too slow, which would cause some zero-length packets to get handled out of order, which messes with the EP0 state machine. This probably needs some continued attention, but this tweak might help in the mean time. This problem for me has been very intermittent, however, and so if your computer is categorically not recognizing the keyboard then I would guess this is not what your problem is.If
one of thesethis works, we'll get it committed here. If not, I'll probably need to see your full QMK config files to really be of any additional help.EDIT: Either 2 or 3 caused something to break. I'm pretty sure those weren't your problem though