From 50e539f97e6a169a0c87951bc6327d1f0ac23526 Mon Sep 17 00:00:00 2001 From: Marco Feltmann Date: Thu, 28 May 2026 22:27:14 +0000 Subject: [PATCH 1/4] Prepares target for Piromoni Blinky 2350 --- src/machine/board_blinky2350.go | 113 ++++++++++++++++++++++++++++++++ targets/blinky2350.json | 9 +++ 2 files changed, 122 insertions(+) create mode 100644 src/machine/board_blinky2350.go create mode 100644 targets/blinky2350.json diff --git a/src/machine/board_blinky2350.go b/src/machine/board_blinky2350.go new file mode 100644 index 0000000000..153b6772b0 --- /dev/null +++ b/src/machine/board_blinky2350.go @@ -0,0 +1,113 @@ +//go:build blinky2350 + +// Pin mapping verified against pimoroni/blinky2350 board/pins.csv. +// Chip: RP2350A (QFN-60, 30 GPIO) -> target inherits from "rp2350". +// Pin source: https://github.com/pimoroni/blinky2350/blob/main/board/pins.csv +// +// NOTES (verify before first flash): +// - POWER_EN (GPIO27) likely switches peripheral power. +// Verify polarity against the schematic; pull HIGH early if needed, +// otherwise the display will remain blank. +// - CHARGE_STAT is connected to EXT_GPIO2 (I2C IO expander) according to pins.csv, +// NOT the RP2350 -> intentionally not defined as a pin here. +// - The dot matrix is NOT driven via SPI (Latch/Blank/ +// Row-Clock are not SPI signals) -> use PIO or bit-banging. +// SPI0 and SPI1 are therefore set to NoPin (required by the machine package). + +package machine + +// Crystal oscillator frequency. +const xoscFreq = 12 // MHz + +// User buttons. +const ( + BUTTON_A Pin = GPIO7 + BUTTON_B Pin = GPIO9 + BUTTON_C Pin = GPIO10 + BUTTON_UP Pin = GPIO11 + BUTTON_DOWN Pin = GPIO6 + BUTTON_HOME Pin = GPIO22 + BUTTON_BOOT Pin = BUTTON_HOME + + BUTTON_RESET Pin = GPIO14 + BUTTON_INT Pin = GPIO15 +) + +// Case LEDs (4-zone mono illumination), named CL0..CL3 in the docs. +const ( + CL0 Pin = GPIO0 + CL1 Pin = GPIO1 + CL2 Pin = GPIO2 + CL3 Pin = GPIO3 + + LED = CL0 +) + +// LED dot matrix: column shift register + row driver. +// NOT SPI -> drive via PIO or bit-banging. +const ( + DISPLAY_COL_SCLK Pin = GPIO16 + DISPLAY_COL_DATA Pin = GPIO17 + DISPLAY_COL_LATCH Pin = GPIO18 + DISPLAY_COL_BLANK Pin = GPIO19 + DISPLAY_ROW_DATA Pin = GPIO20 + DISPLAY_ROW_CLK Pin = GPIO21 +) + +// I2C0 (Qwiic/STEMMA QT + RTC). +const ( + I2C0_SDA_PIN = GPIO4 + I2C0_SCL_PIN = GPIO5 +) + +// I2C1 is not routed to any header; NoPin satisfies the machine package. +const ( + I2C1_SDA_PIN Pin = NoPin + I2C1_SCL_PIN Pin = NoPin +) + +// SPI pins - the LED matrix is driven via PIO/bit-banging, not SPI. +// NoPin satisfies the machine package requirements. +const ( + SPI0_SCK_PIN Pin = NoPin + SPI0_SDO_PIN Pin = NoPin + SPI0_SDI_PIN Pin = NoPin + + SPI1_SCK_PIN Pin = NoPin + SPI1_SDO_PIN Pin = NoPin + SPI1_SDI_PIN Pin = NoPin +) + +// UART pins - default RP2350 UART0 mapping. +// Note: GPIO0/GPIO1 are also CL0/CL1 (case LEDs) +// Do not use UART0 and LEDs simultaneously. +const ( + UART0_TX_PIN = GPIO0 + UART0_RX_PIN = GPIO1 + UART_TX_PIN = UART0_TX_PIN + UART_RX_PIN = UART0_RX_PIN +) + +// Power / sensing. +const ( + VBUS_DETECT Pin = GPIO12 + RTC_ALARM Pin = GPIO13 + VBAT_SENSE Pin = GPIO26 + POWER_EN Pin = GPIO27 + SENSE_1V1 Pin = GPIO28 + + BATTERY = VBAT_SENSE +) + +var DefaultUART = UART0 + +// USB identifiers +const ( + usb_STRING_PRODUCT = "Blinky 2350" + usb_STRING_MANUFACTURER = "Pimoroni" +) + +var ( + usb_VID uint16 = 0x2E8A + usb_PID uint16 = 0x0005 +) diff --git a/targets/blinky2350.json b/targets/blinky2350.json new file mode 100644 index 0000000000..dfe8a95a37 --- /dev/null +++ b/targets/blinky2350.json @@ -0,0 +1,9 @@ +{ + "inherits": ["rp2350"], + "build-tags": ["blinky2350"], + "serial-port": ["2e8a:0005"], + "default-stack-size": 8192, + "ldflags": [ + "--defsym=__flash_size=16M" + ] +} From afc53fa6f611ed829cc6925ed5546669520cb371 Mon Sep 17 00:00:00 2001 From: Marco Feltmann Date: Thu, 28 May 2026 22:27:57 +0000 Subject: [PATCH 2/4] Adds target for Piromoni Badger 2350 --- src/machine/board_badger2350.go | 114 ++++++++++++++++++++++++++++++++ targets/badger2350.json | 9 +++ 2 files changed, 123 insertions(+) create mode 100644 src/machine/board_badger2350.go create mode 100644 targets/badger2350.json diff --git a/src/machine/board_badger2350.go b/src/machine/board_badger2350.go new file mode 100644 index 0000000000..28af7fed1d --- /dev/null +++ b/src/machine/board_badger2350.go @@ -0,0 +1,114 @@ +//go:build badger2350 + +// Pin mapping verified against pimoroni/badger2350 board/pins.csv. +// Chip: RP2350A (QFN-60, 30 GPIO) -> target inherits from "rp2350". +// Pin source: https://github.com/pimoroni/badger2350/blob/main/board/pins.csv +// +// NOTES (verify before first flash): +// - POWER_EN (GPIO27) likely switches peripheral/display power. +// Verify polarity against the schematic; pull HIGH early if needed, +// otherwise the display will remain blank. +// - CHARGE_STAT is connected to EXT_GPIO2 (I2C IO expander) according to pins.csv, +// NOT the RP2350 -> intentionally not defined as a pin here. + +package machine + +// Crystal oscillator frequency. +const xoscFreq = 12 // MHz + +// User buttons. +const ( + BUTTON_A Pin = GPIO7 + BUTTON_B Pin = GPIO9 + BUTTON_C Pin = GPIO10 + BUTTON_UP Pin = GPIO11 + BUTTON_DOWN Pin = GPIO6 + BUTTON_HOME Pin = GPIO22 + BUTTON_BOOT Pin = BUTTON_HOME + + // System / RTC-related buttons. + BUTTON_RESET Pin = GPIO14 + BUTTON_INT Pin = GPIO15 +) + +// Case LEDs (4-zone mono illumination), named CL0..CL3 in the docs. +const ( + CL0 Pin = GPIO0 + CL1 Pin = GPIO1 + CL2 Pin = GPIO2 + CL3 Pin = GPIO3 + + // Convention: first zone as default LED. + LED = CL0 +) + +// E-ink display (Inky), on SPI0. +const ( + INKY_BUSY Pin = GPIO16 + INKY_CS Pin = GPIO17 + INKY_SCLK Pin = GPIO18 + INKY_MOSI Pin = GPIO19 + INKY_DC Pin = GPIO20 + INKY_RES Pin = GPIO21 +) + +// SPI0 default pins == Inky bus. SDI is unused by the EPD, +// but GPIO16 is a valid SPI0 RX line on the RP2350. +const ( + SPI0_SCK_PIN = GPIO18 // INKY_SCLK + SPI0_SDO_PIN = GPIO19 // INKY_MOSI + SPI0_SDI_PIN = GPIO16 // (unused by the EPD) +) + +// SPI1 is not routed to any header; NoPin satisfies the machine package. +const ( + SPI1_SCK_PIN Pin = NoPin + SPI1_SDO_PIN Pin = NoPin + SPI1_SDI_PIN Pin = NoPin +) + +// UART pins - default RP2350 UART0 mapping. +// Note: GPIO0/GPIO1 are also CL0/CL1 (case LEDs) +// Do not use UART0 and LEDs simultaneously. +const ( + UART0_TX_PIN = GPIO0 + UART0_RX_PIN = GPIO1 + UART_TX_PIN = UART0_TX_PIN + UART_RX_PIN = UART0_RX_PIN +) + +// I2C0 (Qwiic/STEMMA QT + RTC PCF85063A). +const ( + I2C0_SDA_PIN = GPIO4 + I2C0_SCL_PIN = GPIO5 +) + +// I2C1 is not routed to any header; NoPin satisfies the machine package. +const ( + I2C1_SDA_PIN Pin = NoPin + I2C1_SCL_PIN Pin = NoPin +) + +// Power / Sensing. +const ( + VBUS_DETECT Pin = GPIO12 + RTC_ALARM Pin = GPIO13 + VBAT_SENSE Pin = GPIO26 + POWER_EN Pin = GPIO27 + SENSE_1V1 Pin = GPIO28 + + BATTERY = VBAT_SENSE +) + +var DefaultUART = UART0 + +// USB identifiers +const ( + usb_STRING_PRODUCT = "Badger 2350" + usb_STRING_MANUFACTURER = "Pimoroni" +) + +var ( + usb_VID uint16 = 0x2E8A + usb_PID uint16 = 0x0005 +) diff --git a/targets/badger2350.json b/targets/badger2350.json new file mode 100644 index 0000000000..55f28e63eb --- /dev/null +++ b/targets/badger2350.json @@ -0,0 +1,9 @@ +{ + "inherits": ["rp2350"], + "build-tags": ["badger2350"], + "serial-port": ["2e8a:0005"], + "default-stack-size": 8192, + "ldflags": [ + "--defsym=__flash_size=16M" + ] +} From f05c2e1f2b26ccb432632f59ea88a241b50e72d9 Mon Sep 17 00:00:00 2001 From: Marco Feltmann Date: Tue, 2 Jun 2026 21:26:45 +0000 Subject: [PATCH 3/4] Updates submodules --- lib/CMSIS | 2 +- lib/avr | 2 +- lib/bdwgc | 2 +- lib/binaryen | 2 +- lib/cmsis-svd | 2 +- lib/mingw-w64 | 2 +- lib/nrfx | 2 +- lib/picolibc | 2 +- lib/wasi-cli | 2 +- lib/wasi-libc | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/CMSIS b/lib/CMSIS index 9fe411cef1..f2cad43457 160000 --- a/lib/CMSIS +++ b/lib/CMSIS @@ -1 +1 @@ -Subproject commit 9fe411cef1cef5de58e5957b89760759de44e393 +Subproject commit f2cad4345783c948ed4a7f5cdb02cdc0856366f1 diff --git a/lib/avr b/lib/avr index 6624554c02..40d15c1c56 160000 --- a/lib/avr +++ b/lib/avr @@ -1 +1 @@ -Subproject commit 6624554c02b237b23dc17d53e992bf54033fc228 +Subproject commit 40d15c1c56c34926f0ee3a00cff2ceda491d8389 diff --git a/lib/bdwgc b/lib/bdwgc index 7577ca7c2d..1d38c6d905 160000 --- a/lib/bdwgc +++ b/lib/bdwgc @@ -1 +1 @@ -Subproject commit 7577ca7c2dc7364bb6733dab23be34231279db6b +Subproject commit 1d38c6d905a83b006df843440b380e51a2119871 diff --git a/lib/binaryen b/lib/binaryen index 11dba9b1c2..5e0ad2cc50 160000 --- a/lib/binaryen +++ b/lib/binaryen @@ -1 +1 @@ -Subproject commit 11dba9b1c2ad988500b329727f39f4d8786918c5 +Subproject commit 5e0ad2cc504f49777f4906e79359964e1d3ad505 diff --git a/lib/cmsis-svd b/lib/cmsis-svd index 05a9562ec5..c65f8551e5 160000 --- a/lib/cmsis-svd +++ b/lib/cmsis-svd @@ -1 +1 @@ -Subproject commit 05a9562ec59b87945a8d7177a4b08b7aa2f2fd58 +Subproject commit c65f8551e57c770344d229dcaa0bf838fa29aff4 diff --git a/lib/mingw-w64 b/lib/mingw-w64 index 8526cb6182..b536c4fdb0 160000 --- a/lib/mingw-w64 +++ b/lib/mingw-w64 @@ -1 +1 @@ -Subproject commit 8526cb618269440a94810b94b77f8bd48c5c3396 +Subproject commit b536c4fdb038a9c59a7e5fb36e7d1293c4dc61d6 diff --git a/lib/nrfx b/lib/nrfx index d779b49fc5..0883a272c3 160000 --- a/lib/nrfx +++ b/lib/nrfx @@ -1 +1 @@ -Subproject commit d779b49fc59c7a165e7da1d7cd7d57b28a059f16 +Subproject commit 0883a272c34004697dd56dfa44f6e2d0f8705689 diff --git a/lib/picolibc b/lib/picolibc index b92edfda8a..781ca5b80a 160000 --- a/lib/picolibc +++ b/lib/picolibc @@ -1 +1 @@ -Subproject commit b92edfda8ac6853772d87cadaeeeaa21b78609b6 +Subproject commit 781ca5b80a51e8186e5b2c58a03de7587a2e3cd2 diff --git a/lib/wasi-cli b/lib/wasi-cli index 6ae8261709..e922fd7bd1 160000 --- a/lib/wasi-cli +++ b/lib/wasi-cli @@ -1 +1 @@ -Subproject commit 6ae82617096e83e6606047736e84ac397b788631 +Subproject commit e922fd7bd137cd284a5e6c4815a5a630d32fdd01 diff --git a/lib/wasi-libc b/lib/wasi-libc index 1dfe5c302d..04bd527eb3 160000 --- a/lib/wasi-libc +++ b/lib/wasi-libc @@ -1 +1 @@ -Subproject commit 1dfe5c302d1c5ab621f7abf04620fae92700fd22 +Subproject commit 04bd527eb37512303f83efc01e4fb6222392849e From 22276ab3b8bd6b6ffb4ff2dde35bc4d7c371546e Mon Sep 17 00:00:00 2001 From: Marco Feltmann Date: Tue, 2 Jun 2026 22:02:02 +0000 Subject: [PATCH 4/4] Removes redundant csv mention --- src/machine/board_badger2350.go | 1 - src/machine/board_blinky2350.go | 1 - 2 files changed, 2 deletions(-) diff --git a/src/machine/board_badger2350.go b/src/machine/board_badger2350.go index 28af7fed1d..a012ad38d4 100644 --- a/src/machine/board_badger2350.go +++ b/src/machine/board_badger2350.go @@ -1,6 +1,5 @@ //go:build badger2350 -// Pin mapping verified against pimoroni/badger2350 board/pins.csv. // Chip: RP2350A (QFN-60, 30 GPIO) -> target inherits from "rp2350". // Pin source: https://github.com/pimoroni/badger2350/blob/main/board/pins.csv // diff --git a/src/machine/board_blinky2350.go b/src/machine/board_blinky2350.go index 153b6772b0..310afd7510 100644 --- a/src/machine/board_blinky2350.go +++ b/src/machine/board_blinky2350.go @@ -1,6 +1,5 @@ //go:build blinky2350 -// Pin mapping verified against pimoroni/blinky2350 board/pins.csv. // Chip: RP2350A (QFN-60, 30 GPIO) -> target inherits from "rp2350". // Pin source: https://github.com/pimoroni/blinky2350/blob/main/board/pins.csv //