---
title: "W5100S-EVB-Pico How to change UART default pins in C env."
url: "https://maker.wiznet.io/forum/14842"
markdown_url: "https://maker.wiznet.io/forum/14842/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "richw42"
created: "2023-03-23T22:51:27+09:00"
last_activity: "2023-04-17T23:02:37+09:00"
language: "en"
views: 529
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5100S-EVB-Pico How to change UART default pins in C env.

## Question

Asked by richw42 on 2023-03-23 in Ethernet Chips.

I designed a board to go with the W5100S-EVB-Pico. Silly me, I didn’t use the default pins for the uart. I’m using the procedure in [RP2040-HAT-C/getting_started.md at main · Wiznet/RP2040-HAT-C · GitHub](https://github.com/Wiznet/RP2040-HAT-C/blob/main/getting_started.md)
I found the following in \RP2040-HAT-C\libraries\pico-sdk\src\boards\include\boards\pico.h
// — UART —
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
However, when I edited this file, it was overwritten during the build process.
How can I override PICO_DEFAULT_UART_RX_PIN (& TX)?

## Replies

### Reply 1 by austin, 2023-03-28

Hello [@richw42](https://maker.wiznet.io/u/richw42)

Please refer to the example in the link below.

- [pico-examples/uart at master · raspberrypi/pico-examples · GitHub](https://github.com/raspberrypi/pico-examples/tree/master/uart)

### Reply 2 by richw42, 2023-03-29 (in reply to reply 1)

Thank you, austin. I also found a good answer in Raspberry Pi Pico C/C++ SDK section 2.6.2, where you can override the default settings directly at compile time. Something like the following:

add_executable(hello_world
hello_world.c
)

## SPECIFY two preprocessor definitions for the target hello_world

target_compile_definitions(hello_world PRIVATE
PICO_DEFAULT_UART_TX_PIN=16
PICO_DEFAULT_UART_RX_PIN=17
)

## Pull in our pico_stdlib which aggregates commonly used features

target_link_libraries(hello_world pico_stdlib)

## create map/bin/hex/uf2 file etc.

pico_add_extra_outputs(hello_world)

---

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