-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from pimoroni/feature/phil-wave
Add W variant of Tiny FX
- Loading branch information
Showing
8 changed files
with
235 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 11becbe22321ca1d7bd631144976f246175730ce Mon Sep 17 00:00:00 2001 | ||
From: Phil Howard <[email protected]> | ||
Date: Wed, 3 Jul 2024 15:15:16 +0100 | ||
Subject: [PATCH] rp2/CMakeLists.txt: Add MICROPY_DEF_BOARD to compile | ||
definitions. | ||
|
||
Add MICROPY_DEF_BOARD as per esp32 port, allows board variants to override | ||
the board name with: | ||
|
||
list(APPEND MICROPY_DEF_BOARD | ||
MICROPY_HW_BOARD_NAME="New Board Name" | ||
) | ||
|
||
Signed-off-by: Phil Howard <[email protected]> | ||
--- | ||
ports/rp2/CMakeLists.txt | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt | ||
index 8fff4251487f..904925ae3f5e 100644 | ||
--- a/ports/rp2/CMakeLists.txt | ||
+++ b/ports/rp2/CMakeLists.txt | ||
@@ -493,6 +493,7 @@ set_source_files_properties( | ||
) | ||
|
||
target_compile_definitions(${MICROPY_TARGET} PRIVATE | ||
+ ${MICROPY_DEF_BOARD} | ||
FFCONF_H=\"${MICROPY_OOFATFS_DIR}/ffconf.h\" | ||
LFS1_NO_MALLOC LFS1_NO_DEBUG LFS1_NO_WARN LFS1_NO_ERROR LFS1_NO_ASSERT | ||
LFS2_NO_MALLOC LFS2_NO_DEBUG LFS2_NO_WARN LFS2_NO_ERROR LFS2_NO_ASSERT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
From 5dff78f38edc0354e854e6c73af61c5064afe9d3 Mon Sep 17 00:00:00 2001 | ||
From: Damien George <[email protected]> | ||
Date: Mon, 24 Jun 2024 12:37:13 +1000 | ||
Subject: [PATCH] rp2: Rework board variant support to require mpconfigvariant | ||
file. | ||
|
||
Following how the board variants now work in the esp32 port. | ||
|
||
Signed-off-by: Damien George <[email protected]> | ||
--- | ||
ports/rp2/CMakeLists.txt | 12 ++++++++++++ | ||
ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake | 16 ---------------- | ||
.../rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake | 1 + | ||
.../WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake | 1 + | ||
.../WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake | 1 + | ||
.../WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake | 1 + | ||
6 files changed, 16 insertions(+), 16 deletions(-) | ||
create mode 100644 ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake | ||
create mode 100644 ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake | ||
create mode 100644 ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake | ||
create mode 100644 ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake | ||
|
||
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt | ||
index 8f5680092c92..8fff4251487f 100644 | ||
--- a/ports/rp2/CMakeLists.txt | ||
+++ b/ports/rp2/CMakeLists.txt | ||
@@ -38,10 +38,22 @@ if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigboard.cmake) | ||
message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}") | ||
endif() | ||
|
||
+# If a board variant is specified, check that it exists. | ||
+if(MICROPY_BOARD_VARIANT) | ||
+ if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigvariant_${MICROPY_BOARD_VARIANT}.cmake) | ||
+ message(FATAL_ERROR "Invalid MICROPY_BOARD_VARIANT specified: ${MICROPY_BOARD_VARIANT}") | ||
+ endif() | ||
+endif() | ||
+ | ||
set(MICROPY_USER_FROZEN_MANIFEST ${MICROPY_FROZEN_MANIFEST}) | ||
|
||
# Include board config, it may override MICROPY_FROZEN_MANIFEST | ||
include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake) | ||
+if(NOT MICROPY_BOARD_VARIANT) | ||
+ include(${MICROPY_BOARD_DIR}/mpconfigvariant.cmake OPTIONAL) | ||
+else() | ||
+ include(${MICROPY_BOARD_DIR}/mpconfigvariant_${MICROPY_BOARD_VARIANT}.cmake) | ||
+endif() | ||
|
||
# Set the PICO_BOARD if it's not already set (allow a board to override it). | ||
if(NOT PICO_BOARD) | ||
diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake | ||
index 848b50f604db..d922644bf626 100644 | ||
--- a/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake | ||
+++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake | ||
@@ -6,19 +6,3 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR}) | ||
|
||
# Freeze board.py | ||
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) | ||
- | ||
-# Select the 16MB variant as the default | ||
-set(PICO_BOARD "weactstudio_16MiB") | ||
- | ||
-# Provide different variants for the downloads page | ||
-if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_2M") | ||
- set(PICO_BOARD "weactstudio_2MiB") | ||
-endif() | ||
- | ||
-if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_4M") | ||
- set(PICO_BOARD "weactstudio_4MiB") | ||
-endif() | ||
- | ||
-if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_8M") | ||
- set(PICO_BOARD "weactstudio_8MiB") | ||
-endif() | ||
diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake | ||
new file mode 100644 | ||
index 000000000000..4e68b2112f1d | ||
--- /dev/null | ||
+++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake | ||
@@ -0,0 +1 @@ | ||
+set(PICO_BOARD "weactstudio_16MiB") | ||
diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake | ||
new file mode 100644 | ||
index 000000000000..b8d7202dada5 | ||
--- /dev/null | ||
+++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake | ||
@@ -0,0 +1 @@ | ||
+set(PICO_BOARD "weactstudio_2MiB") | ||
diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake | ||
new file mode 100644 | ||
index 000000000000..75afb1ba4006 | ||
--- /dev/null | ||
+++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake | ||
@@ -0,0 +1 @@ | ||
+set(PICO_BOARD "weactstudio_4MiB") | ||
diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake | ||
new file mode 100644 | ||
index 000000000000..359e47c01161 | ||
--- /dev/null | ||
+++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake | ||
@@ -0,0 +1 @@ | ||
+set(PICO_BOARD "weactstudio_8MiB") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require("bundle-networking") | ||
|
||
# Bluetooth | ||
require("aioble") | ||
|
||
include("manifest.py") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
// Board and hardware specific configuration | ||
#ifndef MICROPY_HW_BOARD_NAME | ||
// Might be defined by mpconfigvariant.cmake | ||
#define MICROPY_HW_BOARD_NAME "Pimoroni TinyFX" | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (3 * 1024 * 1024) | ||
#endif | ||
|
||
#if defined(MICROPY_PY_NETWORK_CYW43) | ||
|
||
// We need space for networking firmware on network builds | ||
// 1536 * 1024 = 1.5MB | ||
#define FIRMWARE_SIZE_BYTES (1536 * 1024) | ||
|
||
// CYW43 driver configuration. | ||
#define CYW43_USE_SPI (1) | ||
#define CYW43_LWIP (1) | ||
#define CYW43_GPIO (0) | ||
#define CYW43_SPI_PIO (1) | ||
|
||
#else | ||
|
||
// 1MB for the firmware | ||
#define FIRMWARE_SIZE_BYTES (1 * 1024 * 1024) | ||
|
||
#endif | ||
|
||
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - FIRMWARE_SIZE_BYTES) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Override the MicroPython board name | ||
# And set basic options which are expanded upon in mpconfigboard.h | ||
list(APPEND MICROPY_DEF_BOARD | ||
"MICROPY_HW_BOARD_NAME=\"Pimoroni TinyFX W\"" | ||
"MICROPY_PY_NETWORK=1" | ||
) | ||
|
||
# Links micropy_lib_lwip and sets MICROPY_PY_LWIP = 1 | ||
# Picked up and expanded upon in mpconfigboard.h | ||
set(MICROPY_PY_LWIP ON) | ||
|
||
# Links cyw43-driver and sets: | ||
# MICROPY_PY_NETWORK_CYW43 = 1, | ||
# MICROPY_PY_SOCKET_DEFAULT_TIMEOUT_MS = 30000 | ||
set(MICROPY_PY_NETWORK_CYW43 ON) | ||
|
||
# Adds mpbthciport.c | ||
# And sets: | ||
# MICROPY_PY_BLUETOOTH = 1, | ||
# MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS = 1, | ||
# MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE = 1 | ||
set(MICROPY_PY_BLUETOOTH ON) | ||
|
||
# Links pico_btstack_hci_transport_cyw43 | ||
# And sets: | ||
# MICROPY_BLUETOOTH_BTSTACK = 1, | ||
# MICROPY_BLUETOOTH_BTSTACK_CONFIG_FILE = | ||
set(MICROPY_BLUETOOTH_BTSTACK ON) | ||
|
||
# Sets: | ||
# CYW43_ENABLE_BLUETOOTH = 1, | ||
# MICROPY_PY_BLUETOOTH_CYW43 = 1 | ||
set(MICROPY_PY_BLUETOOTH_CYW43 ON) | ||
|
||
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest_w.py) | ||
|
||
set(PICO_BOARD "pimoroni_tinyfx") | ||
set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters