---
title: "W5500 - Reading RTR Register Value FFFF while loading w5500 SPI ethernet driver"
url: "https://maker.wiznet.io/forum/14919"
markdown_url: "https://maker.wiznet.io/forum/14919/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Kavya1"
created: "2023-05-24T11:51:20+09:00"
last_activity: "2023-07-03T06:49:35+09:00"
language: "en"
views: 444
replies: 9
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 - Reading RTR Register Value FFFF while loading w5500 SPI ethernet driver

## Question

Asked by Kavya1 on 2023-05-24 in Ethernet Chips.

Hi Team,

We try to interface W5500 SPI Ethernet module to 32-bit SPI interface with our RISC-V development board, We’ve enabled driver support for W5500, But during the kernel boot time, while driver initialisation “w5100_hw_reset” function calling “w5100_read16” function in that function seeing 65535 (FFFF) when tried to print it. But its expecting 2000. Checked MISO and CLK signal in oscilloscope but the MISO value we are seeing other then FFFF but the same value is not reflecting in the driver, please find the logs below for reference.

[ 0.000000] Linux version 5.10.41-soc (riscv@riscv) (riscv64-unknown-linux-gnu-gcc (crosstool-NG 1.24.0) 8.3.0, GNU ld (crosstool-NG 1.24.0) 2.32) #4 SMP Wed May 24 14:48:10 IST 2023
[ 3.429923] riscv : priv value 36075584
[ 3.440282] riscv : w5100_read16 65535

My SPI controller only supports 32 Bit slave devices, and do not support 8 & 16 Bit slaves.

Please do help me on this.

[![Screenshot from 2023-05-24 18-01-21](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/3/39484210b59c51dbdcd408cfb68f5cf9aa2dc4ae.jpeg) Screenshot from 2023-05-24 18-01-211106×606 75.2 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/3/39484210b59c51dbdcd408cfb68f5cf9aa2dc4ae.jpeg)

[![Screenshot from 2023-05-24 18-02-17](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/0/072a371d65e772dd3c393aff72698b8c88ea01f0.jpeg) Screenshot from 2023-05-24 18-02-17983×533 61 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/0/072a371d65e772dd3c393aff72698b8c88ea01f0.jpeg)

Regards,
Kavya.

## Replies

### Reply 1 by Eugeny, 2023-05-24

![](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/48.png) Kavya1:

> calling “w5100_read16” function in that function seeing 65535 (FFFF)

What register it reads? Did W5500 finish initialization at this time?

![](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/48.png) Kavya1:

> But its expecting 2000

Why?

![](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/48.png) Kavya1:

> Checked MISO and CLK signal in oscilloscope but the MISO value we are seeing other then FFFF but the same value is not reflecting in the driver

Do you check value at that exactly moment when kernel reads wrong value? What is on the MISO/MOSI wires?

### Reply 2 by Kavya1, 2023-05-25

Reading rtr register, Its not initialising.
In driver code defined rtr register value 2000(0x07D0).
In driver code defined spi_read16 function, when we print that function we are observing 65535 (FFFF) value, when we probe MISO and MOSI we’ve observing other then FFFF in oscilloscope, above attached images for CLK and MISO signal.

Regards,
Kavya.

### Reply 3 by lawrence, 2023-05-26 (in reply to reply 2)

Hi, [@Kavya1](https://maker.wiznet.io/u/kavya1)

which library are you using?

This is the official ioLibrary we support.

We could find risc-v customer from hongkong. but W5500 already worked well with 32bit ARM cortex-Mx

![](https://github.githubassets.com/favicons/favicon.svg) [github.com](https://github.com/Wiznet/ioLibrary_Driver/tree/master)

### [GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the...](https://github.com/Wiznet/ioLibrary_Driver/tree/master)

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

ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S. - GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the applica...

### Reply 4 by Kavya1, 2023-05-26

Hi,

Currently we are not using any library, enabled driver support for wiznet in 5.10.41 kernel, configured wiznet in device tree node. while booting wiznet driver is not loading it stopping in w5100_read16 () function.
is it mandatory to add ioLibrary?

Regards,
Kavya.

### Reply 5 by rena, 2023-05-30

Hi,
What did you write for the device tree code?
I was using the dts overlay file provided by version 5.10.x in the Raspberry Pi environment.
The code can be found in the link below.

- [Raspberry Pi linux dts overlay - w5500-overlay.dts](https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/w5500-overlay.dts)

### Reply 6 by Kavya1, 2023-06-12

Hi,

Below dts node used :
eth1@0 {
compatible = “wiznet,w5500”;
reg = &lt;0>;
interrupt-parent = &lt;&porta>;
pinctrl-names = “default”;
interrupts = &lt;21 IRQ_TYPE_EDGE_FALLING>;
irq-gpios = &lt;&porta 21 GPIO_ACTIVE_HIGH>;
mac-address = [00 08 DC 01 02 03];
spi-max-frequency = &lt;35000000>;
status = “okay”;
}

Tested w5100 using spidev_test getting rtr value 07D0, when we try to load Wiznet driver getting 65535(ffff), please find the attached logs below.

spidev_test logs:
spidev_test -D /dev/spidev0.0 -v -p “\x00\x19\x00\x00\x00”
[ 906.293490] cnds_runtime_resume @ 1143
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
[ 906.314953] kavya : spi phase
[ 906.334881] kavya : spi polarity
[ 906.355262] kavya : spi mode 0
[ 906.355268] kavya : select the slave
TX | 00 19 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |…|
RX | 01 02 03 07 D0 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |…|

wiznet driver logs:
[ 206.463853] WIZNET : data is 65535

Please do help me on this.

Regards,
Kavya .

### Reply 7 by Eugeny, 2023-06-12

![](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/48.png) Kavya1:

> TX | 00 19 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |…|
> RX | 01 02 03 **07 D0** __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |…|

Does it mean that SPI is functioning correctly?

Track how data is being passed till it displays

![](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/48.png) Kavya1:

> [ 206.463853] WIZNET : data is 65535

### Reply 8 by Kavya1, 2023-06-13

As per our observation spidev_test reading the actual value from the slave device, we will think like spi is functioning correctly.

When i probe the data line (MISO), getting FFFF find the attached oscilloscope signal below.

[![IMG20230612162929](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/873ba8086e4e2d48b5474082569a7f39d5a11700.jpeg) IMG202306121629291920×1083 200 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/873ba8086e4e2d48b5474082569a7f39d5a11700.jpeg)

Please share the compilation procedure for ioLibrary .

### Reply 9 by lawrence, 2023-07-03 (in reply to reply 8)

Hi, [@Kavya1](https://maker.wiznet.io/u/kavya1)

could you share the full signal with MOSI and MISO on oscilloscope ?

I would like to also check address, op and data format is right.

---

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