USB ethernet in U-boot

5,254 views
Skip to first unread message

valdez

unread,
Aug 19, 2012, 10:31:18 AM8/19/12
to beagl...@googlegroups.com

Hi,

my next problem is how to run ethernet over USB to download images via tftp. My board: Beagleboard rev.C4. My U-Boot is 2012.07. My USB-ethernet adapter (this is what u-Boot usb dev shows when adapter is connected to USB EHCI port):

 Vendor specific,  USB Revision 2.0                                          
 - Moschip Semiconductor UA0025C               6e003e8f                        
 - Class: Vendor specific                                                      
 - PacketSize: 64  Configurations: 1                                           
 - Vendor: 0x9710  Product 0x7830 Version 1.0                                  
   Configuration: 1                                                            
   - Interfaces: 1 Bus Powered Remote Wakeup 500mA                             
     Interface: 0                                                              
     - Alternate Setting 0, Endpoints: 3                                       
     - Class Vendor specific                                                   
     - Endpoint 1 In Bulk MaxPacket 512                                        
     - Endpoint 2 Out Bulk MaxPacket 512                                       
     - Endpoint 3 In Interrupt MaxPacket 16 Interval 1ms 

I have also USB HUB connected to OTG port and self powered. But only usb tree shows some info:
1  Hub (480 Mb/s, 0mA)                                                       
     u-boot EHCI Host Controller

Don't know why it show 0mA if I have power supply attached.

Finally U-Boot shows always that now ethernet device is found. And additionaly MAC address is not set (ethaddr), but ethaddr doesnt work.
Could you help?

Maksym Parkachov

unread,
Aug 19, 2012, 4:36:28 PM8/19/12
to beagl...@googlegroups.com
Hi,

I've written some time ago guide for beagleboard XM for loading kernel
and mounting nfsroot, maybe it will help:

http://veter-project.blogspot.com/2012/03/comfortable-kernel-workflow-on.html

But, I'm not sure, if your adapter is supported by U-boot. The adapter
on XM board is supported.

Hope this helps,
Maksym.
> -- To join: http://beagleboard.org/discuss
> To unsubscribe from this group, send email to:
> beagleboard...@googlegroups.com
> Frequently asked questions: http://beagleboard.org/faq

valdez

unread,
Aug 22, 2012, 5:17:35 AM8/22/12
to beagl...@googlegroups.com
Your project is a great work! And good guide.

One thing, my U-Boot shows "No ethernet found". U-Boot site says that it is possible when no valid MAC address is set. But which one? ethaddr or usbethaddr ? Or any of them? And what address I should set. Shouldn't it to be assigned by producer and I should use it in that usbethaddr variable?

Regards
Valdez

valdez

unread,
Aug 27, 2012, 3:04:14 AM8/27/12
to beagl...@googlegroups.com
Sorry that I bump it but still don't know how to do it.

Could you help, please?

Valdez

Maxim Podbereznyy

unread,
Aug 27, 2012, 3:13:57 AM8/27/12
to beagl...@googlegroups.com
setting the MAC address is one of the latest stages in tuning the
Ethernet in u-boot. First u-boot itself must find and initialize your
Ethernet adapter, only then you can set MAC, ip address and etc. As
far as I understand the things u-boot is not able to detect and
initialize hot-plug devices like USB-Ethernet. You need to specify
explicitly what type of hardware is connected and which routings have
to be invoked to initialize the hardware

2012/8/27 valdez <vald...@gmail.com>:

valdez

unread,
Aug 27, 2012, 3:59:50 AM8/27/12
to beagl...@googlegroups.com
My hardware is LogiLink and base on Moschip Semiconductor 7830 (MSC 7830), BB revC4 and I have also self-powered USB hub from Digitus with USB mini AB cable.
If it is possible, I'd like to connect USB ethernet via hub to OTG port. If not finally it can be Connected via EHCI.
I want to connect via ethernet to my notebook, obviously I have crossed ethernet cable.

Maxim Podbereznyy

unread,
Aug 27, 2012, 4:52:12 AM8/27/12
to beagl...@googlegroups.com
and? You have to fix u-boot sources to enable your adapter

2012/8/27 valdez <vald...@gmail.com>:

valdez

unread,
Aug 27, 2012, 5:02:58 AM8/27/12
to beagl...@googlegroups.com
Is it descripted somewhere?


W dniu niedziela, 19 sierpnia 2012 16:31:18 UTC+2 użytkownik valdez napisał:

Maxim Podbereznyy

unread,
Aug 27, 2012, 5:07:47 AM8/27/12
to beagl...@googlegroups.com
right in the u-boot sources. What else do you need?

2012/8/27 valdez <vald...@gmail.com>:

valdez

unread,
Aug 27, 2012, 7:28:07 AM8/27/12
to beagl...@googlegroups.com
Following README.usb file I added line with Vendor and Product ID in drivers/usb/eth/asix.c file and:

#define CONFIG_USB_HOST_ETHER    /* Enable USB Ethernet adapters */
#define CONFIG_USB_ETHER_ASIX    /* Asix, or whatever driver(s) you want */

#define CONFIG_CMD_NET
#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP

#define CONFIG_BOOTP_SUBNETMASK
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME
#define CONFIG_BOOTP_BOOTPATH

#define CONFIG_IPADDR        192.168.0.9  (replace with your value)
#define CONFIG_SERVERIP        192.168.0.2  (replace with your value)
#define CONFIG_BOOTFILE        "uImage"
in /board/ti/beagle file.
Now U-Boot see adapter as ethernet device when connected to EHCI port, but not when connected to OTG via HUB. But ok, output of printenv command shows
gatewayip=192.168.0.1
ipaddr
=192.168.0.9
netmask
=255.255.255.0
serverip
=192.168.0.2
usbethaddr
=00:60:6e:00:03:3a
 My notebook eth address is 192.168.0.2 with net mask 255.255.255.0.
Still can't ping to notebook: ping failed:
OMAP3 beagleboard.org # ping 192.168.0.9                                      
ping failed
; host 192.168.0.9 is not alive

What can be wrong now?

Mark Lazarewicz

unread,
Aug 27, 2012, 8:14:04 AM8/27/12
to beagl...@googlegroups.com
we want you to explain we dont think you know

--- On Mon, 8/27/12, Maxim Podbereznyy <lisa...@gmail.com> wrote:

valdez

unread,
Aug 27, 2012, 1:13:20 PM8/27/12
to beagl...@googlegroups.com
If someone could give some hints. Im trying to learn from free electrons tutorial and they use ethernet many times. It is difficult now for me to go through it without that connection.

valdez

unread,
Aug 28, 2012, 11:28:13 AM8/28/12
to beagl...@googlegroups.com
Is it still necessary to modify U-Boot sources? I know I can load images from card. But I'd like to learn via ethernet also and it is more convenient way as you know.
I thought it will be easier because my board is from EBV, Beagleboard C4 clone, and they supplied in one box all the cables, power supplies, usb hub, ethernet dongle and sd card. In my opinion they know what is supported and so on... Still want to fight with it but need your support.


W dniu niedziela, 19 sierpnia 2012 16:31:18 UTC+2 użytkownik valdez napisał:

Mark Lazarewicz

unread,
Aug 28, 2012, 1:50:59 PM8/28/12
to beagl...@googlegroups.com
well i thought more about this  after last email
 
 I have a C4 Beagle and I can try and help but
it may take some time and my memory is shaky as to what you can do with a beagle c4
 
one reason you dont want to be changing uboot is the MLO , uImage and uboot are matched. even if you rebuilt uboot  correctly you may cause more problems than its worth
 
keep in mind
1)when you ask for help moving a mountain when you do not have to, you get no reply
2) The help on this beagle  list had dwindled from what it once was
 
I suggest you  summarize what your goals are clearly and repost to the group asking how is best to achieve this
 
avoid whack  jobs from Russia like Maxim
 
they will not be sympathetic to you using old tutorials and wanting help on things that you are not ready for
 
as for me I have a fulltime job for $100 hr with unlimited OT which equates to no time to be putzing around with a hobby like this
 
so I can only get you started
 
once again what are you wanting to learn and what is your background???
 
 


--- On Tue, 8/28/12, valdez <vald...@gmail.com> wrote:

From: valdez <vald...@gmail.com>
Subject: [beagleboard] Re: USB ethernet in U-boot
To: beagl...@googlegroups.com

valdez

unread,
Aug 28, 2012, 2:36:18 PM8/28/12
to beagl...@googlegroups.com
I really appreciate your help @lazarman. And appologize that I was not understood until now.

