DeqingSun / ch55xduino

An Arduino-like programming API for the CH55X
GNU Lesser General Public License v2.1
433 stars 85 forks source link

Keyboard with boot protocol enabled #150

Open OmerFS opened 10 months ago

OmerFS commented 10 months ago

Hello,

ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/HidKeyboard compiled to ch552 mcu HID working fine on windows and linux. it is not working on bios

How to made work on bios screen?

(by the way, it is working on new model computers bioses but not working on a bit old bioses like Asus N550JV)

Thanks in advance

DeqingSun commented 10 months ago

I can confirm the emulated keyboard does not work on the boot screen of a Mid-2014 macbook pro while a real Dell keyboard does work. So there must be some implementation problem in the boot protocol. I will take a look soon.

DeqingSun commented 10 months ago

For progress record:

There is some progress in https://github.com/DeqingSun/ch55xduino/blob/ec3b8958397dac77035ab4ae40cd06331b51320d/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/HidKeyboard/src/userUsbHidKeyboard/USBhandler.c that deal with HID report access on EP0. More work need to be done to do get EP0 IN work properly.

DeqingSun commented 10 months ago

@OmerFS I seems get it working on my Mac in boot screen. Let me know if this example work for you.

https://github.com/DeqingSun/ch55xduino/tree/19f3f8c1b5a86ab0c537f0cf059bbe71e6849bd1/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/HidKeyboard

DeqingSun commented 5 months ago

Updated in https://github.com/DeqingSun/ch55xduino/commit/b0067f063695398002138cd4994aa96d9a7055df No response from @OmerFS, consider fixed.

OmerFS commented 5 months ago

Hello i am sorry for not returning in time i saw your post in my mail today i have variety of old notebooks i will test and post the results thank you so much.

OmerFS commented 5 months ago

Hello i tested new update on 3 laptops ; Dell Latitude E6330 Fujitsu Lifebook LH532 Asus N550JV

it works on windows but it didn't work in bios screen i also changed keyboardProtocol varible but results were same;didn't work (//0 is boot protocol, 1 is report protocol __xdata uint8_t keyboardProtocol = 1; from 1 to 0 but it didnt work again) my humble opinion i suggest you to check stm32 libraries and HID-project library. i was able to make it with stm32 mcu using cubeide generated code for arduino(pro micro) i used HID-project both of them worked.

DeqingSun commented 5 months ago

Thanks for sharing. I suppose there must be some USB request that I did not handle properly.

I'll check it this weekend with a real windows machine. I suppose the bios in windows and mac still handle the USB differently.

DeqingSun commented 5 months ago

I've tested it on Lenovo Thinkpad t410 2518-f4u 2010 Acer Aspire 4930 JAL90 2008 They both work in Bios. I'll take a look at the other projects.

I tried to use

      Keyboard_press(KEY_DOWN_ARROW);
      delay(100); //a quick capslock press is not recognized on mac
      Keyboard_release(KEY_DOWN_ARROW);

And the cursor can be moved in BIOS