Skip to content

Commit 7305a44

Browse files
targets: add support for Elecrow Pico rp2350 W5 boards (#4706)
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>
1 parent 74effd2 commit 7305a44

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

GNUmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,8 @@ endif
863863
@$(MD5SUM) test.hex
864864
$(TINYGO) build -size short -o test.hex -target=elecrow-rp2040 examples/blinky1
865865
@$(MD5SUM) test.hex
866+
$(TINYGO) build -size short -o test.hex -target=elecrow-rp2350 examples/blinky1
867+
@$(MD5SUM) test.hex
866868
ifneq ($(WASM), 0)
867869
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/export
868870
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/main
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
//go:build elecrow_rp2350
2+
3+
// This file contains the pin mappings for the Elecrow Pico rp2350 W5 boards.
4+
//
5+
// Elecrow Pico rp2350 W5 is a microcontroller using the Raspberry Pi RP2350
6+
// chip and rtl8720d Wifi chip.
7+
//
8+
// - https://www.elecrow.com/pico-w5-microcontroller-development-boards-rp2350-microcontroller-board.html
9+
package machine
10+
11+
// GPIO pins
12+
const (
13+
GP0 Pin = GPIO0
14+
GP1 Pin = GPIO1
15+
GP2 Pin = GPIO2
16+
GP3 Pin = GPIO3
17+
GP4 Pin = GPIO4
18+
GP5 Pin = GPIO5
19+
GP6 Pin = GPIO6
20+
GP7 Pin = GPIO7
21+
GP8 Pin = GPIO8
22+
GP9 Pin = GPIO9
23+
GP10 Pin = GPIO10
24+
GP11 Pin = GPIO11
25+
GP12 Pin = GPIO12
26+
GP13 Pin = GPIO13
27+
GP14 Pin = GPIO14
28+
GP15 Pin = GPIO15
29+
GP16 Pin = GPIO16
30+
GP17 Pin = GPIO17
31+
GP18 Pin = GPIO18
32+
GP19 Pin = GPIO19
33+
GP20 Pin = GPIO20
34+
GP21 Pin = GPIO21
35+
GP22 Pin = GPIO22
36+
GP26 Pin = GPIO26
37+
GP27 Pin = GPIO27
38+
GP28 Pin = GPIO28
39+
40+
// Onboard LED
41+
LED Pin = GPIO25
42+
43+
// Onboard crystal oscillator frequency, in MHz.
44+
xoscFreq = 12 // MHz
45+
)
46+
47+
// I2C Default pins on Raspberry Pico.
48+
const (
49+
I2C0_SDA_PIN = GP4
50+
I2C0_SCL_PIN = GP5
51+
52+
I2C1_SDA_PIN = GP2
53+
I2C1_SCL_PIN = GP3
54+
)
55+
56+
// SPI default pins
57+
const (
58+
// Default Serial Clock Bus 0 for SPI communications
59+
SPI0_SCK_PIN = GPIO18
60+
// Default Serial Out Bus 0 for SPI communications
61+
SPI0_SDO_PIN = GPIO19 // Tx
62+
// Default Serial In Bus 0 for SPI communications
63+
SPI0_SDI_PIN = GPIO16 // Rx
64+
65+
// Default Serial Clock Bus 1 for SPI communications
66+
SPI1_SCK_PIN = GPIO10
67+
// Default Serial Out Bus 1 for SPI communications
68+
SPI1_SDO_PIN = GPIO11 // Tx
69+
// Default Serial In Bus 1 for SPI communications
70+
SPI1_SDI_PIN = GPIO12 // Rx
71+
)
72+
73+
// UART pins
74+
const (
75+
UART0_TX_PIN = GPIO0
76+
UART0_RX_PIN = GPIO1
77+
UART1_TX_PIN = GPIO4 // Wired to rtl8720d UART1_Tx
78+
UART1_RX_PIN = GPIO5 // Wired to rtl8720n UART1_Rx
79+
UART_TX_PIN = UART0_TX_PIN
80+
UART_RX_PIN = UART0_RX_PIN
81+
)
82+
83+
var DefaultUART = UART0
84+
85+
// USB identifiers
86+
const (
87+
usb_STRING_PRODUCT = "Pico2"
88+
usb_STRING_MANUFACTURER = "Raspberry Pi"
89+
)
90+
91+
var (
92+
usb_VID uint16 = 0x2E8A
93+
usb_PID uint16 = 0x000F
94+
)

targets/elecrow-rp2350.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"inherits": ["rp2350"],
3+
"build-tags": ["elecrow_rp2350"],
4+
"serial-port": ["2e8a:000f"],
5+
"default-stack-size": 8192,
6+
"ldflags": [
7+
"--defsym=__flash_size=8M"
8+
],
9+
"extra-files": [
10+
"targets/pico-boot-stage2.S"
11+
]
12+
}

0 commit comments

Comments
 (0)