I have Beagleboard C4 and need to be as most familiar as it is possible. I don't have now any specified project, that I could simply download prebuilded bootloaders, Linux distribution and focus only on some code functionallity. I have to learn that all surroundings to explain it later other people. How to start developing software for Beagleboard, what is possible with that platform. It must cover: preparing development environment; preparing Linux distribution and basic kernel programming; work with typicall Linux distributions like Ubuntu, Debian on BB; show DSP programming with DSP/BIOS and DSPLink; show how to use some RTOS (I think it will be QNX); finally how to use Beagle in conventional bare metal ARM programming. It doesn't have to be very deep level of that all.  I think that later I would like some small project, especially with using DSP core, e.g some heads recognition or hands recognition.

Unfortunatelly I'm not experienced in embedded Linux. I only use desktop disribution. I had contact with C, assembler and some other languages programming, but it was some time ago and on university (not very serious projects) level. From my side is rather strong determination.

This is why I don't want to pass USB Ethernet in U-Boot, use only SD card and go on.
And I also know that this board is not new, new OMAPs and platforms are on the market. It is why I suffer the most, a lot of new soft doesn't work like in tutorials. It's often situation that tutorials are rather confusing (e.g. U-Boot SPL instead of pervasive in tutorials X-Loader).

What exactly is my problem now:
Need network via USB-Ethernet in U-Boot(2012.07). I think that it is necessary to build U-Boot with changes suggested in
README.usb from U-Boot docs. Thanks adding Vendor and Product ID in drivers/usb/eth/asix.c U-Boot see my dongle when it is connected to EHCI port, but still not when connected via USB HUB to OTG port. I'm not sure about this in /board/ti/beagle file:
#define CONFIG_USB_HOST_ETHER    /* Enable USB Ethernet adapters */
#define CONFIG_USB_ETHER_ASIX    /* Asix, or whatever driver(s) you want */

#define CONFIG_CMD_NET
#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP

#define CONFIG_BOOTP_SUBNETMASK
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME
#define CONFIG_BOOTP_BOOTPATH

#define CONFIG_IPADDR        192.168.0.9  (replace with your value)
#define CONFIG_SERVERIP        192.168.0.2  (replace with your value)
#define CONFIG_BOOTFILE        "uImage"

But after these changes in U-Boot source and with environment variables in U-Boot like this:

gatewayip=192.168.0.1
ipaddr
=192.168.0.9
netmask
=255.255.255.0
serverip
=192.168.0.2
usbethaddr
=00:60:6e:00:03:3a


Network seems still doesn't work:
OMAP3 beagleboard.org # ping 192.168.0.2                                      
ping failed
; host 192.168.0.2 is not alive

It is in situation when USB-Ethernet dongle is connected by crossed cable to my notebook, where on Ubuntu is network created with IP: 192.168.0.2 and netmask:255.255.255.0.
Finally the USB-Ethernet adapter base on ASIX MCS7830. I know that U-Boot supports ASIX and SMSC 95xx chips.



W dniu niedziela, 19 sierpnia 2012 16:31:18 UTC+2 użytkownik valdez napisał:

Mark Lazarewicz

unread,
Aug 29, 2012, 10:34:29 AM8/29/12
to beagl...@googlegroups.com
Let me give you a wakeup.
 
starting from just placing prebuild images on an SD card and
getting the board to work and being able to repeat this and maybe change one of the required images can take you from 1 day to 1 week depends how much smarts and experience you have.
 
If you cant get that to work you have NO chance of being succesfull modifying u-boot source and getting it to work.
 
You will get half a dozen ideas of where to start and what distro to use searching this list archives. I myself would start with a minimal linux thats all subjective and depends on who on this likst is going to actually help you. This list heavily favors OE and Angstrom but there are alternattives
 
BTW researching the pros and cons of your choices is 1 weeks work alone (-: Its a tall order you have and you have to take the initiative to read lots of stuff. No one is going to spoon feed you especially if you dont put in some upfront leg work
 
Hope I have not totally disallusioned you


--- On Tue, 8/28/12, valdez <vald...@gmail.com> wrote:

From: valdez <vald...@gmail.com>
Subject: [beagleboard] Re: USB ethernet in U-boot
To: beagl...@googlegroups.com

valdez

unread,
Aug 31, 2012, 7:05:03 AM8/31/12
to beagl...@googlegroups.com
Sorry that I write so late but my job takes a lot of my time and I was tired last evenings.
You didn't disallusioned me :D If you write here, or anyone who would like to help, it's encouraging :)

