Skip to main content
vbk22398
Senior
January 6, 2025
Question

STM32F4 Ethernet - DHCP

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

This topic has been closed for replies.

11 replies

Pavel A.
January 7, 2025

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.

 

Andrew Neil
Super User
January 7, 2025

@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 ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ST Employee
January 8, 2025

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.
ST Employee
January 29, 2025

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.
vbk22398
vbk22398Author
Senior
February 4, 2025

@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.!

vbk22398
vbk22398Author
Senior
February 4, 2025

Screenshot 2025-02-04 103059.png

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

vbk22398
vbk22398Author
Senior
February 5, 2025

@STea Tried using cloning and I think it is because of the version mismatch, the error previously. No error and code compiled but I am getting the below in the ITM.

Screenshot 2025-02-05 114532.png


Kindly help me resolve this issue!

Thank You

ST Employee
February 11, 2025

Hello @vbk22398 ,

 you can disable ITM as you don't need it in your case and try the example out this can be done by commenting LWIP_DEBUG 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.