Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

General • Redirect UART from pico debug probe to gpio 16 and 17

$
0
0
Hello all

I am using Pico Debug probe to read my printf but I am using the default UART pins for some other purpose. My Q is how do I redirect the logging info to these pins and have it appear on the terminal.

Code:

#include <stdlib.h>#include <stdio.h>#include <string.h>#include "hardware/uart.h"#include "bsp/board_api.h"#include "tusb.h"#include "msc_app.h"#include "file_processing.h"#include "string_processing.h"#include "pico/stdlib.h"#define UART_ID uart0#define BAUD_RATE 115200.#define UART_TX_PIN 16#define UART_RX_PIN 17//--------------------------------------------------------------------+// MACRO CONSTANT TYPEDEF PROTYPES//--------------------------------------------------------------------+void led_blinking_task(void);/*------------- MAIN -------------*/int main(void) {  timer_hw->dbgpause = 0;    uart_init(UART_ID, BAUD_RATE);    // Set the TX and RX pins by using the function select on the GPIO    // Set datasheet for more information on function select    gpio_set_function(UART_TX_PIN, UART_FUNCSEL_NUM(UART_ID, UART_TX_PIN));    gpio_set_function(UART_RX_PIN, UART_FUNCSEL_NUM(UART_ID, UART_RX_PIN));    board_init();   printf("TinyUSB Host MassStorage Explorer Example\r\n");
this is my attempt but its not working.

Any advice can help
Kind regards

Statistics: Posted by Maaz1 — Wed Jan 21, 2026 2:22 pm — Replies 3 — Views 57



Viewing all articles
Browse latest Browse all 7503

Trending Articles