XIAO as USB HID device?

TinyUSB for XIAO. Better than a standard use case. @sinking

1 Like

我也想用XIAO来做一个HID设备 但是不知道怎么使用 TinyUSB 请问有这个XIAO做HID设备的教程吗? 谢谢拉

http://wiki.seeedstudio.com/Wio-Terminal-USBCLIENT-Overview/ @TALWT264 给,老铁!!!

我下载了那个库文件安装好了 用这个库文件自带的示例代码写不进去不知道怎么回事。

编译的时候要选tinyUSB, 在“工具”那里选,你也可以把编译上传日志打开,可以显示更多的信息 @TALWT264

还是烧录的时候出现错误 难搞哦

@TALWT264 检查下XIAO的板子库是否是我们最新的版本

最新的板子库url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

我看了一下 板子的库是1.7.2的

I have managed to get the Xiao working as a HID using CircuitPython. I’m going to take some time to write a tutorial and I’ll come back and share it in the near future!

1 Like

@hellweaver666 sounds good news!

And can’t wait for your tutorial :grinning:

1 Like

可以打开设置的详细编译信息 我们看看详细的信息 帮助debug @TALWT264

1 Like

请问是这个详细信息吗?

Arduino:1.8.12 (Windows 10), 开发板:“Seeeduino XIAO, TinyUSB, Off”

E:\编程\Arduino\arduino-builder -dump-prefs -logger=machine -hardware E:\编程\Arduino\hardware -hardware C:\Users\小滔\AppData\Local\Arduino15\packages -tools E:\编程\Arduino\tools-builder -tools E:\编程\Arduino\hardware\tools\avr -tools C:\Users\小滔\AppData\Local\Arduino15\packages -built-in-libraries E:\编程\Arduino\libraries -libraries E:\aaa\Arduino\libraries -fqbn=Seeeduino:samd:seeed_XIAO_m0:usbstack=tinyusb,debug=off -vid-pid=0X2886_0X002F -ide-version=10812 -build-path C:\Users\小滔\AppData\Local\Temp\arduino_build_980318 -warnings=default -build-cache C:\Users\小滔\AppData\Local\Temp\arduino_cache_74925 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.openocd.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.openocd-0.9.0-arduino.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.bossac.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.7.0 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.CMSIS.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0 -verbose E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Arduino-master\examples\HID\hid_keyboard\hid_keyboard.ino
E:\编程\Arduino\arduino-builder -compile -logger=machine -hardware E:\编程\Arduino\hardware -hardware C:\Users\小滔\AppData\Local\Arduino15\packages -tools E:\编程\Arduino\tools-builder -tools E:\编程\Arduino\hardware\tools\avr -tools C:\Users\小滔\AppData\Local\Arduino15\packages -built-in-libraries E:\编程\Arduino\libraries -libraries E:\aaa\Arduino\libraries -fqbn=Seeeduino:samd:seeed_XIAO_m0:usbstack=tinyusb,debug=off -vid-pid=0X2886_0X002F -ide-version=10812 -build-path C:\Users\小滔\AppData\Local\Temp\arduino_build_980318 -warnings=default -build-cache C:\Users\小滔\AppData\Local\Temp\arduino_cache_74925 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.openocd.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.openocd-0.9.0-arduino.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.bossac.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.7.0 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.CMSIS.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0 -verbose E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Arduino-master\examples\HID\hid_keyboard\hid_keyboard.ino
Using board ‘seeed_XIAO_m0’ from platform in folder: C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2
Using core ‘arduino’ from platform in folder: C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2
Detecting libraries used…
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=”"“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp” -o nul
Alternatives for Adafruit_TinyUSB.h: [Adafruit_TinyUSB_Arduino-master@0.9.0 Adafruit_TinyUSB_Library@0.9.0]
ResolveLibrary(Adafruit_TinyUSB.h)
-> candidates: [Adafruit_TinyUSB_Arduino-master@0.9.0 Adafruit_TinyUSB_Library@0.9.0]
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp” -o nul
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_TinyUSB.cpp” -o nul
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_HID.cpp” -o nul
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MIDI.cpp” -o nul
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MSC.cpp” -o nul
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_WebUSB.cpp” -o nul
Generating function prototypes…
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\preproc\ctags_target_for_gcc_minus_e.cpp”
“E:\编程\Arduino\tools-builder\ctags\5.8-arduino11/ctags” -u --language-force=c++ -f - --c+±kinds=svpf --fields=KSTtzns --line-directives “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\preproc\ctags_target_for_gcc_minus_e.cpp”
正在编译项目…
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” "-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp.o”
In file included from C:\Users\��\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp:1:0:

C:\Users\С��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Arduino.h:136:0: warning: “digitalPinToInterrupt” redefined [enabled by default]

#define digitalPinToInterrupt§ ( P )

^

In file included from C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/delay.h:24:0,

             from C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Arduino.h:82,

             from C:\Users\��\AppData\Local\Temp\arduino_build_980318\sketch\hid_keyboard.ino.cpp:1:

