carlossless / sinowealth-kb-tool

A utility for reading and writing flash contents on Sinowealth 8051-based HID devices through the commonly found ISP bootloader
MIT License
52 stars 13 forks source link

Add support for RK84 ISO keyboard #46

Closed Luro02 closed 4 months ago

Luro02 commented 4 months ago

This PR should close #45. It is a mystery to me why it did not initially find my keyboard and now it works.

carlossless commented 4 months ago

@Luro02 I'll test the reboot functionality and take a look at this in about a week or two. :+1:

Luro02 commented 4 months ago

As mentioned in https://github.com/carlossless/sinowealth-kb-tool/issues/45#issuecomment-1975096189 the real issue is that it selects the wrong device for request/data. For fixing this, we need to differentiate between the two devices, the problem is that they only differ in the path:

DEBUG [sinowealth_kb_tool::isp] Found Request Device {
  path: "\\\\?\\HID#VID_0603&PID_1020&Col02#8&2da0b3f2&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}",
  vendor_id: 0x0603,
  product_id: 0x1020,
  serial_number: Some(""),
  serial_number_raw: None,
  release_number: 256,
  manufacturer: Some("(Standard system devices)"),
  product: Some(""),
  product_raw: None,
  usage_page: 0xff00,
  usage: 0x0001,
  interface_number: 0,
  bus_type: Usb,
}
DEBUG [sinowealth_kb_tool::isp] Found Data Device {
  path: "\\\\?\\HID#VID_0603&PID_1020&Col03#8&2da0b3f2&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}",
  vendor_id: 0x0603,
  product_id: 0x1020,
  serial_number: Some(""),
  serial_number_raw: None,
  release_number: 256,
  manufacturer: Some("(Standard system devices)"),
  product: Some(""),
  product_raw: None,
  usage_page: 0xff00,
  usage: 0x0001,
  interface_number: 0,
  bus_type: Usb,
}

I pushed a temporary solution that swaps them if the selected request device has &0002 in the path.

carlossless commented 4 months ago

Hey @Luro02,

Thanks for all your efforts here! I used your changes to create https://github.com/carlossless/sinowealth-kb-tool/pull/47.

I did a couple of adjustments on top of your PR:

Also, I was able to successfully reboot my air60 when using your bootloader! However, I noticed that this cfc8661d bootloader is not recognized as an HID device by macOS. I started documenting this in the readme.

I'll close this PR, so let's continue the discussion on https://github.com/carlossless/sinowealth-kb-tool/pull/47