i´m coding for an rapberry pi pico and have made a new project and addet the Adafruit TinyUSB Library version 3.3.4. no matter witch code I have written I got the following outputs in my debugg terminal:
Processing pico (platform: raspberrypi; board: pico; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------
Removing unused dependencies...
SemanticVersionError: Invalid simple block '^'
* The terminal process "C:\Users\lucag\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
Somebody who knows why this is happening and how to fix?
I’m not getting the ^ issue you’re getting, but in any case, the ArduinoCore-mbed and the Adafruit TinyUSB library are not good friends. I’m getting compilation errors with stuff trying to redefine itself and not matching the function signature for some APIs…
C:\Users\Max\.platformio\packages\framework-arduino-mbed\cores\arduino/Arduino.h:107:16: error: conflicting declaration 'Adafruit_USBD_CDC _UART_USB_'
107 | #define Serial _UART_USB_
| ^~~~~~~~~~
lib\Adafruit TinyUSB Library\src\arduino\Adafruit_USBD_CDC.h:101:23: note: in expansion of macro 'Serial'
101 | #define SerialTinyUSB Serial
| ^~~~~~
lib\Adafruit TinyUSB Library\src\arduino\Adafruit_USBD_CDC.cpp:44:19: note: in expansion of macro 'SerialTinyUSB'
44 | Adafruit_USBD_CDC SerialTinyUSB;
| ^~~~~~~~~~~~~
lib\Adafruit TinyUSB Library\src\arduino\Adafruit_USBH_Host.cpp: In function 'bool tuh_max3421_spi_xfer_api(uint8_t, const uint8_t*, uint8_t*, size_t)':
lib\Adafruit TinyUSB Library\src\arduino\Adafruit_USBH_Host.cpp:276:43: error: no matching function for call to 'arduino::HardwareSPI::transfer(const uint8_t*&, uint8_t*&, size_t&)'
276 | spi->transfer(tx_buf, rx_buf, xfer_bytes);
| ^
Those errors should be reported to the Adafruit TinyUSB repo. I don’t think the library is easily compatible as of now. But, they have their own PluggableUSB eco system, so sketches like USBHID/examples/Keyboard/Keyboard.ino should work perfectly fine. As should all the other USB sketches.
So maybe you don’t need TinyUSB for your project, but can use the builtin libraries above instead?
Another straight-forward, working solution: Don’t use ArduinoCore-mbed. Use Arduino-Pico as your Arduino core implementation instead. There is native support for Adafruit TinyUSB in that core. It has a builtin Adafruit TinyUSB v3.3.3 version (so only one minor version behind the latest release).
You have to do a one-time setup, after that you can just close + upload this TinyUSB HID example: