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

usb_usb: SET_PROTCOL/SET_IDLE can fail on some keyboards #738

Closed
tmk opened this issue May 5, 2022 · 1 comment
Closed

usb_usb: SET_PROTCOL/SET_IDLE can fail on some keyboards #738

tmk opened this issue May 5, 2022 · 1 comment

Comments

@tmk
Copy link
Owner

tmk commented May 5, 2022

Anne Pro2 replys to SET_PROTOCOL/SET_IDLE request with STALL for no reason.
It is a boot keyboar interface and should support the requests.

https://geekhack.org/index.php?topic=69169.msg3123567#msg3123567

Fix:
The converter will continue to work even when the requests fails.

tmk added a commit that referenced this issue May 5, 2022
- SET_PROTOCOL can fail on some devices #738
@tmk tmk closed this as completed May 5, 2022
@tmk
Copy link
Owner Author

tmk commented Oct 21, 2022

HHKB Hybrid doesn't work with this fix.

diff --git a/hidboot.h b/hidboot.h
index 4fe83ff..f00c1f2 100644
--- a/hidboot.h
+++ b/hidboot.h
@@ -462,7 +462,7 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed
         for(uint8_t i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
                 USBTRACE2("\r\nInterface:", i);
                 rcode = SetProtocol(i, bRptProtoEnable ? HID_RPT_PROTOCOL : USB_HID_BOOT_PROTOCOL);
-                if(rcode) goto FailSetProtocol;
+                //if(rcode) goto FailSetProtocol;
                 USBTRACE2("PROTOCOL SET HID_BOOT rcode:", rcode);
                 rcode = SetIdle(i, 0, 0);
                 USBTRACE2("SET_IDLE rcode:", rcode);

tmk/USB_Host_Shield_2.0@007760d

MAX3421e replies with hrJERR to SET_PROTCOL and SET_IDLE at first time for some reason.

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
Ci BM Init
Ci Addr:01
Ci NC:01
HID_PROTOCOL_KEYBOARD
Ci Ci bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
crSU:0D
PROTOCOL SET HID_BOOT rcode:0D
crSU:0D
SET_IDLE rcode:0D
crSU:0D
RPIPE rcode:0D
BM configured
host.Task: 2318
usb_state: 90
speed: full
crSU:0D

It seems hrJERR indicates no activity on the bus while device is there. The keyboard is not ready yet and hidboot configuring process should be retried, perhaps. It works at second try.

Fixed at tmk/USB_Host_Shield_2.0@ad5ce99

usb_state: 20
usb_state: 40
usb_state: 50
usb_state: 51
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
SetProto:0D
BM Init
Addr:01
NC:01
HID_PROTOCOL_KEYBOARD
bNumEP:02
Cnf:01
bIfaceNum:00
bNumIface:00

Interface:00
PROTOCOL SET HID_BOOT rcode:00
SET_IDLE rcode:00
RPIPE rcode:00
BM configured
host.Task: 4735
usb_state: 90
speed: full

tmk added a commit to tmk/USB_Host_Shield_2.0 that referenced this issue Oct 21, 2022
Anne Pro2 replies with STALL, which means it doesn't support.
We continue rest of process anyway.
HHKB Hybrid causes hrJERR, which means it is not ready probably.
It needs retry for this error.
tmk/tmk_keyboard#738 (comment)
tmk added a commit that referenced this issue Oct 21, 2022
- hidboot SET_PROTOCOL/SET_IDLE fix #738
- merge upstream
tmk added a commit to tmk/USB_Host_Shield_2.0 that referenced this issue Dec 25, 2022
Anne Pro2 replies with STALL, which means it doesn't support.
We continue rest of process anyway.
HHKB Hybrid causes hrJERR, which means it is not ready probably.
It needs retry for this error.
tmk/tmk_keyboard#738 (comment)
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

1 participant