cancel
Showing results for 
Search instead for 
Did you mean: 

USB to Ethernet bridge

Dani Prieto
Associate II
Posted on January 24, 2017 at 12:53

Hello,

I want to make a bridge from USB to Ethernet, to give connectivity to a tablet.

I am using an STM32F107RC, a DP83848CVV phyter and the CubeMX to generate the code with this configuration:0690X000006067MQAQ.png

I do not know how to link it, should I share a buffer or something?

It's the first time I've touched Ethernet and I'm a little lost, besides that I don't see anyone who has done something like this before.

Thank you very much!

#connectivity-usb #ethernet #stm32f107
4 REPLIES 4
Mon2
Senior III
Posted on January 24, 2017 at 13:52

Hello Dani. Not to belittle the STM32 processor but any specific reason as to why you are not considering a fixed function device for this task ? There are many proven and low cost USB to Ethernet bridge devices on the market which are supported with a team of engineers who should be able to supply you with the required device drivers and also reference development kits to quickly review the proof of concept. For example, review the devices from Asix (Taiwan - their device is used on very high volume Apple & PC compatible dongles = USB3.1 to Gigabit); Exar (amazing support from their staff); Cypress (we have designed with this controller and the benchmarks were very impressive for our USB3.1 to Gigabit dongle; wide range of OS support for this controller). There may be others that are not listed in this post. A DYI project is not impossible but also not simple to perfect.

A concept that you may wish to explore is to stitch a STM32 (MBED enabled) with the Wiznet hardware based TCP/IP controllers. Go to the MBED.ORG website and search out the Wiznet projects to understand how to marry the 2 devices. Wiznet also offers mbed enabled low cost boards but for now, avoid the single chip W7500P device due to a bug inside the silicon which limits the use to only 10 Mbps (rather than 100 Mbps). Instead, for now, use the

W7500 & IP101A

combination. The Wiznet device claims to be attack proof since the TCP/IP is in hardware vs. software which is a great benefit.
Posted on January 25, 2017 at 08:35

Hello

Bhatia.Kumar

, thanks for your reply.

I have the hardware mounted this way, and I use this micro only for that besides an STM32F103 for RS232 / 485 communication.

In this boardI also have two ports to connect USB.

At the moment it would discard the idea of putting another dedicated micro, sincethis implies make another PCB.

Would it be easier to buy a USB adapter to ethernet already mounted and connect it to the USB port?

What I save on the 107 is equated with the cost of the new device.

Is this reliable? It is for an industrial application.

Thank you very much.

Daniel Prieto

Electronic Engineer

Saber S.L.

Posted on January 25, 2017 at 14:23

Hi Dani. The referenced controller from Asix is the leading USB3.1 to Gigabit bridge device on the market. You will need to decide the best route based on your specifications.

1) Is your USB interface operating at USB 3.1 Gen 1 (aka USB 3.0) ? USB 2.0 HS ? USB 2.0 FS ? If you are operating at USB 2.0 then the respective bridge controller should also be a USB 2.0 as a cost reduction. Please review the datasheets for each such controller to understand if any other improvements have been made between the silicon (ie. bug fixes, larger ethernet frames, etc.). If the project can justify the expense then consider to use the more current USB3.1 controller.

2) Industrial use - how noisy / harsh is the environment ? For our designs, we like to throw in the kitchen sink with hope that the end customer will only contact us with new purchase orders. The off-the-shelf dongles will be basic designs to lower the end product cost. Recommend that you source a few to inspect and then if it makes sense, to design your own robust version. For example, apply nice ESD protection and Vbus protection onto the USB lines. Many offshore dongles do not offer such level of protection. In theory, the first USB port that interfaces with the host PC will see the ESD surges so you can decide where to apply the protection. That is, if you have a USB hub then the upstream port will feature the ESD protection but in theory, is not required on the downstream ports mating with your embebdded design.

Perhaps your project can demand and justify the use of USB isolators ? Analog is a popular choice for USB low and full speed (need a jumper to select the proper speed). A more current method is to use the Murata modules for USB isolation (again for USB low / full speed with auto-detect) so not for High Speed isolation. High Speed USB 2.0 (480 Mbps) isolation is possible but fairly high cost (see Silanna USB - single chip isolator is $50+ USD and also require an isolated DC-DC module).

Even the Ethernet port can face nasty ESD events so review the use of ST or similar Ethernet port protectors.

Again, highly unlikely that you will see this level of protection on a standard USB to Ethernet dongle. We are living in the land of disposable widgets which is not how we would design such products.

The dongle in your post is available for under $ 10 USD from China in a retail blister package.

The Asix controller is under $ 5 USD in sample quantity if you wish to spin your own version of such a design. Cypress is also in this range.

3) The use of mature Ethernet bridge devices is a practical idea due to the very high volume of consumption. You will also have support from the respective silicon vendor and can tweak the bill of materials to suit your specification. Unless you are following a reference design with your current approach, the smallest detail or tool chain issue can be real time killers. We came to ST after wasting weeks of long work days on another vendor's rapid GUI tool which is clearly broken. ST so far is solid with high potential but for us, lacking complete projects for our target CPU device(s). Our beef is that if we are to learn from examples and the vendor tools are broken then we are just spinning our wheels with little or no progress. Often documentation is not in sync with the kits or tools and even worse if the silicon has bugs that have not yet been resolved.

The best suggestion at this time is to review assorted dongles through Amazon or similar sourcing and then benchmark and study the insides of each product. If you find the dongle to be stable, then proceed to build your own robust version of the same. That would be our approach. Asix, Cypress, Exar each offer relatively low cost reference boards for such controllers for this exercise. In our opinion and from our experience, Asix & Exar are both excellent in tech support and then Cypress. Cypress wants to see high volume potential for proper support.

You noted:

I want to make a bridge from USB to Ethernet, to give connectivity to a tablet.

Will the tablet be the USB host ? Which operating system will be running on this tablet ? Be sure that the silicon vendor is able to support the respective USB to Ethernet bridge controller. You should be fine with any of these 3 vendors if using Windows, Linux or Android but do check to confirm the specific details.

Posted on January 26, 2017 at 09:12

Hello

Bhatia.Kumar

‌, thank you again for your answer and your time!

1) The project is based on USB2.0 FS

2) I am using several USBLC6-2 on each USB HUB port and TVS diodes on serial communication outputs (RS232/485/422).

And yes, the tablet will be the host with windows

The idea is to have a single device that can be connected to Ethernet or RS232/485/422, but independently and definitively.

That is to say, a multipurpose board, but that will be used only for one typecommunication, depending on the machine to which it will be destined.

I have at my disposal a network adapter with the AX88772A, I will try it with my board to know if it is compatible.