From 79b0c671fc46987c9cdc8591e5895866f48dfcd8 Mon Sep 17 00:00:00 2001 From: mhidro Date: Thu, 17 Aug 2023 13:06:37 +0300 Subject: [PATCH 1/2] ports/rp2/boards: Added support for YD-RP2040 by VCC-GND studio 4 8 16 MB flash which is a pin compatible PICO clone. ports/rp2/boards: Added support for YD-RP2040 by VCC-GND studio 4 8 16 MB flash which is a pin compatible PICO clone. --- ports/rp2/boards/VCC_GND_YD_RP2040/README.md | 45 ++++++++++++++ ports/rp2/boards/VCC_GND_YD_RP2040/board.json | 24 +++++++ ports/rp2/boards/VCC_GND_YD_RP2040/deploy.md | 8 +++ .../rp2/boards/VCC_GND_YD_RP2040/manifest.py | 2 + .../boards/VCC_GND_YD_RP2040/modules/board.py | 5 ++ .../VCC_GND_YD_RP2040/mpconfigboard.cmake | 24 +++++++ .../boards/VCC_GND_YD_RP2040/mpconfigboard.h | 4 ++ ports/rp2/boards/VCC_GND_YD_RP2040/pins.csv | 3 + .../VCC_GND_YD_RP2040/ydrp2040_common.h | 62 +++++++++++++++++++ .../VCC_GND_YD_RP2040/ydrp2040_flash_16mb.h | 18 ++++++ .../VCC_GND_YD_RP2040/ydrp2040_flash_4mb.h | 18 ++++++ .../VCC_GND_YD_RP2040/ydrp2040_flash_8mb.h | 18 ++++++ 12 files changed, 231 insertions(+) create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/README.md create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/board.json create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/deploy.md create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/manifest.py create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/modules/board.py create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.cmake create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.h create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/pins.csv create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_common.h create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_16mb.h create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_4mb.h create mode 100644 ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_8mb.h diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/README.md b/ports/rp2/boards/VCC_GND_YD_RP2040/README.md new file mode 100644 index 0000000000000..c8f24dba69d0e --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/README.md @@ -0,0 +1,45 @@ +# VCC-GND Studio YD-RP2040 + +The VCC-GND Studio YD-RP2040 Board is based on the Raspberry Pi RP2040 and can be +purchased with 4/8/16 MiB of flash. + +These boards are available from VCC-GND Studio's [aliexpress page](https://www.aliexpress.com/item/1005004004120604.html). + +## Build notes + +Builds can be configured with the `BOARD_VARIANT` parameter. Valid variants +can be displayed with the `query-variant` target. An example: + +```bash +> cd ports/rp2 +> make BOARD=VCC_GND_YD_RP2040 query-variants +VARIANTS: flash_4mb flash_8mb flash_16mb +> make BOARD=VCC_GND_YD_RP2040 BOARD_VARIANT=flash_8mb submodules all # Build the 8 MiB variant +``` + +`flash_8mb` is the default if `BOARD_VARIANT` is not supplied. + +## Board-specific modules + +The `board` module contains definitions for the onboard LED(GPIO25), WS2812 addressable RGB led (GPIO23) and user button(GPIO24). + +Example: + +```python +> import board +> board.led.toggle() # Toggles the state of the on-board LED +> board.key.value() # Returns 0 or 1 corresponding to the state of the user key +> +> import neopixel +> from time import sleep +> n = neopixel.NeoPixel(board.neopixel, 1) +> n[0] = (255,0,0) +> n.write() +> sleep(1) +> n[0] = (0,255,0) +> n.write() +> sleep(1) +> n[0] = (0,0,255) +> n.write() +> sleep(1) +``` diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/board.json b/ports/rp2/boards/VCC_GND_YD_RP2040/board.json new file mode 100644 index 0000000000000..b0ec1fad6813d --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/board.json @@ -0,0 +1,24 @@ +{ + "deploy": [ + "deploy.md" + ], + "docs": "", + "features": [ + "Dual-core", + "External Flash", + "USB-C", + "RGB LED" + ], + "images": [ + "VCC_GND_YD_RP2040.png" + ], + "mcu": "rp2040", + "product": "VCC-GND Studio YD-RP2040", + "url": "http://vcc-gnd.com/", + "variants": { + "ydrp2040_flash_4mb": "4 MiB Flash", + "ydrp2040_flash_8mb": "8 MiB Flash", + "ydrp2040_flash_16mb": "16 MiB Flash" + }, + "vendor": "VCC-GND Studio" +} diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/deploy.md b/ports/rp2/boards/VCC_GND_YD_RP2040/deploy.md new file mode 100644 index 0000000000000..8b4fc0cfb78bf --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/deploy.md @@ -0,0 +1,8 @@ +### Flashing via UF2 bootloader + +To get the board in bootloader mode ready for the firmware update, execute +`machine.bootloader()` at the MicroPython REPL. Alternatively, hold +down the BOOT button while pressing reset (RST). The uf2 file below +should then be copied to the USB mass storage device that appears. Once +programming of the new firmware is complete the device will automatically reset +and be ready for use. diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/manifest.py b/ports/rp2/boards/VCC_GND_YD_RP2040/manifest.py new file mode 100644 index 0000000000000..f993d4fa6bd29 --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +freeze("./modules") diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/modules/board.py b/ports/rp2/boards/VCC_GND_YD_RP2040/modules/board.py new file mode 100644 index 0000000000000..0abf020f9e1d8 --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/modules/board.py @@ -0,0 +1,5 @@ +from machine import Pin + +led = Pin(25, Pin.OUT, value=0) +key = Pin(24, Pin.IN, Pin.PULL_UP) +neopixel = Pin(23, Pin.OUT, value=0) diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.cmake b/ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.cmake new file mode 100644 index 0000000000000..5586408c04d3f --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.cmake @@ -0,0 +1,24 @@ +# CMake file for VCC-GND Studio RP2040 boards + +# VCC-GND Studio boards don't have official pico-sdk support so we define it +# See also: https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards +list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR}) + +# Freeze board.py +set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) + +# Select the 8MB variant as the default +set(PICO_BOARD "ydrp2040_flash_8mb") + +# Provide different variants for the downloads page +if(MICROPY_BOARD_VARIANT STREQUAL "flash_4mb") + set(PICO_BOARD "ydrp2040_flash_4mb") +endif() + +if(MICROPY_BOARD_VARIANT STREQUAL "flash_8mb") + set(PICO_BOARD "ydrp2040_flash_8mb") +endif() + +if(MICROPY_BOARD_VARIANT STREQUAL "flash_16mb") + set(PICO_BOARD "ydrp2040_flash_16mb") +endif() diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.h b/ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.h new file mode 100644 index 0000000000000..81477dc4063db --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/mpconfigboard.h @@ -0,0 +1,4 @@ +#define MICROPY_HW_BOARD_NAME "VCC-GND Studio YD-RP2040" + +// Allow 1MB for the firmware image itself, allocate the remainder to the filesystem +#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - (1 * 1024 * 1024)) diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/pins.csv b/ports/rp2/boards/VCC_GND_YD_RP2040/pins.csv new file mode 100644 index 0000000000000..cb07f2b1c81a1 --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/pins.csv @@ -0,0 +1,3 @@ +led,GPIO25 +key,GPIO24 +neopixel,GPIO23 diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_common.h b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_common.h new file mode 100644 index 0000000000000..a609e52a6692e --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_common.h @@ -0,0 +1,62 @@ +// Common configuration to all VCC-GND Studio YD-RP2040 boards (only flash size differs) + +#ifndef _BOARDS_VCC_GND_YD_RP2040_COMMON_H +#define _BOARDS_VCC_GND_YD_RP2040_COMMON_H + +// --- UART --- +#ifndef PICO_DEFAULT_UART +#define PICO_DEFAULT_UART 0 +#endif +#ifndef PICO_DEFAULT_UART_TX_PIN +#define PICO_DEFAULT_UART_TX_PIN 0 +#endif +#ifndef PICO_DEFAULT_UART_RX_PIN +#define PICO_DEFAULT_UART_RX_PIN 1 +#endif + +// --- LED --- +#ifndef PICO_DEFAULT_LED_PIN +#define PICO_DEFAULT_LED_PIN 25 +#endif + +// --- I2C --- +#ifndef PICO_DEFAULT_I2C +#define PICO_DEFAULT_I2C 0 +#endif +#ifndef PICO_DEFAULT_I2C_SDA_PIN +#define PICO_DEFAULT_I2C_SDA_PIN 4 +#endif +#ifndef PICO_DEFAULT_I2C_SCL_PIN +#define PICO_DEFAULT_I2C_SCL_PIN 5 +#endif + +// --- SPI --- +#ifndef PICO_DEFAULT_SPI +#define PICO_DEFAULT_SPI 0 +#endif +#ifndef PICO_DEFAULT_SPI_SCK_PIN +#define PICO_DEFAULT_SPI_SCK_PIN 18 +#endif +#ifndef PICO_DEFAULT_SPI_TX_PIN +#define PICO_DEFAULT_SPI_TX_PIN 19 +#endif +#ifndef PICO_DEFAULT_SPI_RX_PIN +#define PICO_DEFAULT_SPI_RX_PIN 16 +#endif +#ifndef PICO_DEFAULT_SPI_CSN_PIN +#define PICO_DEFAULT_SPI_CSN_PIN 17 +#endif + +// --- FLASH --- +#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1 + +#ifndef PICO_FLASH_SPI_CLKDIV +#define PICO_FLASH_SPI_CLKDIV 2 +#endif + +// All boards have B1 RP2040 +#ifndef PICO_RP2040_B0_SUPPORTED +#define PICO_RP2040_B0_SUPPORTED 0 +#endif + +#endif diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_16mb.h b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_16mb.h new file mode 100644 index 0000000000000..cccf47d64e9e0 --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_16mb.h @@ -0,0 +1,18 @@ +// A pico-sdk board definition is required since the boards are +// not officially supported. +// +// Officially supported boards: +// https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards + +#ifndef _BOARDS_YDRP2040_FLASH_16MB_H +#define _BOARDS_YDRP2040_FLASH_16MB_H + +#include "ydrp2040_common.h" + +#define VCC_GND_YD_RP2040_16MB + +#ifndef PICO_FLASH_SIZE_BYTES +#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024) +#endif + +#endif diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_4mb.h b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_4mb.h new file mode 100644 index 0000000000000..f7f37264ef46e --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_4mb.h @@ -0,0 +1,18 @@ +// A pico-sdk board definition is required since the boards are +// not officially supported. +// +// Officially supported boards: +// https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards + +#ifndef _BOARDS_YDRP2040_FLASH_4MB_H +#define _BOARDS_YDRP2040_FLASH_4MB_H + +#include "ydrp2040_common.h" + +#define VCC_GND_YD_RP2040_4MB + +#ifndef PICO_FLASH_SIZE_BYTES +#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024) +#endif + +#endif diff --git a/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_8mb.h b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_8mb.h new file mode 100644 index 0000000000000..8b66a10047f01 --- /dev/null +++ b/ports/rp2/boards/VCC_GND_YD_RP2040/ydrp2040_flash_8mb.h @@ -0,0 +1,18 @@ +// A pico-sdk board definition is required since the boards are +// not officially supported. +// +// Officially supported boards: +// https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards + +#ifndef _BOARDS_YDRP2040_FLASH_8MB_H +#define _BOARDS_YDRP2040_FLASH_8MB_H + +#include "ydrp2040_common.h" + +#define VCC_GND_YD_RP2040_8MB + +#ifndef PICO_FLASH_SIZE_BYTES +#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024) +#endif + +#endif From bdaffb5c180e23dda5acaa6d897047adc6d5fbed Mon Sep 17 00:00:00 2001 From: mhidro Date: Mon, 26 Feb 2024 09:14:59 +0200 Subject: [PATCH 2/2] Update README.md Signed-off-by: mhidro --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 6482899b251d9..2dc131e5787e4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +| :exclamation: This is not maintained, go upstream | +|----------------------------------------------------| + + + [![CI badge](https://github.com/micropython/micropython/workflows/unix%20port/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush) [![codecov](https://codecov.io/gh/micropython/micropython/branch/master/graph/badge.svg?token=I92PfD05sD)](https://codecov.io/gh/micropython/micropython) The MicroPython project pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy