Recently I wanted to do some debugging of an emulator for a RP2350 board using the Pico SDK.
Using the USB for serial wasn't an option as my project uses TinyUSB for USB Host and there is an assert that aborts when TinyUSB Host is used and USB serial debug is set.
Looking at the Raspberry Pi SDK, I did some searching and looked to set up a secondary UART (uart1).
Note I did not have a Raspberry Pi Debug Probe so I'm using an FTDI Friend to get the signal level serial to USB to my computer, where I use a terminal program to see the serial output.
Setup
I looked at the pins I had free. I had D8 and D9 which are valid pins for UART2 via a table similar to the one below (source - https://electrocredible.com/raspberry-pi-pico-serial-uart-micropython/):
Fruit Jam Pin 8 is the serial transmit pin which goes to the receive pin on a serial to USB breakout.
Fruit Jam Pin 9 is the serial receive pin which goes to the transmit pin on a serial to USB breakout.
Fruit Jam GND pin connects to the ground pin on a serial to USB breakout.
In theĀ CMakeLists.txt for the project, I added the following:
target_compile_definitions(${TARGET} PRIVATE
PICO_DEFAULT_UART=1
PICO_DEFAULT_UART_TX_PIN=8
PICO_DEFAULT_UART_RX_PIN=9
)
pico_enable_stdio_uart(${TARGET} TRUE)
Where TARGET is defined earlier as my program. It specifies UART1 and the pins I wanted.
In the code setting up the UART:
//********************************************************************************** // Initialize the UART1 to put its messages out to stdio // see https://forums.raspberrypi.com/viewtopic.php?t=355690 //********************************************************************************** //stdout_uart_init(); stdio_uart_init_full(uart1, 115200, 8, 9);
I use Windows and Windows Subsystem for Linux. The terminal I chose for Windows is TeraTerm. I configured it for serial, 115200 baud, and the COM port the FTDI Friend shows up as.
This page (Serial Debug on RP2350 Boards) was last updated on May 22, 2025.
Text editor powered by tinymce.