WebUSB not working anymore with SAMD Board Version > 1.8.10
Opened this issue · 1 comments
I discovered that your WebUSB does no longer work when installing newer SAMD-Board versions.
The default WebUSB example work for SAMD Board version 1.8.9.
But it does not work anymore for version 1.8.10 and above.
I am using a MKRWiFi1010 board.
The error message is :
fatal error: USB/PluggableUSB.h: No such file or directory
#include "USB/PluggableUSB.h"
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino MKR WiFi 1010.
Any idea what to do ?
If downgrading SAMD core to version 1.8.9 as described in #84 (comment) is not an option, you could try to update library/WebUSB/WebUSB.h by including path to "api/PluggableUSB.h"
and changing uint32_t
to unsigned int
when compiling for ARDUINO_API_VERSION
and above. That ARDUINO_API_VERSION
value is defined automatically when building for core 1.8.10 and above.
I've tried to do it in my fork and I've setup CI on Github Actions to verify it actually compiles on different platforms after changes. I must admit that my main purpose was to test it with Arduino Nano 33 IoT, but as I remember despite successfully compiling, still I haven't been able to run provided examples - device was not detected by browser. Unfortunately I haven't spent enough time to debug this problem. Eventually I've ended up switching to Adafruit fork of ArduinoCore-samd with TinyUSB with files for Arduino Nano 33 IoT copied from upstream repository and used Adafruit_TinyUSB_Arduino to handle WebUSB in experimental Blazor app.