I think I know how to prepare SD card to work. I know how to build toolchain from crosstool-ng, but after all I decided to use prebuilded arm-cortex_a8-linux-gnueabi- . I also know how to prepare first and second stage bootloaders (U-Boot :)). But I didn't tested any specific distro (only demo images, but want to do it myself, not just copy and paste files). I builded Linux from scratch with latest stable kernel 3.5.3, Busybox 1.20.2, I created all the rest missing neccessary directories and files and I have used *.cpio archive as a ramdisk (but creating root file system is for me the most confusing now, I will have couple of questions). That system boots and I cross-compiled and ran on beagleboard simple "hello world" program. I also tried run ethernet under that OS :D, of course it didn't worked even when I turned on Kernel drivers for MCS7830 chip and for EHCI-HCD. I tried also use it as module and I used 'insmod' command to load it but still nothing. I come before question, that adapter is recognized on my notebook Ubuntu, dmesg shows that it use that kernel driver.

Then I wanted to try with Angstrom. But it uses other tools and I don't get it yet. How to build image and toolchain... I tried to use online builder to create sdcard image, but I left that page for hours and it was still: Assembling image. This approach: http://www.angstrom-distribution.org/building-angstrom is also confusing form me. It would be great if someone could give some example how to build uImage, bootloaders and rootfs from that.

Today I will try Ubuntu. This page: http://elinux.org/BeagleBoardUbuntu seems to be great (thanks Robert! ), especially because last modification date is couple of days ago, so hope it will work. There is only one thing. Why still using Rootstock, if it is not developed since 3 years?

So I hope I will be prepared to fight for ethernet in u-boot after today :) If not, tell me what to do more.

Robert Nelson

unread,
Aug 31, 2012, 7:58:59 AM8/31/12
to beagl...@googlegroups.com
On Fri, Aug 31, 2012 at 6:05 AM, valdez <vald...@gmail.com> wrote:
Sorry that I write so late but my job takes a lot of my time and I was tired last evenings.
You didn't disallusioned me :D If you write here, or anyone who would like to help, it's encouraging :)

I think I know how to prepare SD card to work. I know how to build toolchain from crosstool-ng, but after all I decided to use prebuilded arm-cortex_a8-linux-gnueabi- . I also know how to prepare first and second stage bootloaders (U-Boot :)). But I didn't tested any specific distro (only demo images, but want to do it myself, not just copy and paste files). I builded Linux from scratch with latest stable kernel 3.5.3, Busybox 1.20.2, I created all the rest missing neccessary directories and files and I have used *.cpio archive as a ramdisk (but creating root file system is for me the most confusing now, I will have couple of questions). That system boots and I cross-compiled and ran on beagleboard simple "hello world" program. I also tried run ethernet under that OS :D, of course it didn't worked even when I turned on Kernel drivers for MCS7830 chip and for EHCI-HCD. I tried also use it as module and I used 'insmod' command to load it but still nothing. I come before question, that adapter is recognized on my notebook Ubuntu, dmesg shows that it use that kernel driver.

Then I wanted to try with Angstrom. But it uses other tools and I don't get it yet. How to build image and toolchain... I tried to use online builder to create sdcard image, but I left that page for hours and it was still: Assembling image. This approach: http://www.angstrom-distribution.org/building-angstrom is also confusing form me. It would be great if someone could give some example how to build uImage, bootloaders and rootfs from that.

Today I will try Ubuntu. This page: http://elinux.org/BeagleBoardUbuntu seems to be great (thanks Robert! ), especially because last modification date is couple of days ago, so hope it will work. There is only one thing. Why still using Rootstock, if it is not developed since 3 years?

3 Years is a little off, Canonical's last commit was Feb 27, 2011, so unless you want to write me another quick/easy tool.. I'll keep maintaining/extending my rootstock fork. ;)  (In reality it's just a debootstrap wrapper script, not much off it will ever go obsolete..)

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

valdez

unread,
Aug 31, 2012, 8:35:13 AM8/31/12
to beagl...@googlegroups.com
Ok. I understand. But what about recommended on Ubuntu wiki site live-build. I suppose it must be something that it is not possible to create image with that tool. You are one of authors so you know that :) Is that true that it can create images only for host architecture machines?

W dniu niedziela, 19 sierpnia 2012 16:31:18 UTC+2 użytkownik valdez napisał:

Robert Nelson

