EspTinyUSB: hidusb.h:10:44: error: 'hid_report_type_t' has not been declared

When I’m trying to compile the keyboard example I get:

In file included from C:\Users\Defozo\Documents\Arduino\libraries\ESP32TinyUSB\src/hidkeyboard.h:2,
                 from C:\Users\Defozo\Documents\Arduino\sketch_apr17a\sketch_apr17a.ino:6:
C:\Users\Defozo\Documents\Arduino\libraries\ESP32TinyUSB\src/hidusb.h:10:44: error: 'hid_report_type_t' has not been declared
     virtual void onData(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) { }
                                            ^~~~~~~~~~~~~~~~~
Multiple libraries were found for "SD.h"
 Used: C:\Users\Defozo\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.0-alpha1\libraries\SD
 Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\SD
exit status 1
Error compiling for board ESP32S2 Dev Module.

I’m using version 1.2.0 of the library.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 43 (19 by maintainers)

Most upvoted comments

Hi all! I make a workaround, but works without HID features.

  1. Clean install of Arduino 1.8.15 for Windows (.EXE)
  2. Open Arduino IDE…
  3. In File -> Preferences, add “https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json” to “Additional Boards Manager URLs”
  4. In Tools -> Board -> Boards Manager…, search for “esp32”, and add “esp32” by “Espressif Systems”, version “2.0.0-alpha1”
  5. In Sketch -> Include Library -> Manage Libraries…, search for “esp32tinyusb”, and add “ESP32TinyUSB” by “Dariusz Krempa”, version “1.2.0”
  6. In Tools -> Board -> ESP32 Arduino -> ESP32S2 Dev Module
  7. Open CDC sample at File -> Examples -> ESP32TinyUSB -> cdc
  8. if you build now will fail, so, go to File Explorer…
  9. Search for file "Documents\Arduino\libraries\ESP32TinyUSB\src\classes and remove both folders “hid” and “midi”
  10. Come back to Arduino IDE and you are ready to build and upload firmware to board

Ok then, it looks like there is plenty of changes in tinyusb i have to address. Thanks for testing and reporting

It has been merged into master and should fix it.

It is issue in arduino-esp32 and we have to wait till it will be updated in next release version: https://github.com/espressif/arduino-esp32/issues/5101

I can do nothing with it, but if you want to use any other class but hid, then you can delete all files related to HID from this library.

Yes, it is problematic now, since esp32-s2 and idf-release/v4.2 branch has been deleted. You could for now checkout to some older commit that was idf-release/v4.2: https://github.com/espressif/arduino-esp32/tree/71e2142c7f73a043331c42ecdd900b3c2c81b84a

When i have time i will try to find cause and fix it under v2.0.0.