Author Topic: What's the next step up from basic USB bridge?  (Read 738 times)

0 Members and 1 Guest are viewing this topic.

Offline imacgregTopic starter

  • Contributor
  • Posts: 12
  • Country: us
What's the next step up from basic USB bridge?
« on: January 13, 2024, 10:01:38 pm »
I am pretty familiar with UART to USB bridges (FTDI cables) in microcontroller designs for creating an accessible terminal and that works great for very simple printf/scanf style debug interfaces.

I am starting to work on a project that will consist of a hardware device (with STM32F4) and will need to connect and communicate with custom software running on a PC via USB. Currently we use a UART-USB bridge + COM port/terminal on PC. Eventually the terminal functions will get rolled into custom software.

I am curious about what options exist to replace the UART-USB bridge with something that is more flexible and could support a custom vendor ID. It would still be used for communicating with the hardware F4 via UART, I2C, etc. We would also want to support DFU through this device as well.

Assume that I want to avoid rolling the USB into the hardware master F4. Is there a simple micro out there that would support this? What is the simplest or cheapest or smallest way to get a USB PHY?

Looking forward to suggestions!
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 5907
  • Country: ca
Re: What's the next step up from basic USB bridge?
« Reply #1 on: January 13, 2024, 10:18:28 pm »
check on many nucleo boards on how they implemented usb  from the main mcu in some cases,  other are using  st-link embarqued programmer ??

i dont know why you seem  reluctant to use  integrated usb interfaces,  some have dfu modes / boot loader, usb host mode    etc ...  move a jumper, flash your program, remove jumper do a reset and voila ???

are you short on code size / space ?


but now  ftdi proific and othe usb / uart ic's do not take place on a pcb, you have very small packages under 5mm square, 
thus they can provide some protection too,  you will need to add a few protection on the usb line going into the mcu if its an commercial or industrial use


check for ideas :   sure they use cp2103 uart
https://github.com/SmartArduino/WiFiMCU
https://raw.githubusercontent.com/SmartArduino/WiFiMCU/master/Document/WiFiMCU_SCH.pdf

other approach, i think it was usb to the stm32 no interface      well known board
https://stm32world.com/wiki/Black_Pill

https://github.com/trebisky/stm32f411
« Last Edit: January 13, 2024, 10:28:03 pm by coromonadalix »
 
The following users thanked this post: imacgreg

Offline imacgregTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: What's the next step up from basic USB bridge?
« Reply #2 on: January 13, 2024, 10:36:40 pm »
Hi thanks for the response

Good call on the Nucleo board, I will take a look.

I am reluctant to use an integrated USB interface as it is unclear yet if something beyond a simple bridge is required. Also, due to hardware/space constraints in this design, the bridge is currently/conveniently located on its own small PCB separate from the main MCU board. This allows us to develop the main MCU & hardware while handwaving away the USB stuff, for now.

The amount of handwaving is starting to make me a little nervous which is why I am researching other options...
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: What's the next step up from basic USB bridge?
« Reply #3 on: January 13, 2024, 10:38:31 pm »
There is not an easy solution for that. The amount of effort for working with a universal device like this would be comparable to just using native USB.

Supporting DFU would require extensive communication protocol, so if main MCU can't support USB for some reason, the only real solution is a small dedicated USB MCU and a custom UART/I2C interface.

There won't be an off the shelf device like this, since there is no real market for it.
« Last Edit: January 13, 2024, 10:40:10 pm by ataradov »
Alex
 
The following users thanked this post: imacgreg

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: What's the next step up from basic USB bridge?
« Reply #4 on: January 13, 2024, 10:44:08 pm »
I don't get why you wouldn't want to implement it in the main MCU itself. It's the most flexible solution to implement the exact type of USB device you want. STM32F4 series do support USB, they require an external USB PHY though, but these are very cheap. The PHY just handles the low-level physical interface, the whole protocol controller is on the MCU. ST provides examples for implementing USB devices, you can also use a third-party lib like TinyUSB.
There are of course many other MCUs with an embedded USB controller, many with the PHY integrated as well. (Note that I'm not sure what *you* mean by USB PHY here - it sounds as though you actually mean a USB controller. The PHY is the low-level interface part. A PHY itself is not a USB controller and doesn't do anything useful on its own.)

There's a lot of stuff as far as USB bridges go, beyond USB-UART, if you're looking for that. Just have a look at FTDI's offering, it's rather large with devices implementing HID, or the classic parallel FIFO ones (FT245/FT232H/FT2232H/etc...). There are other vendors with similar solutions too. Be aware that this external "bridge" approach won't allow you to customize the USB interfaces in any way, apart from changing the USB VID/PID and a few other options. But you'll be stuck with whatever interfaces they provide (a vendor class using bulk transfers for the FTDI parallel FIFOs, a HID class for their HID devices, etc.)

So for flexibility, the easiest path it to use a MCU with a USB controller and use that. As I said, the STM32F4 series that you use actually have a USB controller, they just require an external PHY, the controller is still on the MCU.
Examples of such USB PHYs are the USB33xx series (Microchip). Easily available, cheap.
 
