From 54e85fe212b15390b60246846e5f2087d566aeda Mon Sep 17 00:00:00 2001 From: Clayton Cronk Date: Mon, 21 Feb 2022 09:13:42 -0600 Subject: [PATCH] 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 --- ports/esp32/boards/GENERIC_UNICORE/board.json | 19 +++++++++++++++++++ ports/esp32/boards/GENERIC_UNICORE/board.md | 1 + .../GENERIC_UNICORE/mpconfigboard.cmake | 5 +++++ .../boards/GENERIC_UNICORE/mpconfigboard.h | 2 ++ .../boards/GENERIC_UNICORE/sdkconfig.board | 1 + ports/esp32/mphalport.h | 4 +++- 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ports/esp32/boards/GENERIC_UNICORE/board.json create mode 100644 ports/esp32/boards/GENERIC_UNICORE/board.md create mode 100644 ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.cmake create mode 100644 ports/esp32/boards/GENERIC_UNICORE/mpconfigboard.h create mode 100644 ports/esp32/boards/GENERIC_UNICORE/sdkconfig.board diff --git a/ports/esp32/boards/GENERIC_UNICORE/board.json b/ports/esp32/boards/GENERIC_UNICORE/board.json new file mode 100644 index 0000000000..8fed71a018 --- /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 0000000000..b41c167498 --- /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 0000000000..2f34688c8c --- /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 0000000000..5d0624b9c3 --- /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 0000000000..f0b0b5e03d --- /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 7f14b6e188..672fa306f5 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)