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

The USB freeze bug is back #136

Closed
mondalaci opened this issue Jul 4, 2018 · 9 comments
Closed

The USB freeze bug is back #136

mondalaci opened this issue Jul 4, 2018 · 9 comments
Labels

Comments

@mondalaci
Copy link
Member

mondalaci commented Jul 4, 2018

@eltang @Lauszus I am shocked to see that the freeze bug is still an issue in https://github.com/UltimateHackingKeyboard/firmware/tree/v8.3.3

According to my findings, the bug only shows itself when the USB test #ifdef clause is 0, otherwise the firmware seems to be rock stable.

Any ideas?

@mondalaci mondalaci added the bug label Jul 4, 2018
@mondalaci
Copy link
Member Author

Please don't dedicate a significant amount of time to this bug yet, guys. I'm in the process of testing older commits to see where it went wrong. If you have some quick ideas, you're welcome to throw them at me.

@eltang
Copy link
Contributor

eltang commented Jul 5, 2018

Does the freeze occur during idle? If so, is the amount of time it takes to happen consistent? I'm thinking the solution might be to send reports during idle.

@mondalaci
Copy link
Member Author

The freeze occurs during typing. I'm not sure how consistent the amount of time is because now that the test code is disabled it's significantly harder to reproduce, but I don't think it's very consistent. I hardly believe that sending reports during idle would solve this issue because the firmware seems to be stable when the test code is included, even if it's not triggered. I think it's some sort of low-level issue.

@Lauszus
Copy link
Contributor

Lauszus commented Jul 5, 2018

Can you try to play around with the interrupt priority here:

NVIC_SetPriority(USB_IRQ_ID, 4);

@Lauszus
Copy link
Contributor

Lauszus commented Jul 5, 2018

@eltang the whole point of only sending the reports when the report changes is so it works properly with Windows. This is also how keyboard normally do it.

@eltang
Copy link
Contributor

eltang commented Jul 5, 2018

Please refer to the documentation about HID idle here.

@mondalaci
Copy link
Member Author

Thanks guys!

I was testing ef7589d which seems to be bug free.

In the meantime, I talked to @Lauszus and he said that this might be due to a GCC bug, and it's worth to play with the opimization flags. I switched to master, and flashed the debug build which shouldn't be optimized. So far so good. I'll be keeping you in the loop.

@laxu
Copy link

laxu commented Jul 10, 2018

Can confirm this is still happening on 8.3.3. Hopefully a fix is found soon as I can deal with having to reconnect it from time to time over not having working sleep and media keys.

@mondalaci
Copy link
Member Author

After testing the most recent firmware 8.4.0 for about 100 hours, I'm confident that this bug has gone.

Excellent work, team!

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

No branches or pull requests

4 participants