13 Replies Latest reply on Aug 12, 2013 5:00 PM by muralikrishna85

    USB LAN ECM support

    muralikrishna85

      Hi,

       

      I am using  "Nucleus 3.3.0" with IMX28EVK bsp.

       

      Does this version have support for USB ECM device. Does the application require t write any other driver layer ?

      I tried enabling the nu.os.dvr.usbfunc.net_if.enable=true the build secceeeds but the binaries generated does not boot.

       

       

      Could you please help me with the configuration , if this feature is availble ?

       

      Thanks and Regards

      Murali

        • 1. Re: USB LAN ECM support
          waqar_sadiq

          Hi Murali,

          Yes it supports ECM communications.

          For this you have to enable the following two components

          nu.os.conn.usb.func.comm.class

          nu.os.conn.usb.func.comm.eth

          And ofcourse the USB common and function stack as well. I would recommend to use UI config editor as it will highlight the product dependencies whcih you can easily enable.

           

          nu.os.dvr.usbfunc.net_if component is the one which interface the Nucleus USB transport to Nucleus Networking stack. Means your target board will appear as a USB RNDIS device when conneccted to a Windows machine.

           

          Thanks

          Waqar Sadiq

          1 of 1 people found this helpful
          • 2. Re: USB LAN ECM support
            muralikrishna85

            Hi,

             

            Thanks for the response. It was very helpful.

             

            Now the board is detecting as an RNDIS adapter in Windows PC. I am using Belcarra RNDIS/ECM demo driver. This works well with a g_ether linux driver.

             

            But when i try pining from the board with Nucleus + USB_if support its is not giving any response.

            Following are the options enabled

            nu.os.conn.usb.func.comm.eth.option.macaddess="00:11:22:33:44:55"

                                                         .option.maxframesize=1048

                                                         .mw_settings.eth_enable_ipv4=true

                                                         .mw_settings.eth_ipv4_address="192.168.0.10"

                                                         .mw_settings.eth_ipv4netmask="2555.255.255.0"

             

             

            The windows PC is configured for static ip address "192.168.0.1" for the new LAN interface. But when i try to ping from the board to PC

            and vice versa. The ping just time outs with out any response.

             

            Is there anything i'am missing ?

             

            As of now i have only one app task running in the Nucleus, one which will display the network interface state and send ping ot the remote peer.

            here are the APIs used.

             

            status = NETBOOT_Wait_For_Network_Up(NU_SUSPEND)

            if (status == NU_SUCCESS)

            {

                 //network failure

            }

             

            // for me the above function unblocks when the USB cable is plugged in to PC.

             

            NU_IF_IndexToName(1, if_name);

            state = NU_Device_Up(if_name);

             

            //state = 1 when the USB cable is plugged in the PC.

             

            Does the USB_if need any other specific Task to be invoked by the application?

             

            Thanks

            Murali

            • 3. Re: USB LAN ECM support
              waqar_sadiq

              Hi Murali,

              I think you are doing all the needful now. Nucleus NET owns and operates the RNDIS interface automatically meaning it should respond to the ping.

              I need two things

              1- The Debug.config or the configuration file you are building the Nucleus with

              2- Your package(Innovate?) and release number(2012.12?) so I can try to test this on my end.

               

              Thanks

              Waqar

              1 of 1 people found this helpful
              • 4. Re: USB LAN ECM support
                muralikrishna85

                Hi Waqar,

                 

                Thank You for your time.

                 

                I have attached the "debug.config" file used.

                Nucleus Package:  "ReadyStartProARM_2012.12"

                 

                 

                Note: I tried the Ethernet interface and ping worked for me.

                 

                Thanks

                Murali K V

                • 5. Re: USB LAN ECM support
                  waqar_sadiq

                  Hi Murali,

                  Please verify if my understanding is correct or not for each of below statements.

                  1. Things work fine(You can ping the i.MX28 board) in both Linux and Windows case when accessed through LAN port. True?
                  2. Over USB link, it works fine when used against a Linux host. In Linux it actually uses ECM interface
                  3. Over USB link, it fails when connected to a Windows machine which uses a RNDIS interface. Which MS Windows version you are using? Can you please share the drivers "Belcarra RNDIS/ECM demo driver". One more thing I need you to confirm is by opening up the "Networking and Sharing Center" in Windows or a packet sniffer program, please verify if packets are actually transmitted over the interface when you enter a ping command. Sometime in Windows, few agent like anti-virus tend to block traffic on suspicious interfaces.

                   

                  Thanks

                  Waqar Sadiq

                  • 6. Re: USB LAN ECM support
                    muralikrishna85

                    Hi Waqar,

                     

                    Please find below my response for your questions.

                    1.Things work fine(You can ping the i.MX28 board) in both Linux and Windows case when accessed through LAN port. True?
                    <Murali> Yes, Your understanding is correct. When Ethernet bsp driver and net stack is configured in Nucleus build, i am able to ping the device from a Linux and Windows host.
                    In order to confirm the "Belcarra RNDIS/ECM demo driver" works i did one more experiment.
                    Used embedded linux 2.6.35 version kernel for imx28 with has a ECM 'device' driver support and was sucessful in pinging from Windows 7 PC over USB(No ethenet in this case).
                    2. Over USB link, it works fine when used against a Linux host. In Linux it actually uses ECM interface
                    <Murali> This is not true. When IMX28 board (running Nucleus with ECM/RNDIS support) is connected to Linux PC it shows up an interface "pan0" for ifconfig command. I tried assigning an IP address to this interface and ping. But failed .
                    3. Over  USB link, it fails when connected to a Windows machine which uses a  RNDIS interface. Which MS Windows version you are using? Can you please  share the drivers "Belcarra RNDIS/ECM demo driver". One more thing I  need you to confirm is by opening up the "Networking and Sharing Center"  in Windows or a packet sniffer program, please verify if packets are  actually transmitted over the interface when you enter a ping command.  Sometime in Windows, few agent like anti-virus tend to block traffic on  suspicious interfaces.
                    <Murali> Yes , IMX28 + Nucleus + windows fails.
                    The windows version : Windows 7
                    Belcarra RNDIS/ECM demo driver: This is a demo version of RNDIS/ECM driver from Belcarra already availble in the windows update. Use the VID = 0x15ec and PID = 0xd032 for your Nucleus device and connect it to a windows PC.Makse sure the driver is getting installed from Windows Update.(In windows 7 : controlpane-->devicesandprinters-->right click your PC-->Device_installation_settings-->"do this automatically" )

                    Sniffer: I tried this but didnt see any network packets going around.

                     

                    Thanks

                    Waqar Sadiq

                    • 7. Re: USB LAN ECM support
                      muralikrishna85

                      Hi Waqar,

                       

                      Today i was able to proceed further more.

                       

                      The Nucleus with ECM configuration got detected by the windows 7 - driver(Belcarra Demo Driver).

                      Windows 7 downloads the driver and installs in the PC.

                       

                      But during the windows driver installation the Nucleus hangs.

                       

                      I am using a debugger to trace the path. I saw that the control is getting stuck

                      in the WHILE(1) loop inside ERC_System_Error() function in "erc_common.c" . The 'error_code' variable in that function has a value  = 9.

                       

                      Below is the flow i could see

                       

                      Reset board  --> Connect the usb otg port to Windows 7 PC using a cable --> TCC_Unhandled_Exception() of tcc_common.c --> ERC_System_Error() function in "erc_common.c --> while(1).

                       

                      I have attached the configuration file used for build.

                       

                      Please let me know if you need anymore details.

                       

                      Is there a way to disable the RNDIS capability and enable ECM alone?

                       

                      Murali

                      • 8. Re: USB LAN ECM support
                        waqar_sadiq

                        Hi Murali,

                        I tested this by running on i.MX28evk board with both Windows XP and 7 machines and it worked ok.

                        If you are using MESP personal probe then I would recommend you to use a differnt machine to plug this device in and ping it. Multiple RNDIS devices on a single windows machine sometimes pose problems. I am not sure about the Belcarra Demo Driver and its function. We have never used them for internal testing so I and would recommend you to use the attached INF files instead in case of Windows.

                        • 9. Re: USB LAN ECM support
                          muralikrishna85

                          Hi Waqar,

                           

                          Could you please share the configuration file used by you for the test?

                           

                          Thanks

                          Murali

                          • 10. Re: USB LAN ECM support
                            waqar_sadiq

                            Hi Murali,

                            I actually used an internal test which involves all TCP, UDP and FTP communications, therefore my configuration include additional components for Storage and FTP. For simple PING theose shouldn't be required. Configuration file is attached so you can read the required entries related to your case.

                            Thanks

                            Waqar

                            • 11. Re: USB LAN ECM support
                              muralikrishna85

                              Hi Waqar,

                               

                              The IMX28 board Nucleus RNDIS worked with the INF file shared in the previous POST.

                              Also the Belcarra Demo Driver started working after some tunning in the RNDIS protocol implementation from the their side.

                               

                              I would like to hear your suggestions on the following:

                               

                              The MS website has a template for creating the INF file. How to create an INF file + installation kit for our product.

                              http://msdn.microsoft.com/en-us/library/windows/hardware/ff570620%28v=vs.85%29.aspx

                               

                              1. How about the PID and VID for USB - do we need to purchase one from USB IF?

                              2. Is there Any other licensing terms to be considered while commercialising?

                               

                              Thanks for help and support.

                               

                              Murali K V

                              • 12. Re: USB LAN ECM support
                                waqar_sadiq

                                Hi Murali,

                                You must have your own VID and PID for your device from USB-IF.

                                The INF provided to you was only for demo purpose, If you want to ship one with your device, then please check with Microsoft. I personally don't think that you would need to have some license for it but this MUST be confirmed ONLY by the Microsoft.

                                Thanks

                                Waqar Sadiq

                                • 13. Re: USB LAN ECM support
                                  muralikrishna85

                                  Thanks Waqar.