Skip to content
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

LDF can't work with latest Adafruit TinyUSB on any setting #4838

Open
1 task done
maxgerhardt opened this issue Jan 23, 2024 · 1 comment
Open
1 task done

LDF can't work with latest Adafruit TinyUSB on any setting #4838

maxgerhardt opened this issue Jan 23, 2024 · 1 comment
Assignees
Labels
bug ldf Library Dependency Finder

Comments

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jan 23, 2024

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Windows 10 x64

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.13

Description of problem

A Atmel SAM project that attempts to include Adafruit TinyUSB library of the latest version (2.3.2 down to and including 2.2.2) fails to properly compile, not finding the SPI.h header declared in the Adafruit_USBH_Host.h file. Version 2.2.1 compiles fine, because it did not have an include for SPI.h.

The LDF fails to find the dependency on SPI.h no matter the lib_ldf_mode setting (deep+, deep, chain, chain+ tested and failed). This makes this library impossible to compile for the board in PlatformIO.

Per community topic.

Steps to Reproduce

  1. Use platformio.ini and src/main.cpp provided below
  2. Build
  3. Observe build failure
  4. Change version to adafruit/Adafruit TinyUSB [email protected] and rebuild
  5. Observe build success

Actual Results

Compiling .pio\build\busylight\lib4ff\Adafruit_ZeroDMA\Adafruit_ZeroDMA.cpp.o
Compiling .pio\build\busylight\lib361\SPI\SPI.cpp.o
In file included from .pio\libdeps\busylight\Adafruit TinyUSB Library\src/Adafruit_TinyUSB.h:76,
                 from C:\Users\Max\.platformio\packages\framework-arduino-samd-adafruit\libraries\Adafruit_ZeroDMA\Adafruit_ZeroDMA.cpp:35:
.pio\libdeps\busylight\Adafruit TinyUSB Library\src/arduino/Adafruit_USBH_Host.h:30:10: fatal error: SPI.h: No such file or directory

Expected Results

Compiles fine

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:busylight]
platform = atmelsam
board = adafruit_neotrinkey_m0
framework = arduino
lib_deps=
    adafruit/Adafruit TinyUSB [email protected]
lib_archive = no
build_flags=
    -DUSE_TINYUSB
lib_ldf_mode = deep+
lib_ignore = USBHost

Source file to reproduce issue:

#include <Arduino.h>
#include "Adafruit_TinyUSB.h"

void setup() {}
void loop() {}

Additional info

Especially concerning are the messages in verbose mode that the LDF fail to evalute the TinyUSB macro TU_CHECK_MCU correctly.

Warning! Classic Pre Processor is used for C:\Users\Max\temp\trinkey\.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_TinyUSB_API.cpp, advanced has failed with Incorrect number of arguments to TU_CHECK_MCU'Warning! Classic Pre Processor is used forC:\Users\Max\temp\trinkey.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_USBD_CDC.cpp, advanced has failed with Incorrect number of arguments to TU_CHECK_MCU'
Warning! Classic Pre Processor is used for C:\Users\Max\temp\trinkey\.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_USBD_Device.cpp, advanced has failed with Incorrect number of arguments to TU_CHECK_MCU'Warning! Classic Pre Processor is used forC:\Users\Max\temp\trinkey.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_USBH_Host.cpp, advanced has failed with Incorrect number of arguments to TU_CHECK_MCU'

@maxgerhardt maxgerhardt changed the title LDF can't work with Adafruit TinyUSB on any setting LDF can't work with latest Adafruit TinyUSB on any setting Jan 23, 2024
@ivankravets ivankravets added this to the 6.1.14 milestone Feb 7, 2024
@ivankravets ivankravets added help wanted ldf Library Dependency Finder labels Feb 7, 2024
@valeros
Copy link
Member

valeros commented Feb 7, 2024

Hi @maxgerhardt, thanks for reporting. I've reproduced the issue and it seems it's caused by a circular dependency between Adafruit TinyUSB, Adafruit Zero DMA and SPI libraries. I'm wondering if the latest versions of the TinyUSB library are compatible with their SAMD core. The libraries in the SAMD repo were updated just yesterday and they still prefer to stick to a quite old version 1.4.7 of the Adafruit TinyUSB library for some reason.

As a workaround I'd recommend using the library version bundled with the framework package at the moment.

@ivankravets ivankravets removed this from the 6.1.14 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ldf Library Dependency Finder
Projects
None yet
Development

No branches or pull requests

3 participants