Closed brentmellor closed 1 day ago
We were able to get the system to link by manually adding the DCD driver to our project's CMakeLists.txt and building it externally. (reverse engineered the example makefiles to find what file was needed)
I had expected TinyUSB to handle including the DCD driver automatically since all the defines needed to select the correct one are in tusb_config.h and the DCD drivers are located in the tinyusb/src folder. Since the logic to select the correct DCD is built into the makefiles for the examples, perhaps it could be added to the CMake build for the static library? At least there should be a note mentioning that externally compiling the DCD is required.
I'll wait to close this issue for a day to see if there's any comments or suggestions.
yeah, it is intended that user have to manually pick the dcd/hcd driver since some mcus can has different usbip on the same mcu, also some mcus can have different driver variant e.g esp32s2 has one with specific dcd_esp32sx and a more generic dwc2 driver.
Thanks for the confirmation, could we get a mention of needing to manually include the DCD file in the CMakeLists or getting started guide? It looks like the information is already available at
Operating System
MacOS
Board
Custom
Firmware
Trying to link TinyUSB as static library into pre-existing STM32U575 codebase. The makefile-based builds for the TinyUSB examples are not suitable for us as we'd need to basically rewrite our existing software.
What happened ?
TinyUSB when built from the provided tinyusb/src/CMakeLists.txt file as a static library compiles and builds library file. However when attempting to use it, the project fails to link with missing references to the DCD driver functions that should have been included in TinyUSB.
Example build output:
How to reproduce ?
Our main project CMakeLists invokes and links everything with something like this (real file has a lot of libraries):
The
tinyusb.cmake
file defines the CMake target "tinyusb_config" to exposetusb_config.h
and launch the actual TinyUSB CMake file you provide in your repo.Here's the meat of our
tusb_config.h
, based off the dual-CDC example.Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
N/A - Cannot link static library
Screenshots
No response
I have checked existing issues, dicussion and documentation