Error with SemanticVersionError: Invalid simple block '^'

Hello,

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?

What’s the full platformio.ini here?

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:pico]
platform = raspberrypi
board = pico
framework = arduino
lib_deps = adafruit/Adafruit TinyUSB Library@=3.3.4

Instead of “=” I have Also trieded the automatic"^" and to wrote nothing. same issure every time

Try using just lib_deps = adafruit/Adafruit TinyUSB Library@3.3.4, then deleting the entire .pio folder of the project to avoid caching issues.

1 Like

done it, same issure, new project with same librarys, same issure

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.

grafik

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:

grafik