[En-Nut-Discussion] Ethernet not working when booting from NandFlash
Rasmus Aagesen
rasmus.aagesen at tonica.dk
Sun Aug 29 16:18:16 CEST 2010
Hey,
I have made an application that will run some protocol's over Ethernet.
I am using At91sam9260-EK evaluation kit for test and SAM-BA v.2.8 for
loading the application.
I am using "ethernut-4.8.2" to set up Ethernet driver.
I am not using a DHCP server so I give it a fix ip address.
Here is my code for setting the ehternet driver up:
//////////////////////////////////////////////////////////
u_char mac[6] = { 0x00, 0x06, 0x98, 0x00, 0x00, 0x58 };
NutRegisterDevice(&DEV_ETHER, 0x8300, 5);
NutNetLoadConfig(DEV_ETHER_NAME);
memcpy(confnet.cdn_mac, mac, 6);
NutNetSaveConfig();
u_long ip_addr = inet_addr("192.168.1.98");
u_long ip_mask = inet_addr("255.255.255.0");
NutNetIfConfig("eth0", mac, ip_addr, ip_mask);
printf("IP: %s\n", inet_ntoa(confnet.cdn_ip_addr));
//////////////////////////////////////////////////////////
My application works fine when I load it in address 0x20000000 in SDRam. I
get the ip address that I have coded in my application and when it ping it
via msdos it responds.
The "NutRegisterDevice(&DEV_ETHER, 0x8300, 5);" function respond with 0.
I then load my application in NandFlash at address 0x20000 and use Atmel's
Bootstrap that I am loading in address 0x0.
My board is now booting from NandFlash and load my application to 0x20000000
in SDRam, this work's fin.
I but when I try to ping it, it does not respond and the
"NutRegisterDevice(&DEV_ETHER, 0x8300, 5);" function respond with -1.
I am using "NutRegisterDevice()" to set up the debugger here it responds
with 0 and works fine.
To summaries the problem, the set up for Ethernet driver is not working when
booting from NandFlash, but work's fin when loading it to SDRam.
Any help will be appreciated.
Best Regards,
Rasmus.
More information about the En-Nut-Discussion
mailing list