cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 USB endpoints capabilities / usage questions

BJero.1
Associate II

Hi,

I'm trying to understand the capabilities of the STM32 USB endpoints (lets say at the moment, I wan't to evaluate the USB using the STM32F429ZI Nucleo board, but my question might be portable to any STM32 with USB).

1/ It's not clear to me if an endpoint can be used both as IN and OUT at the same time (I mean, endpoint 1 has a set of register for IN and OUT functionality) ? It seems that it is possible but I'd like to be sure.

2/ I8f answer to question 1 is that IN and OUT can be used at the same time, is there any condition ? I've read here (https://community.st.com/s/question/0D50X0000A7WRvGSQW/which-stm32-supports-16-usb-endpoints-and-4-uartsusarts, third reply of the topic) that when using an endpoint with both IN and OUT feature, the type of transfer must be the same for one endpoint (i.e BULK on IN and OUT is possible, but BULK on IN and INTR on OUT is impossible)

3/ Still if the answer to question 1 is OK, then can one endpoint be used for Isochrnous transfer in both direction (let's say to use only one endpoint for Audio data transfer) ?

Regards, Jerome

4 REPLIES 4

> but my question might be portable to any STM32 with USB

Surprisingly maybe, but no. There are two very different USB modules used across the STM32 world - the OTG USB (an IP purchased from Synopsys) as in 'F105/107/'F2/'F4/'F7/'H7, and a device-only module (although in its latest incarnation host was added, so I now don't how to call it - it's probably an ST in-house development) used in 'F103/'F0xx/'F3xx/'L0/low-end 'L4/'G0/'G4.

> 1/ It's not clear to me if an endpoint can be used both as IN and OUT at the same time

By USB standard, In and Out endpoints of the same number are entirely separate simplex channels, see USB2.0 5.3.1. EP0 has In and Out endpoint bound together by the special requirement for "control pipe", through a higher-level protocol; but other than EP0, other endpoints are entirely independend from each other.

However, the device-only module has an unnecessary restriction, that endpoints of the same number must have the same type; this probably stems from its rather ancient legacy (https://community.st.com/s/question/0D53W00001SN1DbSAL/stm32f37x-usb-endpoints-and-their-toggle-bits 7th and 9th reply, by me).

The Synopsys OTG module which is in 'F4 has no such restriction, AFAIK.

JW

BJero.1
Associate II

Hi JW,

Thanks for these answers.

Can you tell me if the STM32U5 series are also using the 'device-only' IP ?

If I've understood correctly, then with 4 endpoints (both IN and OUT), I can create 2 CDC-ACM interfaces using for each 1 enpoint (OUT part used only) for the "control" channel, and one endpoint (IN and OUT parts) for the data flow.

What about the Isochronous endpoints ? Can I also use one "full" endpioint (IN and OUT parts) for data transfers (from host, and to host) ?

Regards, Jerome

BJero.1
Associate II

Well, the STM32U5 is not 'device-only', but Full-Speed only, sorry.

> Can you tell me if the STM32U5 series are also using the 'device-only' IP ?

No, it's the Synopsys OTG module.

0693W00000LxFuzQAF.png> If I've understood correctly, then with 4 endpoints (both IN and OUT), I can create 2 CDC-ACM interfaces

Yes, you need EP0, 2 pairs of In/Out endpoints and 2 In endpoints (not Out - note, that the definition in standard is such that In/Out is always from the point of view of the host, i.e. In for device is Tx, Out for device is Rx).

> What about the Isochronous endpoints ? Can I also use one "full" endpioint (IN and OUT parts) for data transfers (from host, and to host) ?

I dont' understand the question. "isochronous" is the property of the endpoint. As I've told you, inherently In and Out endpoints of the same number are entirely independent, it's only ST's device-only module which couples them due to inadequately designed hardware.

JW