TinyUSB with ItsyBitsy M0

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Mnuckols
 
Posts: 27
Joined: Wed Sep 30, 2020 9:18 am

TinyUSB with ItsyBitsy M0

Post by Mnuckols »

I have the ItsyBitsy M0 Express and I'm trying to use the TinyUSB library with it, but I just get errors when I compile.

My versions:
Arduino 1.8.13
Adafruit TinyUSB Library 1.4.2 (installed through library manager)

Arduino IDE Settings:
Board: Adafruit ItsyBitsy M0
USB Stack: TinyUSB
Debug: Off
Port: COM16 (Adafruit ItsyBitsy M0)

Steps:

1. Plug in a never-before-used ItsyBity (purchased in January 2021) to USB
2. Choose the hid_gamepad example (all examples have some type of error)
3. Click Verify (or Upload)
4. See errors highlighting line (also attached in image): Adafruit_USBD_HID usb_hid;

Code: Select all

hid_gamepad:31:19: error: cannot declare variable 'usb_hid' to be of abstract type 'Adafruit_USBD_HID'
   31 | Adafruit_USBD_HID usb_hid;
      |                   ^~~~~~~
In file included from C:\Users\Matt\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/Adafruit_TinyUSB.h:42,
                 from C:\Users\Matt\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\examples\HID\hid_gamepad\hid_gamepad.ino:12:
C:\Users\Matt\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\src/arduino/hid/Adafruit_USBD_HID.h:30:7: note:   because the following virtual functions are pure within 'Adafruit_USBD_HID':
   30 | class Adafruit_USBD_HID : public Adafruit_USBD_Interface {
      |       ^~~~~~~~~~~~~~~~~
In file included from C:\Users\Matt\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.6.3\cores\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/Adafruit_TinyUSB_Core.h:35,
                 from C:\Users\Matt\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.6.3\cores\arduino/Arduino.h:154,
                 from sketch\hid_gamepad.ino.cpp:1:
C:\Users\Matt\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.6.3\cores\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/Adafruit_USBD_Device.h:38:22: note: 	'virtual uint16_t Adafruit_USBD_Interface::getDescriptor(uint8_t, uint8_t*, uint16_t)'
   38 |     virtual uint16_t getDescriptor(uint8_t itfnum, uint8_t* buf, uint16_t bufsize) = 0;
      |                      ^~~~~~~~~~~~~
hid_gamepad:33:1: error: 'hid_gamepad_report_t' does not name a type; did you mean 'hid_keyboard_report_t'?
   33 | hid_gamepad_report_t    gp;     // defined in hid.h from Adafruit_TinyUSB_ArduinoCore
      | ^~~~~~~~~~~~~~~~~~~~
      | hid_keyboard_report_t
C:\Users\Matt\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\examples\HID\hid_gamepad\hid_gamepad.ino: In function 'void setup()':
hid_gamepad:52:11: error: 'TinyUSBDevice' was not declared in this scope; did you mean 'USBDevice'?
   52 |   while( !TinyUSBDevice.mounted() ) delay(1);
      |           ^~~~~~~~~~~~~
      |           USBDevice
C:\Users\Matt\Documents\Arduino\libraries\Adafruit_TinyUSB_Library\examples\HID\hid_gamepad\hid_gamepad.ino: In function 'void loop()':
hid_gamepad:72:3: error: 'gp' was not declared in this scope
   72 |   gp.x       = 0;
      |   ^~
exit status 1
cannot declare variable 'usb_hid' to be of abstract type 'Adafruit_USBD_HID'

Am I missing a library or step?
Attachments
TinyUSB Error.jpg
TinyUSB Error.jpg (301.96 KiB) Viewed 112 times

User avatar
hathach
 
Posts: 1270
Joined: Tue Apr 23, 2013 1:02 am

Re: TinyUSB with ItsyBitsy M0

Post by hathach »

can you attach the full compile log as txt files. Also which SAMD BSP version you are using, if it is not latest, please update to the latest version (at this time is 1.7.2)

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”