---
title: "W5300 get IP from DHCP server"
url: "https://maker.wiznet.io/forum/12101"
markdown_url: "https://maker.wiznet.io/forum/12101/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "linask"
created: "2017-01-18T16:21:33+09:00"
last_activity: "2017-05-04T08:39:44+09:00"
language: "en"
views: 1286
replies: 3
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5300 get IP from DHCP server

## Question

Asked by linask on 2017-01-18 in Ethernet Chips.

Hello,
I had very hard time while working with W5300. Originaly i use STM32F4 in SRAM interface. I downloaded example for W5300.

Can read id no problem, so my hardware works.

Now program itself does not want to work, i have no idea why, it does open socked and send connect, no problem, but i just can’t get any data flow.

My question is this. How based on W5300_Drv_V1.2.6 driver get IP address from DHCP server ?
I am too new to all LAN stuff, maybe some one can help me out. And if you do, can you do that based on V1.2.6 driver ?

Or maybe some on has complete working example for STM32F4 in FMC mode how to make throughput test ?

Many thanks !

## Replies

### Reply 1 by Matthew, 2017-01-26

Sorry too late.

I recommend that you refer to the link below. (Our ioLibrary)

[github.com/Wiznet/ioLibrary_Driver](https://github.com/Wiznet/ioLibrary_Driver)

Maybe this link can helped solution of your problem.

Thanks~!

Have a nice day

### Reply 2 by linask, 2017-02-03

I did try tah, but it didin’t worked.
should i just call DHCP run and that it ?
What would be correct procedure to get dhcp step by step using that code ?

### Reply 3 by becky, 2017-02-07

Hello,
Sorry for the late reply.

1. Initialize the DHCP using DHCP_init()

2. call callback function using reg_dhcp_cbfunc()

3. loop the dhcp_run() until the return value of dhcp_run() will be DHCP_IP_LEASED.
   If the return value is DHCP_IP_FAILED, you can process that is the timeout by counting.

[github.com/Wiznet/W5500_EVB/tre … hcp_client](https://github.com/Wiznet/W5500_EVB/tree/master/w5500evb_internet_dhcp_client)
You can download the dhcp example from the link above. Although it is for the W5500evb board, I think it will help you.

Thank you

---

Source: https://maker.wiznet.io/forum/12101
