Author Topic: Custom Keyboard Report Length with STM32  (Read 2104 times)

0 Members and 1 Guest are viewing this topic.

Offline synonzelra

  • Thread Starter
  • Posts: 7
Custom Keyboard Report Length with STM32
« on: Sun, 14 January 2018, 07:52:49 »
Hi everyone, my first post here!

So I'm building my first custom keyboard with stm32f103 like this:
http://www.keyboard-layout-editor.com/#/gists/cbc891e877fe8dccde8bddf10aa38e6b.

My first firmware works well with standard 6-KRO, {modifiers, reserve, key0, key1, key2, key3, key4, key5}

I'm trying to improve to make it at least 10-KRO, so I change the report descriptor to 10 and also change struct to 10 keys accordingly, but then non of the keys work.

Pretty sure that the chip works with full-speed 12MBitps with max package size of 64 Bytes, so I wonder if I'm missing something?

Thanks

Code: [Select]
__ALIGN_BEGIN static uint8_t HID_KEYBOARD_ReportDesc[HID_KEYBOARD_REPORT_DESC_SIZE]  __ALIGN_END =
{
      0x05, 0x01,                         // Usage Page (Generic Desktop)
      0x09, 0x06,                         // Usage (Keyboard)
      0xA1, 0x01,                         // Collection (Application)

//Modifiers
      0x05, 0x07,                         //     Usage Page (Key Codes)
      0x19, 0xe0,                         //     Usage Minimum (224)
      0x29, 0xe7,                         //     Usage Maximum (231)
      0x15, 0x00,                         //     Logical Minimum (0)
      0x25, 0x01,                         //     Logical Maximum (1)
      0x75, 0x01,                         //     Report Size (1)
      0x95, 0x08,                         //     Report Count (8)
      0x81, 0x02,                         //     Input (Data, Variable, Absolute)

//Reserveds
      0x95, 0x01,                         //     Report Count (1)
      0x75, 0x08,                         //     Report Size (8)
      0x81, 0x01,                         //     Input (Constant) reserved byte(1)

//Regular Keypads
      0x95, 0x06,                         //     Report Count (normally 6)
      0x75, 0x08,                         //     Report Size (8)
      0x26, 0xff, 0x00,
      0x05, 0x07,                         //     Usage Page (Key codes)
      0x19, 0x00,                         //     Usage Minimum (0)
      0x29, 0xbc,                         //     Usage Maximum (188)
      0x81, 0x00,                         //     Input (Data, Array) Key array(6 bytes)

      0xC0                                // End Collection (Application)
};

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
Re: Custom Keyboard Report Length with STM32
« Reply #1 on: Sun, 14 January 2018, 09:40:34 »
  Ah - the first report must be identical to the 6kro report, additional descriptors may support more exciting HID reports, but they will not be available until an OS has booted and  brought up a HID parser. :]
  Take a look at the way it is done in some of the OSS firmwares, hasu's TMK, haata's kiibohd, etc... and you may also have some fun reading the HID and HUT USB specs too at USB.org, though they are dry, wordy and ambiguous. :/

just woke up, need coffee
dfj
Fave Switch manus: IBM, Topre, Matias, ...