Skip to main content
PFirm.1
Associate
April 6, 2022
Question

Unable to get DHCP working with STM32F407 + DP83848

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

This topic has been closed for replies.

7 replies

LCE
Principal III
April 6, 2022

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.

PFirm.1
PFirm.1Author
Associate
April 6, 2022

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

Pavel A.
April 6, 2022

Address like 169.254.x.y is APIPA address.

Check if your LwIP options file enables APIPA.

ST Technical Moderator
April 6, 2022

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
PFirm.1
PFirm.1Author
Associate
April 6, 2022

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.

waclawek.jan
Super User
April 6, 2022

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