Skip to content

Platformio and tud_vendor_control_xfer_cb #506

@snaens

Description

@snaens

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions