---
title: "W6100 SPI TX"
url: "https://maker.wiznet.io/forum/14899"
markdown_url: "https://maker.wiznet.io/forum/14899/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Richard"
created: "2023-05-05T08:41:50+09:00"
last_activity: "2023-06-15T06:26:11+09:00"
language: "en"
views: 206
replies: 0
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W6100 SPI TX

## Question

Asked by Richard on 2023-05-05 in Ethernet Chips.

I’ve been working on a driver for STM32F4 to work with W6100 over SPI using MikroC Pro for ARM.
Initially implementing a Telnet server just to get things started.
So far this has been pretty sucessful, can read chip ID etc. set MAC address , IPv4 parameters , establish a TCP connection and receive data from a telnet client.
However it appears that I’m misunderstanding what is required for TX.
As I understand I should:-

1. Get the TX buffer size for the socket in use by reading Sn_TX_BSR (0x0200)

2. Check the free size in the socket TX buffer by reading Sn_TX_FSR(0x0204)

3. Get the buffer start address by reading Sn_TX_WR(0x020C)

4. Write my TX data to the buffer at the buffer start address.

5. Write the new buffer start (old buffer start + message size) to socket write pointer Sn_TX_WR(0x020C)

6. Write ‘send’ command (0x20) to socket Command Register Sn_CR(0x0010)

7. Poll Sn_CR(0x0010) until ==0

When I do this I get a lot of garbage transmitted, with my message text somewhere towards the end.
It looks like I’m misunderstanding the process, can anybody offer any advice?

---

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