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++

DHCP support in LWIP

Altera_Forum
Honored Contributor II
2,057 Views

Hi All 

 

I am trying to use the DHCP client in the lwip package. I've created a new web server project for the EP1C20 evaluation board and I see that there are dhcp.c and dhcp.h files in there, but no one seems to use them, so I don't think that the dhcp client is actually doing what it's supposed to do. 

 

My question is: is there any file or example showing how this client should be activated ?
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
664 Views

The factory config for Nios II (respective board) should show it in use. 

It goes out and gets your IP address from a DHCP server.
0 Kudos
Altera_Forum
Honored Contributor II
664 Views

Hello Kerri 

 

When you say: factory config, do you mean the "safe" configuration, because when I try to create a new web server project it uses a fixed ip address for all I can see and does not turn to the DHCP server. If you, can, please point me to a piece of code that does that. 

 

Nir
0 Kudos
Altera_Forum
Honored Contributor II
664 Views

Nios I use the safe config. Nio II uses 'factory_recovery' files. 

 

Are you on Nios I or II?
0 Kudos
Altera_Forum
Honored Contributor II
664 Views

 

--- Quote Start ---  

originally posted by nir@Sep 14 2004, 09:22 PM 

hi all 

 

i am trying to use the dhcp client in the lwip package. i've created a new web server project for the ep1c20 evaluation board and i see that there are dhcp.c and dhcp.h files in there, but no one seems to use them, so i don't think that the dhcp client is actually doing what it's supposed to do. 

 

my question is: is there any file or example showing how this client should be activated ? 

--- Quote End ---  

 

nir, 

 

If you're using LWIP with MicroC OS II then this is simple. If you look Chapter 9 of the Nios II Software Developers Handbook it explains that you need to implement a function as part of your application called get_ip_addr. This is where you decide what IP address to use, or whether to use DHCP. If you look at one of the networking example designs you will also see that there are example implementations of these functions. 

 

Hope that helps,
0 Kudos
Altera_Forum
Honored Contributor II
664 Views

What about using DHCP without the MicroC/OS. 

Is this possible? And if so, are there any examples of it out there? 

 

I use DHCP with MicroC/OS before and it works fine, but now I downloaded the stand-alone version of Lwip and I can&#39;t get DHCP to work... http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

Has anyone used DHCP with Lwip and without MicroC/OS?
0 Kudos
Altera_Forum
Honored Contributor II
664 Views

I never use DHCP because it never works. 

When I used the safe design of Nios I, the time-consuming DHCP trial never succeeded, maybe its my LAN&#39;s fault; so I turned DHCP off. 

In Nios II, I dont use it too, because it still wont work.
0 Kudos
Altera_Forum
Honored Contributor II
664 Views

The Nios1 and NiosII TCP/IP stacks are completely different. If DHCP is not working for you, I think it&#39;s almost certainly a configuration problem on your network. Do you PCs use DHCP?

0 Kudos
Reply