2025-12-04 9:24 AM - last edited on 2025-12-04 1:08 PM by STOne-32
Been reading thru the F103 datasheet to try and figure out why my TinyUSB based code isn't working. The datasheet says.. "For mono-directional/single-buffer endpoints, a single register can be used to implement two distinct endpoints".
The F103 has 8 physical endpoint registers. There are no flags in those registers to set mono or bidirectional mode. Each register only holds one EP address value.
My application requires creating EP0 (IN+OUT) + 4 * (Bulk IN+Bulk OUT+Interrupt In)=2+4*(1+1+1)= 14 EP addresses in total.
The datasheet continues on to say "The number of registers is 8, allowing up to 16 mono-directional/single-buffer or up to 7 double-buffer endpoints(a) in any combination. For example the USB peripheral can be programmed to have 4 double buffer endpoints and 8 single-buffer/mono-directional endpoints."
So how can you get 14 EP addresses into 8 endpoint registers?
2025-12-04 10:19 AM
> The datasheet continues on to say "The number of registers is 8, allowing up to 16 mono-directional/single-buffer or up to 7 double-buffer endpoints(a) in any combination. For example the USB peripheral can be programmed to have 4 double buffer endpoints and 8 single-buffer/mono-directional endpoints."
Can you link to the datasheet that says this? I can't find it. "STM32F103" unfortunately doesn't narrow down a single datasheet.
Here is a F103 datasheet that does not say this. Checked a few others as well.
https://www.st.com/resource/en/datasheet/stm32f103ze.pdf
> So how can you get 14 EP addresses into 8 endpoint registers?
I suspect it is not possible to have 14 independent endpoint addresses.
In any case:
2025-12-04 11:47 AM
In F103, you may configure up to 8 pairs of IN+OUT endpoints (or 8 double-buffered, single direction endpoints), so the maximum possible no. of CDC VCPs is 3 (Control IN+OUT, 3*CDC data IN+OUT, 3*CDC notification IN). Both endpoints in a pair must be of the same type, so you cannot combine interrupt IN with bulk OUT in a single pair. With 3 CDCs, one pair remains free, so you may add some other device, like MSC or printer.