unread,
Aug 31, 2012, 9:35:42 AM8/31/12
to beagl...@googlegroups.com
On Fri, Aug 31, 2012 at 7:35 AM, valdez <vald...@gmail.com> wrote:
> Ok. I understand. But what about recommended on Ubuntu wiki site live-build.
> I suppose it must be something that it is not possible to create image with
> that tool. You are one of authors so you know that :) Is that true that it
> can create images only for host architecture machines?

If that's what they recommend, then it's what they recommend... For
what I need, rootstock fits the bill, if i need something more, i just
use my netinstall script..

1: https://github.com/RobertCNelson/netinstall

laza...@yahoo.com

unread,
Aug 31, 2012, 11:26:35 AM8/31/12
to beagl...@googlegroups.com
All methods use cross compile for target. Find one you can replicate ie duplicate the prebuilt and remember the tools should be free.you talked about QNX this is not free but this may have changed.I had best luck with code sourcery tools and followed omapedia and elinux but that was omap4.have you got anything to boot on SD yet? There were prebuilts for your c4 board for android I got working WiFi GUI etc.  In general a minimal no GUI  Linux is easiest. Google minimal Linux  elinux and make sure instructions are for beagles not panda.once

From Android 4G on HTC Sense dual core SnapDragon.


----- Reply message -----
From: "valdez" <vald...@gmail.com>
To: <beagl...@googlegroups.com>
Subject: [beagleboard] Re: USB ethernet in U-boot
Date: Fri, Aug 31, 2012 7:35 am


Ok. I understand. But what about recommended on Ubuntu wiki site
live-build. I suppose it must be something that it is not possible to
create image with that tool. You are one of authors so you know that :) Is
that true that it can create images only for host architecture machines?

laza...@yahoo.com

unread,
Aug 31, 2012, 11:39:26 AM8/31/12
to beagl...@googlegroups.com
Maybe Valdez can just get uboot built and booting . Can you point him to a newbie site for that that doesn't use angstrom that works for c4. He can then add prebuilt file system and kernel. The file system build for me when starting was the most difficult


From Android 4G on HTC Sense dual core SnapDragon.

----- Reply message -----
From: "Robert Nelson" <robert...@gmail.com>
To: <beagl...@googlegroups.com>
Subject: [beagleboard] Re: USB ethernet in U-boot
Date: Fri, Aug 31, 2012 8:35 am


On Fri, Aug 31, 2012 at 7:35 AM, valdez <vald...@gmail.com> wrote:
> Ok. I understand. But what about recommended on Ubuntu wiki site live-build.
> I suppose it must be something that it is not possible to create image with
> that tool. You are one of authors so you know that :) Is that true that it
> can create images only for host architecture machines?

If that's what they recommend, then it's what they recommend... For
what I need, rootstock fits the bill, if i need something more, i just
use my netinstall script..

1: https://github.com/RobertCNelson/netinstall

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Robert Nelson

unread,
Aug 31, 2012, 11:45:46 AM8/31/12
to beagl...@googlegroups.com
On Fri, Aug 31, 2012 at 10:39 AM, laza...@yahoo.com <laza...@yahoo.com> wrote:
> Maybe Valdez can just get uboot built and booting . Can you point him to a
> newbie site for that that doesn't use angstrom that works for c4. He can
> then add prebuilt file system and kernel. The file system build for me when
> starting was the most difficult

For u-boot (mainline works fine on the C4):

git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2012.07 -b tmp

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- omap3_beagle_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

In ubuntu: "sudo apt-get install gcc-arm-linux-gnueabi" to get the arm
gcc cross compiler..
For others grap linaro's gcc toolchain:
https://launchpad.net/linaro-toolchain-binaries

valdez

unread,
Sep 1, 2012, 1:37:44 PM9/1/12
to beagl...@googlegroups.com
Thanks for answers. As I wrote couple messages before, I rebuilded U-Boot with changes suggested in README.usb U-Boot file to support Moschip Semiconductor MCS7830 chip. But I still couldn't get it working. I don't know what I miss.

I wanted to mention today that under Ubuntu on BeagleBoard, connected to EHCI port, it works. I have pings to my laptop and now have to figure out how to provide Internet from laptop wireless connection to BB :) I need internet because I'd like to install lxde to have GUI on TV :)


W dniu niedziela, 19 sierpnia 2012 16:31:18 UTC+2 użytkownik valdez napisał:
Reply all
Reply to author
Forward
0 new messages