Skip to content

Platformio and tud_vendor_control_xfer_cb #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
snaens opened this issue Mar 10, 2025 · 0 comments
Open

Platformio and tud_vendor_control_xfer_cb #506

snaens opened this issue Mar 10, 2025 · 0 comments
Labels
Bug Something isn't working

Comments

@snaens
Copy link

snaens commented Mar 10, 2025

Operating System

Linux

Arduino IDE version

Platformio

Board

pi pico

ArduinoCore version

earlephilower

TinyUSB Library version

latest

Sketch as ATTACHED TXT

[env:pico]

platform = raspberrypi
board = rpipico
framework = arduino
board_build.core = earlephilhower

lib_archive = false

build_flags =
  -DUSE_TINYUSB
.
├── platformio.ini
└── src
    ├── Adafruit_USBD_I2C.cpp
    ├── Adafruit_USBD_I2C.h
    └── i2c_tiny_usb_adapter.ino

Compiled Log as ATTACHED TXT

<truncated>
PLATFORM: Raspberry Pi RP2040 (1.15.0+sha.e95c19c) > Pico
HARDWARE: RP2040 133MHz, 256KB RAM, 2MB Flash
Converting i2c_tiny_usb_adapter.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 69 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit TinyUSB Library @ 3.4.1
|-- Wire @ 1.0
Compiling .pio/build/pico/src/i2c_tiny_usb_adapter.ino.cpp.o

What happened ?

The way tud_vendor_control_xfer_cb is linked in Adafruit_USBD_WebUSB.cpp causes runtime-only errors that are remarkably hard to track down, as they cause no compilation hiccups.

Emptying src/arduino/webusb/Adafruit_USBD_WebUSB.* is a workaround.

This platformio thread recomended trying lib_archive = false, which didn't work for me
or using extern "C" {...} around the tud_vendor_control_xfer_cb function, which also didn't work, I think because the function is a class member?

How to reproduce ?

Try to compile the i2c example in platformio.

Debug Log

No response

Screenshots

No response

@snaens snaens added the Bug Something isn't working label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant