---
title: "wizchip_setnetinfo set configuration doesnt set static IP"
url: "https://maker.wiznet.io/forum/12326"
markdown_url: "https://maker.wiznet.io/forum/12326/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Sachin Gole"
created: "2017-06-10T00:02:14+09:00"
last_activity: "2019-10-18T08:58:16+09:00"
language: "en"
views: 3053
replies: 6
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# wizchip_setnetinfo set configuration doesnt set static IP

## Question

Asked by Sachin Gole on 2017-06-10 in Ethernet Chips.

Hi All,

I am setting static IP to W5100 ethernet shield from STM32L476RG Nucleo board using wizchip_setnetinfo(&netInfo) API.

wizchip_init() retVal = 0

Network configuration:
MAC ADDRESS: 0:0:50:ba:fb:d8
IP ADDRESS: 192.168.6.192
NETMASK: 255.255.0.0
GATEWAY: 192.168.3.1

When I am calling
wizchip_getnetinfo(&netInfo);
PRINT_NETINFO(netInfo);

I am getting below values which are not valid.

Network configuration:
MAC ADDRESS: 0:0:28:dd:fd:ec
IP ADDRESS: 225.0.3.224
NETMASK: 255.255.0.0
GATEWAY: 224.213.1.1

Any suggestion why these unknown values are comming.

## Replies

### Reply 1 by Sachin Gole, 2017-06-10

My source code is

```
PRINT_HEADER();
reg_wizchip_cs_cbfunc(cs_sel, cs_desel);
reg_wizchip_spi_cbfunc(spi_rb, spi_wb);

int retVal = wizchip_init(bufSize, bufSize);
LoggingPrintf("wizchip_init() retVal = %d\r\n",retVal);


wiz_NetInfo netInfo = { .mac 	= {0x00, 0x50, 0x56, 0xba, 0xfb, 0xd8},	// Mac address
                          .ip 	= {192, 168, 6, 192},					// IP address
                          .sn 	= {255, 255, 0, 0},					// Subnet mask
                          .gw 	= {192, 168, 3, 1}};

wizchip_setnetinfo(&netInfo);
PRINT_NETINFO(netInfo);
HAL_Delay(1000);
wizchip_getnetinfo(&netInfo);
PRINT_NETINFO(netInfo);
```

Some how I am not getting static IP set to W5100 ethernet shield.

### Reply 2 by Eugeny, 2017-06-10 (in reply to reply 1)

What I see immediately is that `0:0:28:dd:fd:ec` is almost exactly the half of `0:0:50:ba:fb:d8`.

28*2=50; dd*2=1ba, fd*2=1fa, ec*2=1d8. As there’s one LSB mismatch (in FD/FB), I make a supposition that, if you use SPI, you somehow confuse bit stream, shifting data one bit early (or too late), or read data on wrong clock pulse, and last bit in values you read is a random dangling bit.

Thus:

1. check your SPI command/data shifting algorithm during **writing** and during **reading** (maybe issue in reading, not writing)?

2. ensure you wired all things correctly (applicable if you use parallel access to the chip).

### Reply 3 by Sachin Gole, 2017-06-10

Thank you for your help in analyzing issue and replying back.

`1. check your SPI command/data shifting algorithm during writing and during reading (maybe issue in reading, not writing)?`

- SPI driver code is generated by SW4STM32 workbench.

- Wiznet IO library is imported, so it has command/data shifting algorithm

- Usage initialization code is taken from link as it is
  [Adding ethernet connectivity to a STM32-Nucleo](http://www.carminenoviello.com/2015/08/28/adding-ethernet-connectivity-stm32-nucleo/)

`2. ensure you wired all things correctly (applicable if you use parallel access to the chip).`

- connections are done as per link mentioned on [Adding ethernet connectivity to a STM32-Nucleo](http://www.carminenoviello.com/2015/08/28/adding-ethernet-connectivity-stm32-nucleo/)
  Arduino ICSP PIN 1 (MISO) to Nucleo PIN PB_14.
  Arduino ICSP PIN 4 (MOSI) to Nucleo PIN PB_15.
  Arduino ICSP PIN 3 (SCK) to Nucleo PIN PB_13.
  Arduino D10 PIN (SS) to Nucleo PIN PB_12.

- Now only case which I can imagine is, as you know that ethernet SPI connection need to be done explicitly not through Ardeuno connector so I have reversed SPI connector by de-soldering and soldering on reverse side. So this exercise might have broke my connection with track.

**1. I can imagine issue may be with connection, However I have verified by Multimeter connectivity. I will check again. I have ordered 2 more boards.2. As I am following link exactly as it is, Do you think any other thing which I could try.3. Do you think any specific need to done with system clock so SPI will work.**

Best regards,
Sachin

### Reply 4 by Sachin Gole, 2017-06-13

There was issue with my system clock setup, It is fixed now. I can getting correct IP configured, It is working as expected.

Thanks for your help.

Best regards,
Sachin

### Reply 5 by panza, 2019-10-18 (in reply to reply 4)

Same problem here. After been setted, the wizchip_getnetinfo() call returns 255 values for all ip, subnet and gateway.
Can you deeper explain how you solve it?

### Reply 6 by Eugeny, 2019-10-18

panza:

> wizchip_getnetinfo() call returns 255 values for all ip, subnet and gateway.

If chip is reset properly and nothing had been written to these registers it returns zeroes for all these fields.

If you get 255 for them, then you either have written 255 to these fields before, or chip did not initialize properly. Do you wait required time after power on and check if software reset had been completed before configuring chip?

---

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