The following users thanked this post: imacgreg

Offline imacgregTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: What's the next step up from basic USB bridge?
« Reply #5 on: January 13, 2024, 11:04:49 pm »
Ok thanks guys.

I think ataradov's description of "a small dedicated USB MCU and a custom UART/I2C interface" is closer to what I was asking for in my op. Something that I could design a small board around (I'm not expecting a drop-in COTS part) and add the USB connectivity without changing the main MCU hardware, aside from a uart/i2c connector.

That aside, I am going to review the decision to not use the F4 USB. It makes a lot of sense. I have an F4 Nucleo with USB hardware (in addition to the STLINK USB). Would be silly to not give it a shot. 

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: What's the next step up from basic USB bridge?
« Reply #6 on: January 13, 2024, 11:32:58 pm »
Doing it all in the same MCU does make sense IMO, but you can of course consider using an additional MCU to implement your USB communication if you don't want to modify your existing hardware design.
If USB FS is fine and you don't need HS, going for a RP2040 for the USB would be certainly an option: its price is in the same range as an external PHY like USB33xx required for the STM32F4, and you could offload a number of additional tasks to it.
 
The following users thanked this post: imacgreg

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4437
  • Country: dk
Re: What's the next step up from basic USB bridge?
« Reply #7 on: January 13, 2024, 11:49:44 pm »
Ok thanks guys.

I think ataradov's description of "a small dedicated USB MCU and a custom UART/I2C interface" is closer to what I was asking for in my op. Something that I could design a small board around (I'm not expecting a drop-in COTS part) and add the USB connectivity without changing the main MCU hardware, aside from a uart/i2c connector.

afaict an stlink would be a COTS solution
 
The following users thanked this post: imacgreg

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1555
  • Country: au
Re: What's the next step up from basic USB bridge?
« Reply #8 on: January 14, 2024, 12:22:20 am »
Assume that I want to avoid rolling the USB into the hardware master F4. Is there a simple micro out there that would support this?
What is the simplest or cheapest or smallest way to get a USB PHY?

WCH have choices of HS-USB (TSSOP20) and FS-USB (down to MSSOP10)
https://www.wch-ic.com/products/categories/46.html?pid=1#data

and STC have new MCU+USB parts, in TSSOP20 and SO16 packages, STC8H2K08U / STC8H8K64U, they have CDC examples.
That aside, I am going to review the decision to not use the F4 USB. It makes a lot of sense. I have an F4 Nucleo with USB hardware (in addition to the STLINK USB). Would be silly to not give it a shot. 

You can run both ideas in parallel.
Choose host HW that has USB resource, but start development using the off chip bridge.
That lets SW focus on marketing features now, and later you can decide if the external cost is significant enough to pull in the USB side.


« Last Edit: January 14, 2024, 12:25:15 am by PCB.Wiz »
 
The following users thanked this post: imacgreg

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 690
  • Country: gb
    • Electronic controls
Re: What's the next step up from basic USB bridge?
« Reply #9 on: January 14, 2024, 12:50:06 am »
If you dont need the speed then using a bridge is fine.

It took me quite a while to get a USB interface working with a PIC micro despite been given some software that did the basics.
I had to get involved with MPLAB Harmony to set up USB.
The the provided code had to be expanded for my own taks.
 
The following users thanked this post: imacgreg

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: What's the next step up from basic USB bridge?
« Reply #10 on: January 14, 2024, 01:52:30 am »
Quote
something that is more flexible and could support a custom vendor ID.
Are you aware that the FTDI chips (or at least some of them) have a utility for setting them up with custom vendor information?
 
The following users thanked this post: imacgreg

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 5907
  • Country: ca
Re: What's the next step up from basic USB bridge?
« Reply #11 on: January 14, 2024, 02:18:59 am »
ah for sure ftdi is the king,  for usb dev  id's   you have ftprog  on their website

cypress too  but no small usb interfaces  loll

BUT  if you want to use your own dev id,  you need to pay for it,  and register it ....  you can not create one out of fun, it must be registered


at my company  we pay for mac address "numbering" we have reserved over  "1 million mac numbers"   and for usb dev id's since we ship internationally, we design and build systems
« Last Edit: January 14, 2024, 02:24:25 am by coromonadalix »
 
The following users thanked this post: imacgreg

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: What's the next step up from basic USB bridge?
« Reply #12 on: January 14, 2024, 04:01:33 am »
Assume that I want to avoid rolling the USB into the hardware master F4.

why? sure, a good reason would be to avoid dealing with USB-CDC completely and stay in the comfort zone of UART (a very good reason IMHO) and that's why all my usb products are either HID or Vendor - with Microsoft special descriptor so i don't need to provide a driver.

Anyway, can't you change VID/PID in the FTDI chips? you sure can in microchip's
but changing VID/PID means that you need to pay the USB-IF tax for it
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf