Skip to content

Commit

Permalink
CI: Sync RPi stock boards with upstream.
Browse files Browse the repository at this point in the history
Replace our experimental configs with the board config(s) from the
(as yet unmerged) Pico 2 W changes branch.
  • Loading branch information
Gadgetoid committed Nov 26, 2024
1 parent 9dfb5c0 commit deefd4d
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 126 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ jobs:
strategy:
matrix:
include:
- name: pico2_rp2350
- name: pico2
board: RPI_PICO2
- name: pico2_rp2350_wireless
board: RPI_PICO2
variant: WIRELESS
- name: pico2_w
board: RPI_PICO2_W
- name: pico2b_rp2350
board: RPI_PICO2B
- name: plasma2350
Expand Down
19 changes: 0 additions & 19 deletions micropython/board/RPI_PICO2/board.json

This file was deleted.

8 changes: 0 additions & 8 deletions micropython/board/RPI_PICO2/manifest-wireless.py

This file was deleted.

13 changes: 8 additions & 5 deletions micropython/board/RPI_PICO2/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# cmake file for Raspberry Pi Pico
# cmake file for Raspberry Pi Pico2
set(PICO_BOARD "pico2")
set(PICO_PLATFORM "rp2350")

# Board specific version of the frozen manifest
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
# To change the gpio count for QFN-80
# set(PICO_NUM_GPIOS 48)

set(MICROPY_C_HEAP_SIZE 4096)
if (PICO_CYW43_SUPPORTED)
include(enable_cyw43.cmake)
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
set(PICO_PINS_CSV_NAME pins_cyw43.csv)
endif()
70 changes: 20 additions & 50 deletions micropython/board/RPI_PICO2/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
// Board and hardware specific configuration
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - (2 * 1024 * 1024))

// Set up networking.
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "Pico2"

#if defined(MICROPY_PY_NETWORK_CYW43)

// CYW43 driver configuration.
#define CYW43_USE_SPI (1)
#define CYW43_LWIP (1)
#define CYW43_GPIO (1)
#define CYW43_SPI_PIO (1)

#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT

#if defined(CYW43_PIN_WL_DYNAMIC)

#define CYW43_PIO_CLOCK_DIV_DYNAMIC (1)

// CYW43 default pin configuration
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 24u
#define CYW43_DEFAULT_PIN_WL_REG_ON 23u
#define CYW43_DEFAULT_PIN_WL_DATA_OUT CYW43_DEFAULT_PIN_WL_HOST_WAKE
#define CYW43_DEFAULT_PIN_WL_DATA_IN CYW43_DEFAULT_PIN_WL_HOST_WAKE
#define CYW43_DEFAULT_PIN_WL_CLOCK 29u
#define CYW43_DEFAULT_PIN_WL_CS 25u

// Slow down the wireless clock, since we'll be running
// comms through wiring spaghetti!
#define CYW43_PIO_CLOCK_DIV_INT 50
#define CYW43_PIO_CLOCK_DIV_FRAC 0
#define CYW43_SPI_PROGRAM_NAME spi_gap0_sample1

#endif

#endif

// Might be defined in mpconfigvariant_PPP.cmake
// This is not checked by mpconfigport.h so we must set up networking below
#if defined(MICROPY_PY_NETWORK_PPP_LWIP)

// Nothing to do here?

#endif

// If a variant is not used, define a fallback board name
#ifndef MICROPY_HW_BOARD_NAME

#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico 2"

#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico2"
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - 1024 * 1024)

#if MICROPY_PY_NETWORK_CYW43
#include "enable_cyw43.h"

// Enable the ability to pass cyw43 pins into WiFi, Bluetooth and Pin constructors
#define CYW43_PIN_WL_DYNAMIC 1
#define CYW43_PIO_CLOCK_DIV_DYNAMIC 1

// Set the default pins to gpios 2-5
#define CYW43_DEFAULT_PIN_WL_REG_ON 2
#define CYW43_DEFAULT_PIN_WL_CS 3
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 4
#define CYW43_DEFAULT_PIN_WL_DATA_IN 4
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 4
#define CYW43_DEFAULT_PIN_WL_CLOCK 5

// Default pio clock
#define CYW43_PIO_CLOCK_DIV_INT 3
#endif
40 changes: 0 additions & 40 deletions micropython/board/RPI_PICO2/mpconfigvariant_WIRELESS.cmake

This file was deleted.

8 changes: 8 additions & 0 deletions micropython/board/RPI_PICO2_W/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include("$(PORT_DIR)/boards/manifest.py")

require("bundle-networking")

# Bluetooth
require("aioble")

include("../manifest_pico2.py")
11 changes: 11 additions & 0 deletions micropython/board/RPI_PICO2_W/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# cmake file for Raspberry Pi Pico 2 W

set(PICO_BOARD "pico2_w")

# To change the gpio count for QFN-80
# set(PICO_NUM_GPIOS 48)

include(enable_cyw43.cmake)

# Board specific version of the frozen manifest
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
7 changes: 7 additions & 0 deletions micropython/board/RPI_PICO2_W/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Board and hardware specific configuration
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico 2 W"
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - 1024 * 1024)

#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "Pico2W"

#include "enable_cyw43.h"
30 changes: 30 additions & 0 deletions micropython/board/RPI_PICO2_W/pins.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
GP0,GPIO0
GP1,GPIO1
GP2,GPIO2
GP3,GPIO3
GP4,GPIO4
GP5,GPIO5
GP6,GPIO6
GP7,GPIO7
GP8,GPIO8
GP9,GPIO9
GP10,GPIO10
GP11,GPIO11
GP12,GPIO12
GP13,GPIO13
GP14,GPIO14
GP15,GPIO15
GP16,GPIO16
GP17,GPIO17
GP18,GPIO18
GP19,GPIO19
GP20,GPIO20
GP21,GPIO21
GP22,GPIO22
GP26,GPIO26
GP27,GPIO27
GP28,GPIO28
WL_GPIO0,EXT_GPIO0
WL_GPIO1,EXT_GPIO1
WL_GPIO2,EXT_GPIO2
LED,EXT_GPIO0

0 comments on commit deefd4d

Please sign in to comment.