summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClayton Cronk <awesomecronk@gmail.com>2022-02-21 09:13:42 -0600
committerDamien George <damien@micropython.org>2023-01-19 22:38:02 +1100
commit54e85fe212b15390b60246846e5f2087d566aeda (patch)
tree69e1d42cc82bc5ebe345d2f51d3ee3cdf9d68294
parent32a858e254b3c6f53dc4969f62b830fbb51cf8ee (diff)
esp32/boards/GENERIC_UNICORE: Add board definition for unicore chips.
Tested to work on an ESP32-MINI-1, which is a single core ESP32-U4DWH. Signed-off-by: Clayton Cronk <awesomecronk@gmail.com>
-rw-r--r--ports/esp32/boards/GENERIC_UNICORE/board.json19
-rw-r--r--ports/esp32/boards/GENERIC_UNICORE/board.md1
-rw-r--r--ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.cmake5
-rw-r--r--ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.h2
-rw-r--r--ports/esp32/boards/GENERIC_UNICORE/sdkconfig.board1
-rw-r--r--ports/esp32/mphalport.h4
6 files changed, 31 insertions, 1 deletions
diff --git a/ports/esp32/boards/GENERIC_UNICORE/board.json b/ports/esp32/boards/GENERIC_UNICORE/board.json
new file mode 100644
index 000000000..8fed71a01
--- /dev/null
+++ b/ports/esp32/boards/GENERIC_UNICORE/board.json
@@ -0,0 +1,19 @@
+{
+ "deploy": [
+ "../deploy.md"
+ ],
+ "docs": "",
+ "features": [
+ "BLE",
+ "WiFi"
+ ],
+ "id": "esp32-unicore",
+ "images": [
+ "generic_unicore.jpg"
+ ],
+ "mcu": "esp32",
+ "product": "ESP32 Unicore",
+ "thumbnail": "",
+ "url": "https://www.espressif.com/en/products/modules",
+ "vendor": "Espressif"
+}
diff --git a/ports/esp32/boards/GENERIC_UNICORE/board.md b/ports/esp32/boards/GENERIC_UNICORE/board.md
new file mode 100644
index 000000000..b41c16749
--- /dev/null
+++ b/ports/esp32/boards/GENERIC_UNICORE/board.md
@@ -0,0 +1 @@
+The following files are daily firmware for single-core ESP32-based boards without external SPIRAM.
diff --git a/ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.cmake b/ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.cmake
new file mode 100644
index 000000000..2f34688c8
--- /dev/null
+++ b/ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.cmake
@@ -0,0 +1,5 @@
+set(SDKCONFIG_DEFAULTS
+ boards/sdkconfig.base
+ boards/sdkconfig.ble
+ boards/GENERIC_UNICORE/sdkconfig.board
+)
diff --git a/ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.h b/ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.h
new file mode 100644
index 000000000..5d0624b9c
--- /dev/null
+++ b/ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.h
@@ -0,0 +1,2 @@
+#define MICROPY_HW_BOARD_NAME "ESP32 Unicore module"
+#define MICROPY_HW_MCU_NAME "ESP32-UNICORE"
diff --git a/ports/esp32/boards/GENERIC_UNICORE/sdkconfig.board b/ports/esp32/boards/GENERIC_UNICORE/sdkconfig.board
new file mode 100644
index 000000000..f0b0b5e03
--- /dev/null
+++ b/ports/esp32/boards/GENERIC_UNICORE/sdkconfig.board
@@ -0,0 +1 @@
+CONFIG_FREERTOS_UNICORE=y
diff --git a/ports/esp32/mphalport.h b/ports/esp32/mphalport.h
index 7f14b6e18..672fa306f 100644
--- a/ports/esp32/mphalport.h
+++ b/ports/esp32/mphalport.h
@@ -44,7 +44,9 @@
// and avoid the Wifi/BLE timing problems on the same core.
// Best effort here to remain backwards compatible in rare version edge cases...
// See https://github.com/micropython/micropython/issues/5489 for history
-#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
+#if CONFIG_FREERTOS_UNICORE
+#define MP_TASK_COREID (0)
+#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
#define MP_TASK_COREID (1)
#else
#define MP_TASK_COREID (0)