cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Ethernet - DHCP

vbk22398
Senior

Hi,
 I am trying to implement basic DHCP Protocol using STM32F439ZIT6. But I am unable to get the IP being assigned by the DHCP Server. There are no errors in the code, but I am not getting the IP. Don't know why it is giving DHCP Timeout. I am attaching my code, please go through the code and let me know the solution. Am Struck here for a while!


Thank you

10 REPLIES 10
Pavel A.
Evangelist III

Use wireshark (or other analyzer) to see what your program sends for DHCP request, and what (if any) is the reply.

If this looks too hard, here you can find help.

 


@vbk22398 wrote:

I am unable to get the IP being assigned by the DHCP Server. you


So what testing/investigation/debugging have you done to find what's going wrong?

Are you sending a valid request, to a valid server?

Are you sure there actually is a DHCP server accessible at all ?

Is it seeing the request ?

Is it sending a response ?

STea
ST Employee

Hello @vbk22398 ,

Please take a look at this example in GitHub which I implemented for showing LWIP debug capabilities on STM322F429/39 MCUs but it is still in its core a simple HTTP application implementing DHCP. 
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
STea
ST Employee

Hello @vbk22398 ,

Any updates ?
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@STea Tried the library which you gave but still no progress in the same. So I am looking for alternate STM32 Evaluation Boards which has many libraries for Ethernet functionality. 
Thank you for asking.!

Screenshot 2025-02-04 103059.png

 I am getting the above error in the code. Don't know why it is happening? @STea 

Hello @vbk22398 ,

You need to add the have 

#define HTTPD_USE_CUSTOM_FSDATA 0

in lwipopts.h.
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Tried this already. Still the issue persists. 

Thank You!

@STea 

Hello @vbk22398 ,

I'm compiling the same project I've shared with you on GitHub, and it is working fine and I have even got it from GitHub again using git clone command:

git clone https://github.com/stm32-hotspot/CKB-STM32-HTTP-Example-With-LWIP-Debug.git

 and recompile it and it is compiling with 0 errors please try to get a fresh project and recompile with a new version of Cubeide I've tested on CubeIDE V1.16 and 1.17 and it is working fine 

STea_0-1738680723374.png

Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.