UART bad TX pin (Seeed XIAO RP2040, MicroPython)

I’m trying to use the XIAO RP2040 with the DFPlayer Mini, but I can’t get UART to initialize properly.

My understanding is that for UART, pin 6 is the TX pin and pin 7 is the RX pin, and the UART ID is 0.

I stripped it down to just the UART code with nothing plugged in to the board, and I still get this error: ValueError: bad TX pin

What am I doing wrong?

import machine

tx_pin = machine.Pin(6, machine.Pin.OUT)
rx_pin = machine.Pin(7, machine.Pin.IN)     

uart = machine.UART(0, 9600)
uart.init(9600, bits=8, parity=None, stop=1, tx=tx_pin, rx=rx_pin)

Hello, first I suppose you are using the micropython, if you wanna use the uart you would better to set it like the code:

from machine import UART,Pin
uart =UART(0,baudrate = 115200,bits = 8,parity = None,stop = 1 ,tx = Pin(0),rx = Pin(1))