cancel
Showing results for 
Search instead for 
Did you mean: 

USB communication only via control transaction (EP0)

dr.look
Associate II

I need to write an application which should communicate only via endpoint 0, i.e. using only control transactions. My question is whether this is possible with STM32 family (regardless of the series (F0, F1, ...)). I think that it should be possible according to this video: https://www.youtube.com/watch?v=DJiWi5aJA44

8 REPLIES 8

Every USB device is capable communicating via EP0, by definition of USB.

Whether you can implement it easily using any arbitrary "library" such as Cube, is another question.

JW

dr.look
Associate II

I know that every USB device should be able to communicate via EP0 but not all stacks allow this. So my question is about the STM USB Stack, which is available via CubeMX.

TDK
Guru

The CubeMX library does not have a custom USB communication device code that only communicates only via EP0, if that's what you're asking. This isn't a standard device, so it would require drivers on the PC side as well. Not sure USB allows non-control/config stuff to be sent over EP0.

If you feel a post has answered your question, please click "Accept as Solution".

> Not sure USB allows non-control/config stuff to be sent over EP0.

How do you define control/config stuff?

USB2.0 9.3.1 bmRequestType (of 9.3 USB Device Requests):

The USB Specification defines a series of standard requests that all devices must support. These are

enumerated in Table 9-3. In addition, a device class may define additional requests. A device vendor may

also define requests supported by the device.

There are no constraints on Vendor requests in the standard.

It's an inefficient way to transfer data, but possible.

> This isn't a standard device, so it would require drivers on the PC side as well.

By "standard device" you here mean class-compliant device. OP is certainly aware of this, since his question is rather specific.

JW

dr.look
Associate II

I have to implement a vendor specific device using the provided ST template. The current application is running on the old MCU which is no longer available and I need to replace it for a new one. This means that I have the PC drivers and the non-control data can certainly be sent too.

I don't use Cube, but I'd recommend you to have a look at how the standard control (EP0) requests are implemented, and hook on there.

JW

Pavel A.
Evangelist III

The DFU class is example of device class that uses only the EP0 for its functionality.

As for the host (PC) side, look at this.

Thank you for the tip.