From 26ff622148c80943404cc92790b40a1ec9325b65 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 26 Feb 2026 19:36:58 +0100 Subject: [PATCH] targets: add support for Seeedstudio Xiao-RP2350 board. Signed-off-by: deadprogram --- GNUmakefile | 2 + src/machine/board_xiao-rp2350.go | 93 ++++++++++++++++++++++++++++++++ targets/xiao-rp2350.json | 8 +++ 3 files changed, 103 insertions(+) create mode 100644 src/machine/board_xiao-rp2350.go create mode 100644 targets/xiao-rp2350.json diff --git a/GNUmakefile b/GNUmakefile index 3eed5b941..6a2b8c1cd 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -816,6 +816,8 @@ endif @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=vicharak_shrike-lite examples/echo @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=xiao-rp2350 examples/blinky1 + @$(MD5SUM) test.hex # test pwm $(TINYGO) build -size short -o test.hex -target=itsybitsy-m0 examples/pwm @$(MD5SUM) test.hex diff --git a/src/machine/board_xiao-rp2350.go b/src/machine/board_xiao-rp2350.go new file mode 100644 index 000000000..30003d460 --- /dev/null +++ b/src/machine/board_xiao-rp2350.go @@ -0,0 +1,93 @@ +//go:build xiao_rp2350 + +// This file contains the pin mappings for the Seeed XIAO RP2350 boards. +// +// XIAO RP2350 is a microcontroller using the Raspberry Pi RP2350 chip. +// +// - https://wiki.seeedstudio.com/XIAO-RP2350/ +package machine + +// Digital Pins +const ( + D0 Pin = GPIO26 + D1 Pin = GPIO27 + D2 Pin = GPIO28 + D3 Pin = GPIO5 + D4 Pin = GPIO6 + D5 Pin = GPIO7 + D6 Pin = GPIO0 + D7 Pin = GPIO1 + D8 Pin = GPIO2 + D9 Pin = GPIO4 + D10 Pin = GPIO3 + D11 Pin = GPIO21 + D12 Pin = GPIO20 + D13 Pin = GPIO17 + D14 Pin = GPIO16 + D15 Pin = GPIO11 + D16 Pin = GPIO12 + D17 Pin = GPIO10 +) + +// Analog pins +const ( + A0 Pin = D0 + A1 Pin = D1 + A2 Pin = D2 +) + +// Onboard LEDs +const ( + NEOPIXEL = GPIO22 + WS2812 = GPIO22 + NEO_PWR = GPIO23 + NEOPIXEL_POWER = GPIO23 + + LED = GPIO25 +) + +// I2C pins +const ( + I2C0_SDA_PIN Pin = D14 + I2C0_SCL_PIN Pin = D13 + + I2C1_SDA_PIN Pin = D4 + I2C1_SCL_PIN Pin = D5 +) + +// SPI pins +const ( + SPI0_SCK_PIN Pin = D8 + SPI0_SDO_PIN Pin = D10 + SPI0_SDI_PIN Pin = D9 + + SPI1_SCK_PIN Pin = D17 + SPI1_SDO_PIN Pin = D15 + SPI1_SDI_PIN Pin = D16 +) + +// Onboard crystal oscillator frequency, in MHz. +const ( + xoscFreq = 12 // MHz +) + +// UART pins +const ( + UART0_TX_PIN = GPIO0 + UART0_RX_PIN = GPIO1 + UART_TX_PIN = UART0_TX_PIN + UART_RX_PIN = UART0_RX_PIN +) + +var DefaultUART = UART0 + +// USB CDC identifiers +const ( + usb_STRING_PRODUCT = "XIAO RP2350" + usb_STRING_MANUFACTURER = "Seeed" +) + +var ( + usb_VID uint16 = 0x2e8a + usb_PID uint16 = 0x000a +) diff --git a/targets/xiao-rp2350.json b/targets/xiao-rp2350.json new file mode 100644 index 000000000..dd65bbcbb --- /dev/null +++ b/targets/xiao-rp2350.json @@ -0,0 +1,8 @@ +{ + "inherits": [ + "rp2350" + ], + "serial-port": ["2e8a:000a"], + "build-tags": ["xiao_rp2350"], + "default-stack-size": 8192 +}