[{"element_type":"text","content":"\n  \n  \n        \u003cp\u003eRecently I wanted to do some debugging of an emulator for a RP2350 board using the Pico SDK.\u003c/p\u003e\n\u003cp\u003eUsing 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.\u003c/p\u003e\n\u003cp\u003eLooking at the Raspberry Pi SDK, I did some searching and looked to set up a secondary UART (uart1).\u003c/p\u003e\n\u003cp\u003eNote 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.\u003c/p\u003e\n      \n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eSetup\u003c/h2\u003e\n\u003cp\u003eI 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 - \u003ca href=\"https://electrocredible.com/raspberry-pi-pico-serial-uart-micropython/\"\u003ehttps://electrocredible.com/raspberry-pi-pico-serial-uart-micropython/\u003c/a\u003e):\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/835/original/a.png?1747919435","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/5335","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eFruit Jam Pin 8 is the serial transmit pin which goes to the receive pin on a serial to USB breakout.\u003c/p\u003e\n\u003cp\u003eFruit Jam Pin 9 is the serial receive pin which goes to the transmit pin on a serial to USB breakout.\u003c/p\u003e\n\u003cp\u003eFruit Jam GND pin connects to the ground pin on a serial to USB breakout.\u003c/p\u003e\n\u003cp\u003eIn the\u0026nbsp;\u003cstrong\u003eCMakeLists.txt\u003c/strong\u003e for the project, I added the following:\u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"target_compile_definitions(${TARGET} PRIVATE\n  PICO_DEFAULT_UART=1\n  PICO_DEFAULT_UART_TX_PIN=8\n  PICO_DEFAULT_UART_RX_PIN=9\n)\npico_enable_stdio_uart(${TARGET} TRUE)","metadata":{"language":"auto","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eWhere \u003ccode\u003eTARGET\u003c/code\u003e is defined earlier as my program. It specifies UART1 and the pins I wanted.\u003c/p\u003e\n\u003cp\u003eIn the code setting up the UART:\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"//**********************************************************************************\n// Initialize the UART1 to put its messages out to stdio \n//   see https://forums.raspberrypi.com/viewtopic.php?t=355690\n//**********************************************************************************\n  //stdout_uart_init();\n  stdio_uart_init_full(uart1, 115200, 8, 9);","metadata":{"language":"auto","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003cp\u003eI 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.\u003c/p\u003e\n      \n\n\n\n\n","metadata":{}}]