---
title: "W5500 UDP sendto() timeout"
url: "https://maker.wiznet.io/forum/14674"
markdown_url: "https://maker.wiznet.io/forum/14674/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Andrej Buryachenko"
created: "2022-10-08T10:12:01+09:00"
last_activity: "2022-10-15T08:08:38+09:00"
language: "en"
views: 825
replies: 5
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 UDP sendto() timeout

## Question

Asked by Andrej Buryachenko on 2022-10-08 in Ethernet Chips.

Good afternoon.
I repeated the loopback_udps() example.
STM32 receives data from PC.
When sending data from STM32 to PC (sendto() function) always returns -13(SOCKERR_TIMEOUT).
Data is not transmitted from STM32 to PC. Wireshark does not catch packets.
Tell me what could be the problem.

## Replies

### Reply 1 by Eugeny, 2022-10-08

As soon as you get packets, MAC address, source IP address, mask, gateway IP address ad source port number must have been set properly. What is about destination IP address and destination port?

### Reply 2 by Andrej Buryachenko, 2022-10-08 (in reply to reply 1)

Thanks for the answer.
I found a solution to the problem.
In the source codes of the sendto() function
setSn_CR(sn,Sn_CR_SEND);
replaced by
setSn_CR(sn,Sn_CR_SEND_MAC);

### Reply 3 by Eugeny, 2022-10-08

By the way, you can find all the workflow in the W5100 datasheet [here](https://www.wiznet.io/wp-content/uploads/wiznethome/Chip/W5100/Document/W5100_DS_V128E.pdf) starting with page 41.

### Reply 4 by Andrej Buryachenko, 2022-10-14

good afternoon
Tell me please.
How to read the sender’s MAC address from the Socket RX buffer register of the W5500 chip. Sn_MR_UDP mode of operation.
Is it realistic to do so.

### Reply 5 by Eugeny, 2022-10-15

[![udp-receive](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/2/271c19b493080b180bb2a308543dd80bac5de1d3.png) udp-receive910×524 98.7 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/2/271c19b493080b180bb2a308543dd80bac5de1d3.png)

page 68 of the W5100 manual.

---

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