program with MAC address in AT91SAM9260 board

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

maosenfang
Posts: 5
Joined: Thu Jan 11, 2007 10:46 pm

program with MAC address in AT91SAM9260 board

Tue Mar 13, 2007 1:49 pm

I use buildroot to build kernel 2.6.19 for AT92SAM9260 ek board,
I set up eth0, when I run "ifconfig eth0", I see the config is as followings:
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:21 Base address:0x4000
The HWaddr is all 0's, I can not "ifup eth0"

Then I debuged this, and got error message as following:
eth0: Atmel MACB at 0xfffc4000 irq 21 (00:00:00:00:00:00)

Please help me.
mwolfram
Contact:
Location: Erfurt/Germany
Posts: 87
Joined: Thu Feb 03, 2005 11:41 am

Tue Mar 13, 2007 8:43 pm

Hi,

you need to setup an MAC address when running ifconfig. See the man page of ifconfig for the right parameter.

If you didn't get an MAC address with your board and the system isn't connected to something official then use something similar to the MAC address of your PC for testing. Or look into uboot if there is already one configured. By default uboot won't pass it to Linux. If you executed some network commands within uboot this will setup the MAC address.

--
Mike
Senior IT Consultant
Germany
maosenfang
Posts: 5
Joined: Thu Jan 11, 2007 10:46 pm

Wed Mar 14, 2007 1:55 pm

I have tried "setenv ethaddr ac:de:48:02:03:04", and "saveenv" in u-boot, but it only works for u-boot. Each time when I enter u-boot, the ethernet address is right, but when I boot into linux, it is all 0's again. Should I also setup server ipaddr and serverip and do some tftp to activate this mac address?
I also tried "ifconfig eth0 ether ac:de:48:02:03:04", but nothing happened. Is there any order of ifconfig setting I should take care of?
mwolfram
Contact:
Location: Erfurt/Germany
Posts: 87
Joined: Thu Feb 03, 2005 11:41 am

Wed Mar 14, 2007 2:09 pm

Hi,

uboot will initialize ethernet only if you call any network command in uboot. Try ping localhost before booting Linux and you will have a running network. But this is only a workaround, you need to run ifconfig with the MAC address within Linux. With uboot is a small tool included which will read under Linux the uboot environment so you can get the MAC address and set it up with ifconfig. As I said, read the man page for ifconfig.

--
Mike
Senior IT Consultant
Germany
csharman
Posts: 18
Joined: Wed Jan 10, 2007 8:13 am

Fri Mar 16, 2007 12:19 pm

Hi,

if you are using busybox for ifconfig make sure "hw ether" is set in the busybox configuration. I had to do this before it would change the MAC address, otherwise the command silently fails.

Cheers
Chris
maosenfang
Posts: 5
Joined: Thu Jan 11, 2007 10:46 pm

Thu Apr 12, 2007 7:41 pm

thank you a lot.
I enabled the hw ether in the busybox, now it works. :)

Return to “LINUX”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests