Here are the conclusions up front where they won't get lost. Forget it! TinyUSB is not a complete system, not even a complete library. It is sort of like having a transmission without an engine (and/or drive shaft). It might be great with the other pieces, but without them you won't get far.
In the case of the STM32F103, there is a driver of sorts (another nasty thing from ST) and it is incomplete. It seems to assume you are using it in the context of CMSIS and/or STM32CubeF1 and references include files that are not part of TinyUSB. It looks to me like TinyUSB took one drive file out of Cube, customized it so that it fits into TinyUSB, but expects you to also have the rest of Cube.
An update (as of 11-2024 from Valentijn Sessink -- thanks!).
To get the missing pieces, the trick is to run the "get-deps" command
which will get the correct platform headers.
In the case of RP2040, I haven't looked all that deeply. I would just use the Pico SDK (which includes TinyUSB). Again, by itself TinyUSB only provides part of what you need, so just go to the SDK to get the whole potatoe.
This seems to be done in the tradition of all USB documentation. They tell you about 30 percent of what you need to know. I am not sure just what it is. When people drop through the rabbit hole and start working with USB they seem unable to communicate with people who are not in their world.
A very nice example (they do give examples) is tinyusb/examples/device/cdc_dual_ports which implements a pair of serial ports that echo characters while changing their case.
The best bet may be to learn how to use TinyUSB in the context of the RP2040. There we have examples that seem to be set up to yield full working code. If we get that figured out, maybe we can tackle TinyUSB and the STM32F103.
And alongside of that file is dcd_stm32_fsdev_pvt_st.h which has code like this:
#elif CFG_TUSB_MCU == OPT_MCU_STM32F1 #include "stm32f1xx.h" #define PMA_LENGTH (512u)
This is all well and good, but where is stm32f1xx.h? I find this file on my system in STM32/ST/Cube/STM32CubeF1/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h which I just happen to have because I downloaded "Cube" back in 2017 or so, but that is sheer accident and it is certainly not part of TinyUSB.
Some searches relative to stm32f1xx.h lead me to this:
Yikes! Yet another USB stack for the STM32, but this one clearly says that is requires CMSIS V4 or CMSIS V5 -and- the stm32.h STM32 universal header.The conclusion - Tiny USB is not a standalone library like I thought, but something (I'm not sure just what) that can be included as part of some other system (just what other system is unclear).
I looked at the RP2040 bootrom briefly. They use files from TinyUSB, but they do not use TinyUSB in what I would call a normal way, or in a way that I can help me learn to get started.
Just in passing, I will note the following directories:
tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill tinyusb/hw/bsp/stm32f4/boards/stm32f407blackvetHow about that? Two different F4 "blackpill" boards and something called a "blackvet"
Here is the black VET:
But we have now wandered entirely off topic.Tom's Computer Info / tom@mmto.org