cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get DHCP working with STM32F407 + DP83848

PFirm.1
Associate II

Hi, I am unable to get DHCP working. I am using the DP83848 board with an STM32F4 Discovery board. I am using the STM32CubeIDE and so had the code generated, the DP83848 is working on RMII mode.

When I enable or disable DHCP and connect it to my PC/laptop it would read an IP address of 169.254.***.*** of some sort with a MAC address of 00:e0:4c:68:01:a8 when it should be 00:80:E1:00:00:00 according to the configurations I can see in the IOC for the project. Anyone know why this is? Thanks in advance

7 REPLIES 7
LCE
Principal

What you see is probably not the discovery board.

I think you might need an extra software application that can make your PC / laptop work as an DHCP server. I used "dhcpsrv" some time ago.

Imen.D
ST Employee

Hello @PFirm.1​ ,

Would it be possible to share your initialization/configuration? It may be a problem with the connection!

Did you control the nRST pin?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi Imen,

Attached is the ioc for the project you can open with Cube. No I did not control the nRST pin. I have read in this thread that for the H7, someone had this problem because the DMA descriptor addresses are initialized by Cube incorrectly. Might this be a problem for this project as well? If so, how could I fix it.

Hi LCE,

I think it is the discovery board as when I ping it while connected, it is able to ping it correctly but as soon as I plug it off it is unable to ping it anymore like in the screenshot attached. But I will try to get my laptop working as a DHCP server first. Any other suggestions? Thanks0693W00000Lx81nQAB.png

Address like 169.254.x.y is APIPA address.

Check if your LwIP options file enables APIPA.

169.254.x.y is consequence of AUTOIP being enabled in lwipopts.h

http://www.nongnu.org/lwip/2_0_x/group__lwip__opts__autoip.html

Check if you have DHCP enabled, if dhcp_start() is called for the ETH netif, observe the netif's dhcp struct values, observe on bus if your device sends DHCP_REQUEST broadcasts... i.e. debug as usually.

JW

I do not see it being defined anywhere in the lwipopts.h