Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12551 Discussions

NEEK: U-boot can't access network

Honored Contributor II



I'm a newbie to NIOS2 and have been following the Extreme Guide to kiil NEEK with u-boot. 


I'm trying out u-boot 2011.06 building with the 4.1.2 gcc mmu tools from nios2-linux-20100621.tar. 


I have used the NEEK.h and neek_ocm_spi_mmu.h headers for u-boot and the associated cycloneIII_embedded_evaluation_kit_standard.sof from the Extreme webpage. The build succeeds and gives me a 'u-boot' file. 


I then do: 


> nios2-configure-sof cycloneIII_embedded_evaluation_kit_standard.sof 

> nios2-download -g u-boot 

> nios2-terminal 


and see: 


U-Boot 2011.06-svn290 (Sep 26 2011 - 17:55:37) 


CPU : Nios-II 

SYSID : 5f316e28, Mon Oct 05 10:56:53 2009 



*** Warning - bad CRC, using default environment 


Net: ETHOC-0 



Which looks okay. So I continue: 


==> setenv ethaddr 08:00:3e:26:0a:5b 

==> setenv ipaddr x.x.x.x 

==> setenv serverip y.y.y.y 

==> tftp c1000000 neek.bin 


But tftp just times out over and over again. It makes no difference if the Ethernet cable is inserted or not. 



Using ETHOC-0 device 

TFTP from server y.y.y.y; our IP address is x.x.x.x 

Filename 'neek.bin'. 

Load address: 0xc1000000 

Loading: T T T T T T T T T T 

Retry count exceeded; starting again 


The extreme web page has a link for a u-boot elf file, but seems to link to a .gz with a u-boot.bin file in it, so I can't try out any other u-boot build than mine. 


My tftp server is used regularly with u-boot on ARM systems, so I think that is okay. Also 'dhcp' (which works on our ARM systems) never gets an IP address, so I assume this is something more fundamental to the ETHOC MAC driver in u-boot. 


Networking in the demo application selector demos seems to work okay - including the uClinux demo - so the H/W seems okay too. 


Any ideas what I could have done wrong? 



0 Kudos
1 Reply
Honored Contributor II

So, I realise that I should probably have put this in the general software forum, rather than this one, but I have it working now. 


The Extreme NEEK wiki is wrong (at least with latest u-boot). You can't simply set your ethaddr (MAC address) environment variable and then start using your network. ethaddr *MUST* be set at u-boot boot time or it will not get programmed into the ETHOC EMAC and hence you can't receive (or send?) any packets other than broadcasts. 


If you are setting everything up to run with env from FLASH, then you can save ethaddr there and reboot/reload. 


It you are only running from RAM (in order to setup the FLASH images maybe), you will have to find another way. I simply added the following to NEEK.h: 


# define CONFIG_EXTRA_ENV_SETTINGS "ethaddr=02:00:3e:26:0a:5b\0" 


This is a really bad idea - never release code with this in. But it might just get you going. Once you're up, take some time to set up your environment in FLASH and once that's working, remove that above line and do it properly. 


0 Kudos