---
title: "W5500 - Errors in function"
url: "https://maker.wiznet.io/forum/12855"
markdown_url: "https://maker.wiznet.io/forum/12855/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Alexander"
created: "2018-04-16T13:47:19+09:00"
last_activity: "2018-04-16T14:00:49+09:00"
language: "en"
views: 702
replies: 0
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 - Errors in function

## Question

Asked by Alexander on 2018-04-16 in Ethernet Chips.

Hi everyone!

I’m trying to run the W5500 chip with standard functions, but I fail at the very beginning. I want to write a code for data transfer via SPI, and now i have this:

***void SPI_MasterInit(void) //Initialize SPI**{**DDRB = ((1&lt;&lt;PB5)|(1&lt;&lt;PB7)|(1&lt;&lt;PB4)); //spi pins on port b MOSI SCK,SS outputs**PCR |= ((1&lt;&lt;SPE)|(1&lt;&lt;MSTR)|(1&lt;&lt;SPR0)); // SPI enable, Master, f/16**}**uint8_t spi_rb(void) { //Read/write functions**SPDR = 0x00;**while (!(SPSR & (1 &lt;&lt; SPIF)));**return SPDR;**}**void spi_wb(uint8_t wb) {**SPDR = wb;**while (!(SPSR & (1 &lt;&lt; SPIF)));**}***

But when I write in the main function (or refer to the main function) on this:

***reg_wizchip_spi_cbfunc(spi_rb, spi_wb);***

The compiler produces an error:

***undefined reference to `reg_wizchip_spi_cbfunc(unsigned char (*)(), void (*)(unsigned char))’***

If someone came across this, give me advice on how this can be prevented. I’ve been trying to run the B5500 for almost a month and get it to work, but it does not work.

Thank you for any answer. Peace to you

---

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