cancel
Showing results for 
Search instead for 
Did you mean: 

Which STM32 supports 16 USB endpoints and 4 UARTS/USARTS

Olovskos
Associate II

Hello,

I am searching for this since 2 days but the only things I found are missleading.

This

(https://www.st.com/content/ccc/resource/training/technical/product_training/98/89/c8/6c/3e/e9/49/79/STM32L4_Peripheral_USB.pdf/files/STM32L4_Peripheral_USB.pdf/jcr:content/translations/en.STM32L4_Peripheral_USB.pdf)

document from ST mentions that the STM32L4 supports 16 Endpoints but in every datasheet it only says that the devices can handle only 8 Endpoints...

Do they mean 8 Bi-directional Endpoints or am I looking for the wrong device?

As mentioned before, I am looking for the cheapest 16 Endpoint USB, 4 Uart STM32

Thanks

5 REPLIES 5
Uwe Bonnes
Principal III

STM32H7 has

· 1 bidirectional control endpoint0

· 8 IN endpoints (EPs) configurable to support bulk, interrupt or isochronous transfers

· 8 OUT endpoints configurable to support bulk, interrupt or isochronous transfers

as of rm0433.

For L4(R) I only see: 1 control and 5 in and 5 out. For "cheap" consider check the DTM32H730.

Olovskos
Associate II

Thank you for your answer. Unfortunately there is no device DTM32H730 nor a STM32H730.

Also, I don`t know what you consider cheap but the STM32H7 are, by far, the most expensive MCUs that I have ever seen...

I am talking about something like 5$@10k

I could go with NXPs because they have 3$ MCUs with the specs I need (16 Bi-Directional endpoints, 5Uarts)

But I would like to use STM32 devices.

Thanks

Ben K
Senior III

The cheapest STM32's with USB might also fit your requirements. The USB Device (as it's called in CubeMX) has 8 bi-directional endpoints (including EP0), but you can only use them all if you use the same endpoint types on each IN-OUT pair, e.g. 0x81 and 0x01 EPs are both bulk, etc. You also cannot use double-buffering and therefore isochronous endpoints. If these conditions are met, you can just use the CubeMX filters to find the cheapest STM32 with both USB Device and 4 UARTs.

Olovskos
Associate II

That is exactly what I was asking for :)

I want to make a composite CDC Device to get 4 virtual com ports. What I found so far is, that I need:

  • One interrupt IN endpoint for notifications to the USB Host
  • One bulk IN and one bulk OUT endpoint for data transfer

So I can use 5 Endpoints for:

  1. EP0 IN and OUT
  2. CDC1 One bulk IN and one bulk OUT
  3. CDC2 One bulk IN and one bulk OUT
  4. CDC3 One bulk IN and one bulk OUT

Then I would have left 4 Endpoints and could configure them as:

  1. CDC1 interrupt IN
  2. CDC2 interrupt IN
  3. CDC3 interrupt IN

So it seems that I can only get a total of 3 virtual com ports out of 8 Endpoints, is that correct?

Do I really need the "interrupt IN endpoint for notifications to the USB Host" for each CDC device?

Ben K
Senior III

For me Windows 10 recognizes the CDC as serial port without the notification endpoint, but you have to check on your choice of operating system. The good thing about the USB Device peripheral (this doesn't hold for OTG) is that you can just assign unused endpoints to out-of-range numbers (such as 0x8F), and it will simply NACK the host requests on them. So even if your host OS requires a notification EP for each serial port, you can just set the endpoint numbers to 0x8A, etc in the descriptor, without handling them in the device at all.

Software-wise you can start out with this project of mine: https://github.com/IntergatedCircuits/DebugDongleFW

You can just extend the VCP interface code to handle an array of channels and remove the rest of the functionality.

Edit: with 4 CDC functions used, the USB config descriptor will be quite long, make sure you set USBD_EP0_BUFFER_SIZE to high enough that it fits in the buffer.