cancel
Showing results for 
Search instead for 
Did you mean: 

USB-ECM Enumeration over USB for STM32L072

Pavan_LohiaGroup
Associate III

Using B-L072Z-LRWAN Board, I'm trying to Enumerate the USB Port as a Ethernet Adapter.(As Device not Host)

Thereby I integrated just the USB-ECM Stack provided by the STM32 itself.

I initially had issues with Driver, Post Following the Guide/Post from @tjaekel , i.e USB ECM demo - how to setup host?  I used Belcarra USBLAN Driver, Though it got installed and is shown under Network Adapter, I see a Warning Sign for it

Pavan_LohiaGroup_0-1719381415477.png

On Linux though, It gets identified as Android Tethering Device but doesn't show up on Wireshark nor Control Panel(Under Network).

 

So Below are my Issues:

  1. Is it Compulsory to Implement a Server Logic(LwIP, etc etc.) over the ECM Driver?
  2. Agenda of the Project is to USB Should be Enumerated as Ethernet Adapter on all OS Platforms, So Is ECM the Right Option?
  3. Can Someone Give me a Brief on, if I am to use ECM to achieve my agenda how and What are those Mandatory Components I need to include in the project.
  4. Keeping in mind the Board/Controller, STM32L072CZx, Wouldn't Implementing Server Logic use too much of memory? Just ECM Driver Integration alone uses 45.51% of RAM. As based on requirement we need RAM for other implementation too.
26 REPLIES 26
Pavan_LohiaGroup
Associate III

@Andrew Neiland @Pavel A. , Thanks for Taking time on this post.

 

To Answer a Few Points:

 > But @Pavan_LohiaGroup's objective seems to be to have this "just work" with the standard, built-in networking of "all OS Platforms" - not custom crafting raw packets ... ?

Yes, I would not fiddle or play around with the Incoming Data, I would like to Just Receive the RAW Ethernet Packets in its correct fragmentation/format.

i.e. I would like to just receive these Hex values (Captured from Wireshark),  as it is at every interrupt/packet.

Pavan_LohiaGroup_0-1719489466489.png

 

> Throughput is still going to be waaaaaaaaaaaay  faster than the LoRa radio! 

Yes, Your Understanding is right, I will just forward those packets that I receive (Raw Ethernet) to the LoRa Radio. Similarly I will Forward all the Data I receive from LoRa Radio to this Enumerated USB-ECM.

 

> @Andrew Neil It is possible to use raw "ethernet" packets without IP stack. There were times before IP...

The Pain Point I'm still facing is, Having just the Middle ware of USB-ECM isn't making my Dev. board get detected as either Virtual Ethernet nor as any Physical Ethernet Port under any OS. Or In other Words, Even if Right Drivers are installed too, They are either Disabled/Can't be used too.

 

> For a really tiny IP stack. maybe consider uIPhttps://dunkels.com/adam/software.html 

Thanks will give it a Shot soon and Update.

 

Again Thanks all for Responses and Guidance.


@Pavan_LohiaGroup wrote:

Yes, I would not fiddle or play around with the Incoming Data, I would like to Just Receive the RAW Ethernet Packets in its correct fragmentation/format..


But how will you get "all OS Platforms" to send such raw ethernet packets?

Surely, they will expect to have a TCP/IP conversation? Or UDP/IP at the least?

Pavel A.
Evangelist III

 Having just the Middle ware of USB-ECM isn't making my Dev. board get detected as either Virtual Ethernet nor as any Physical Ethernet Port under any OS.

Correct, Windows for example will need a custom driver for CDC/ECM. Windows has in-box driver (usb8023.sys) only for RNDIS flavor of USB networking. But if you get a compatible driver for CDC/ECM, just answering correctly the USB descriptor requests should get the device recognized. No TCP/IP middleware is involved in this. On Linux more or less same. Install a compatible driver.

If you need more help with development or research on this project, here it can be found.

 

Yes, There would be Conversation of Both TCP/IP and UDP/IP too.

So would both need a IP Stack? I understand if TCP/IP might probably need as It needs to Connect first before any Communication. But would it be needed even for UDP too, Shouldn't a Static IP assigned to Adapter be sufficient for it?


@Pavan_LohiaGroup wrote:

But would it be needed even for UDP too, Shouldn't a Static IP assigned to Adapter be sufficient for it?


Hmmm - maybe ...

But then you're getting into needing a specific app of some sort to do that.

If you're going to need a specific app anyhow, why not just have it use a VCP - surely "all OS Platforms" support VCP? 

As mentioned earlier, I tried using Belcarra USBLAN for ECM too. But for reasons unknown to me, it has some warnings and thereby not even shown in control panel > networking devices > adapters.

 

I indeed Tried RNDIS too, It partially works in Linux, Driver/Adapter is Disabled in windows, Details arementioned in this below post too.

usb-rndis-works-partially

The Device is expected to be connected to PLC's, Motor Drives and Other Industrial Machines which works / is configured to work mostly over Ethernet, so if its to be used as VCP, The existing systems/devices should also be reprogrammed to communicate over VCOM which I'm trying to avoid all together so This Product can acts as a Plug and Play Device.

Looks like a bug in function descriptors. The Windows USBView isn't maintained well and cannot be trusted too much, prefer Linux tools. See the link in my reply above.

Surely Will Double Check and Verify things.

I will Explore the fiverr.com for more details and understanding.

Thanks