cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet Over USB

Bill Lewis
Associate III
Posted on June 27, 2013 at 20:14

Has anyone seen any code to do Ethernet Over USB from an STM32?

I'm looking for something similar to how the BeagleBone boards work.

When you plug their USB into Windows (and have the right drivers) they show up as a fake Ethernet IP (along the lines of CDC for comm ports).

Bill

#usb #ethernet #cdc #ecm
8 REPLIES 8
tsuneo
Senior
Posted on June 28, 2013 at 03:51

> When you plug their USB into Windows (and have the right drivers) they show up as a fake Ethernet IP (along the lines of CDC for comm ports).

Which one are you talking about, RNDIS or SLIP?

Over RNDIS gadget driver, the BeagleBone works as a USB-Ethernet dongle (adaptor).

With SLIP protocol over a virtual COM port, the BeagleBone runs server/client.

Tsuneo

Bill Lewis
Associate III
Posted on June 28, 2013 at 16:07

I don't even know enough to answer that question.

Does one of those work on on the Windows side without creating custom USB drivers?

-Bill

tsuneo
Senior
Posted on June 28, 2013 at 19:39

Ah, you are referring this behavior, described on BeagleBone ''getting started'' page

http://beagleboard.org/static/beaglebone/latest/README.htm Step #2: Install drivers Install the drivers for your operating system to give you network-over-USB access to your BeagleBone. Additional drivers give you serial access to your board. I have a BeagleBone board, but sorry, I skipped this page 😉 On the schematic, BeagleBone has two USB devices under on-board hub.

USB PC ---- USB2412 (2-port hub) -- AM3359 USB0
Connector -- FT2232

The Getting Started page links to RNDIS and FTDI VCP PC drivers. ''network-over-USB access'' seems to be supplied over RNDIS. As RNDIS is just a protocol which carries Ethernet frames over USB, virtual network (without Ethernet hardware) should connect to a web server on the BeagleBone firmware.

+-----------(virtual network)-----------+
| |
USB RNDIS ------+- Ethernet <==(physical)==> Ethernet --+-- Web server
device PHY network PHY

And then, you have to implement these components, 1) USB RNDIS device 2) web server, which directly connects to RNDIS, skipping hardware layer 1) RNDIS device There are a couple of commercial RNDIS device stack for STM32, like SAFERTOS, Thesycon, WinDriver. But I can't find free RNDIS implementation. As RNDIS is an extension of CDC, you may make it, starting with the ST's CDC (-ACM) example. I believe it takes a couple of days or so, if you would know USB device class implementation well. But if it were the first time to touch to the USB stack, 2-3 weeks 😉 If you have patience, I'll help you. MS-RNDIS -- RNDIS spec on MSDN http://msdn.microsoft.com/en-us/library/ee5249aspx 2) web server AN3384 demonstrates a web (HTTP) server using LwIP and FreeRTOS http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00026pdf You may rewrite the HAL (Hardware Abstraction Layer) of LwIP, so that it directly connects to RNDIS, instead of an Ethernet PHY. > Does one of those work on on the Windows side without creating custom USB drivers? Windows has in-box RNDIS driver. But you have to provide an INF file, like CDC (-ACM). You may apply BeagleBone one. Tsuneo
Bill Lewis
Associate III
Posted on June 28, 2013 at 22:48

Tsuneo,

Thank you for that info.  I appreciate it very much.

I do have experience with USB code on Freescale Coldfilre and Microchip PIC32MX, but not so much yet with the STM32.  I'll do some research based on your info and I'll be back with questions.

Bill

krutecki
Associate II
Posted on December 02, 2014 at 11:08

Hi Tsuneo and others

I`ve modify ST CDC USB Class and know I have a working CDC-ECM. It was quite simple 🙂 But I have problems with Windows INF file. Can you help me with that?

USB act as Composite Device (CDC, HID and MSC) and under Linux it works like a harm. No drivers required. Under Windows, for CDC-ACM I have modified original INF file providaed by ST (only VID/PID has changed and &MI_00 added as interface hint for enumeration).

From know, every time you plug my device into USB ethernet card is detected and IP is gather from DHCP server from the device. As the TCP/IP stack lwIP is used with FreeRTOS as scheduler. Almost done, only INF is needed :\

Thank in advance for any help.

Chris

Wood.Andy
Associate III
Posted on January 02, 2015 at 12:24

Hi Chris

When you mean CDC-ECM do you mean RNDIS for Windows use as if you have one working I would appreciate it if you could share it!

I have attached the INF file from LUFA, you would of course need to alter a few things.

Thanks

Andy.

________________

Attachments :

LUFA_RNDIS.inf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I13o&d=%2Fa%2F0X0000000bkL%2Fu5ZRLs3jnMG5RwWINq9Nx4rP928R2nwtdkinG9hpC2U&asPdf=false
tsuneo
Senior
Posted on January 02, 2015 at 19:18

Since WinXP, MS-OS descriptors work for RNDIS, which assigns RNDIS PC driver to your device without any INF file.

http://msdn.microsoft.com/en-us/windows/hardware/gg463179.aspx

If you would modify your firmware a little, so that it provide MS-OS descriptor, your RNDIS device could do without any INF file 😉

Tsuneo

mailtemp
Associate
Posted on February 13, 2015 at 09:14

I've seen free ethernet over usb library here:

http://www.youtube.com/watch?v=W_o0lPivqsA

https://github.com/fetisov/lrndis

http://habrahabr.ru/post/248097/