C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0/variant.h:54:0: note: this is the location of the previous definition

#define digitalPinToInterrupt§ (g_APinDescription[P].ulExtInt)

^

Compiling libraries…
Compiling library “Adafruit_TinyUSB_Library”
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD “-D__SKETCH_NAME__=”"“hid_keyboard.ino”""" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_TinyUSB.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\libraries\Adafruit_TinyUSB_Library\Adafruit_TinyUSB.cpp.o”
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MSC.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\libraries\Adafruit_TinyUSB_Library\Adafruit_USBD_MSC.cpp.o”
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_WebUSB.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\libraries\Adafruit_TinyUSB_Library\Adafruit_USBD_WebUSB.cpp.o”
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” “-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MIDI.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\libraries\Adafruit_TinyUSB_Library\Adafruit_USBD_MIDI.cpp.o”
“C:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++” -mcpu=cortex-m0plus -mthumb -c -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD “-D__SKETCH_NAME__=””“hid_keyboard.ino”""" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 “-DUSB_MANUFACTURER=“Seeed”” "-DUSB_PRODUCT=“Seeed XIAO M0"” -DUSE_TINYUSB “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Adafruit_TinyUSB_Core/tinyusb/src” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\4.5.0/CMSIS/Include/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino” “-IC:\Users\小滔\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0” “-IE:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src” “E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_HID.cpp” -o “C:\Users\小滔\AppData\Local\Temp\arduino_build_980318\libraries\Adafruit_TinyUSB_Library\Adafruit_USBD_HID.cpp.o”
In file included from E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_TinyUSB.cpp:26:0:

C:\Users\С��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Arduino.h:136:0: warning: “digitalPinToInterrupt” redefined [enabled by default]

#define digitalPinToInterrupt§ ( P )

^

In file included from C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/delay.h:24:0,

             from C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Arduino.h:82,

             from E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_TinyUSB.cpp:26:

C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0/variant.h:54:0: note: this is the location of the previous definition

#define digitalPinToInterrupt§ (g_APinDescription[P].ulExtInt)

^

E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MIDI.cpp: In member function ‘bool Adafruit_USBD_MIDI::send(const uint8_t*)’:

E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MIDI.cpp:117:30: error: ‘tud_midi_send’ was not declared in this scope

return tud_midi_send(packet);

                          ^

E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MIDI.cpp: In member function ‘bool Adafruit_USBD_MIDI::receive(uint8_t*)’:

E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_MIDI.cpp:121:33: error: ‘tud_midi_receive’ was not declared in this scope

return tud_midi_receive(packet);

                             ^

In file included from E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_WebUSB.cpp:26:0:

C:\Users\С��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Arduino.h:136:0: warning: “digitalPinToInterrupt” redefined [enabled by default]

#define digitalPinToInterrupt§ ( P )

^

In file included from C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/delay.h:24:0,

             from C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\cores\arduino/Arduino.h:82,

             from E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library\src\Adafruit_USBD_WebUSB.cpp:26:

C:\Users\��\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.2\variants\XIAO_m0/variant.h:54:0: note: this is the location of the previous definition

#define digitalPinToInterrupt§ (g_APinDescription[P].ulExtInt)

^

“Adafruit_TinyUSB.h” 对应多个库
已使用: E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library
未使用:E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Arduino-master
使用 0.9.0 版本的库 Adafruit_TinyUSB_Library 在文件夹: E:\aaa\Arduino\libraries\Adafruit_TinyUSB_Library
exit status 1
为开发板 Seeeduino XIAO 编译时出错。

As promised, here’s my guide on creating a USB HID keyboard device using Circuit Python on the Seeeduino Xiao! It covers the basic assembly, getting CircuitPython on the Xiao and of course a big chunk of sample code too.

IMG_9432

I’m not an expert by any stretch of the imagination, but I’ll try and answer any questions if I can!

2 Likes

你好,我那个编译错误的问题依然无法解决,请问这个问题有办法解决吗? 谢谢。 :smiley:

噢 我已经成功的在 XIAO上面模拟键盘了, 可能是Aduino IDE1.8.12版本的问题, 我把Adafruit TinyUSB Library的库文件从0.9.0退回到0.8.2的版本之后,使用Adafruit TinyUSB Library的示例文件hid-keyboard,通过TinyUSB上传成功,并且可以模拟键盘按键了。

1 Like

我们做了测试 是tinyUSB那边更新了 旧版本tinyUSB的可以编译 我们马上更新我们的ArduinoCore 更新了就可以用最新版本的tinyUSB了 :smiley:

把板子的驱动更新到1.7.3之后什么都烧写不进去了,不知道是什么情况。

现在1.7.3的bug已经修复了 :smiley:

can you confirm if your keyboard works to wake up a sleeping computer (in other words, does the microcontroller get enough power to trigger the computer to wake up, like a standard keyboard)?

Yes, it simulates the keys on the keyboard.