USB_SendControl()

Adafruit's tiny microcontroller platform. 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
Stolk
 
Posts: 19
Joined: Sat Oct 30, 2021 11:10 am

USB_SendControl()

Post by Stolk »

Does anyone know why Trinket M0 builds fail when linking, if I try to use USB_SendControl() function?

It works just fine when I use it on ItsyBitsy 32U4 builds.

Code: Select all

Arduino: 1.8.13 (Linux), Board: "Adafruit Trinket M0, Small (-Os) (standard), Arduino, Off"
Archiving built core (caching) in: /tmp/arduino_cache_195164/core/core_adafruit_samd_adafruit_trinket_m0_opt_small,usbstack_arduino,debug_off_d53cd4b49ba6ff60d7721159bd65a417.a
/home/bram/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: sketch/RawHID.cpp.o: in function `RawHID_::getInterface(unsigned char*)':
sketch/RawHID.cpp:65: undefined reference to `USB_SendControl(unsigned char, void const*, unsigned char)'
/home/bram/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: sketch/RawHID.cpp.o: in function `RawHID_::getDescriptor(USBSetup&)':
sketch/RawHID.cpp:81: undefined reference to `USB_SendControl(unsigned char, void const*, unsigned char)'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit Trinket M0.
This is when using the Arduino IDE with the trinket M0.

USB_SendControl() is part of the core API, as can be seen here:
https://github.com/arduino/ArduinoCore- ... i/USBAPI.h

User avatar
Stolk
 
Posts: 19
Joined: Sat Oct 30, 2021 11:10 am

Re: USB_SendControl()

Post by Stolk »

This seems to have been addressed up-stream, if I read this correctly:

https://github.com/NicoHood/HID/commit/ ... 208246c253

I'll check if I can upgrade my IDE, to get this fix. (I am on Ubuntu 21.04, and arduino IDE 1.8.13)

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

Return to “Trinket ATTiny, Trinket M0”