2022-04-05 11:26 PM
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
2022-04-06 01:44 AM
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.
2022-04-06 03:39 AM
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
2022-04-06 09:30 AM
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.
2022-04-06 09:35 AM
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? Thanks
2022-04-06 12:45 PM
Address like 169.254.x.y is APIPA address.
Check if your LwIP options file enables APIPA.
2022-04-06 02:29 PM
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
2022-04-06 03:45 PM
I do not see it being defined anywhere in the lwipopts.h