2020-04-24 02:51 AM
[STM32F303][USB FS] Isochronous endpoint: 1 ms frame with a large buffer.
Hello,
I would like to know how I could setup an isochronous endpoint with a large payload.
USB specification and RM0316 manual:
These encouraging words are followed by this enigmatic phrase:
However, the applicable size is limited by the available buffer memory.
Does "available buffer memory" refers to the USB SRAM?
So, is it correct that I could never setup a payload buffer greather than ~256B?
Let me try to briefly explain myself with the following SRAM allocation schema (ischronous endp uses double buffer feature):
+-------------------------------------------------+
| SRAM (512B) |
+--------+---------+--------+----------+----------+
| BTABLE | ep0 out | ep0 in | ep1 isoc | ep1 isoc |
+--------+---------+--------+----------+----------+
| 16B | 64B | 64B | yB | yB |
+--------+---------+--------+----------+----------+
For this example assume that BTABLE contains configurations for ep0 and ep1 only (16 Bytes)
y = (512-16-64-64)/2 = 184 bytes.
Also, by shrinking ep0 to 8 bytes, we have:
y = (512-16-8-8)/2 = 240 bytes.
In this simple (and optimistic) case, how could I setup an ISOC endp that could send more than 240 bytes inside a 1ms frame (bInterval = 1) ?
Thank you for the support.
2020-04-24 04:55 AM
Why the /2?
Btw. which 'F303? The 'F303D/E have 1024B USB buffer.
JW
2020-04-24 05:42 AM
The /2 is needed because ISOC use double buffer feature that permits to switch from ADDRn_Tx and ADDRn_Rx of a single ep foreach frame.
Is it correct?
However also without double buffer the upper limit is 480B.
With 303xE I could use all 1024B (without CAN bus), so upper limit (using previuous example) will be 440B.
y = (1024-16-64-64)/2 = 440 bytes.
There is no way to use a larger buffer? Is it a known limitation?
Thanks.
2020-04-24 06:36 AM
> The /2 is needed because ISOC use double buffer
Ah, I see, yes, that makes sense.
> There is no way to use a larger buffer?
Not in 'F303.
> It is a known limitation?
How do you mean? It's a parameter of USB module in this particular STM32 model, in the same way as the number of endpoints; it's given in the DS/RM.
You'd need to use a different STM32 model. I don't know if there are models which have the device-only module with more than 1kB USB RAM but I don't think so. Even in the 'F4 with two USB OTG modules, one of them (FS) has only 1.25kB of buffer, only the HS has 4kB.
JW
2020-04-24 08:07 AM
DS describe USB as USB2.0 compliant. In RM the phrase "However, the applicable size is limited by the available buffer memory" is the only that reports a limitation.
In my opinion is not pretty clear this restriction.
Thanks for your support. I'll select ST family/size for my application in a better way.