Skip to content

Commit

Permalink
targets: add support for Elecrow Pico rp2350 W5 boards (#4706)
Browse files Browse the repository at this point in the history
https://www.elecrow.com/pico-w5-microcontroller-development-boards-rp2350-microcontroller-board.html

Just the basics to get several test to work (blinky1, flash).

This board has an rtl8720d Wifi/bluetooth chip wired to UART1, but the
rtl8720d firmware installed is the AT cmd set, not the RPC interface
used by the rtl8720dn driver, so no wifi support at the moment.

---------

Co-authored-by: Yurii Soldak <ysoldak@gmail.com>
  • Loading branch information
scottfeldman and ysoldak authored Jan 20, 2025
1 parent 74effd2 commit 7305a44
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ endif
@$(MD5SUM) test.hex
$(TINYGO) build -size short -o test.hex -target=elecrow-rp2040 examples/blinky1
@$(MD5SUM) test.hex
$(TINYGO) build -size short -o test.hex -target=elecrow-rp2350 examples/blinky1
@$(MD5SUM) test.hex
ifneq ($(WASM), 0)
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/export
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/main
Expand Down
94 changes: 94 additions & 0 deletions src/machine/board_elecrow-rp2350-w5.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//go:build elecrow_rp2350

// This file contains the pin mappings for the Elecrow Pico rp2350 W5 boards.
//
// Elecrow Pico rp2350 W5 is a microcontroller using the Raspberry Pi RP2350
// chip and rtl8720d Wifi chip.
//
// - https://www.elecrow.com/pico-w5-microcontroller-development-boards-rp2350-microcontroller-board.html
package machine

// GPIO pins
const (
GP0 Pin = GPIO0
GP1 Pin = GPIO1
GP2 Pin = GPIO2
GP3 Pin = GPIO3
GP4 Pin = GPIO4
GP5 Pin = GPIO5
GP6 Pin = GPIO6
GP7 Pin = GPIO7
GP8 Pin = GPIO8
GP9 Pin = GPIO9
GP10 Pin = GPIO10
GP11 Pin = GPIO11
GP12 Pin = GPIO12
GP13 Pin = GPIO13
GP14 Pin = GPIO14
GP15 Pin = GPIO15
GP16 Pin = GPIO16
GP17 Pin = GPIO17
GP18 Pin = GPIO18
GP19 Pin = GPIO19
GP20 Pin = GPIO20
GP21 Pin = GPIO21
GP22 Pin = GPIO22
GP26 Pin = GPIO26
GP27 Pin = GPIO27
GP28 Pin = GPIO28

// Onboard LED
LED Pin = GPIO25

// Onboard crystal oscillator frequency, in MHz.
xoscFreq = 12 // MHz
)

// I2C Default pins on Raspberry Pico.
const (
I2C0_SDA_PIN = GP4
I2C0_SCL_PIN = GP5

I2C1_SDA_PIN = GP2
I2C1_SCL_PIN = GP3
)

// SPI default pins
const (
// Default Serial Clock Bus 0 for SPI communications
SPI0_SCK_PIN = GPIO18
// Default Serial Out Bus 0 for SPI communications
SPI0_SDO_PIN = GPIO19 // Tx
// Default Serial In Bus 0 for SPI communications
SPI0_SDI_PIN = GPIO16 // Rx

// Default Serial Clock Bus 1 for SPI communications
SPI1_SCK_PIN = GPIO10
// Default Serial Out Bus 1 for SPI communications
SPI1_SDO_PIN = GPIO11 // Tx
// Default Serial In Bus 1 for SPI communications
SPI1_SDI_PIN = GPIO12 // Rx
)

// UART pins
const (
UART0_TX_PIN = GPIO0
UART0_RX_PIN = GPIO1
UART1_TX_PIN = GPIO4 // Wired to rtl8720d UART1_Tx
UART1_RX_PIN = GPIO5 // Wired to rtl8720n UART1_Rx
UART_TX_PIN = UART0_TX_PIN
UART_RX_PIN = UART0_RX_PIN
)

var DefaultUART = UART0

// USB identifiers
const (
usb_STRING_PRODUCT = "Pico2"
usb_STRING_MANUFACTURER = "Raspberry Pi"
)

var (
usb_VID uint16 = 0x2E8A
usb_PID uint16 = 0x000F
)
12 changes: 12 additions & 0 deletions targets/elecrow-rp2350.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"inherits": ["rp2350"],
"build-tags": ["elecrow_rp2350"],
"serial-port": ["2e8a:000f"],
"default-stack-size": 8192,
"ldflags": [
"--defsym=__flash_size=8M"
],
"extra-files": [
"targets/pico-boot-stage2.S"
]
}

0 comments on commit 7305a44

Please sign in to comment.