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

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
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)?

Hello @richw42

Please refer to the example in the link below.

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)