summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent1-python <pywei201209@163.com>2025-08-15 17:26:05 +0800
committerDamien George <damien@micropython.org>2025-12-01 13:08:52 +1100
commit50a06b64042feb5387b7d520152f5f09b1537a68 (patch)
treeccf3bdb7e350f46d9354e8d559966e051322dede
parente6f1f7871380950657947a64f6ba0ae724258dc0 (diff)
esp32/boards/ESP32_GENERIC_P4: Add board definition for ESP32P4.
Includes a base variant with LAN, and C5_WIFI and C6_WIFI variants with LAN, WiFi and BLE. And builds this board in the esp32 CI, to cover the P4 support. Signed-off-by: Vincent1-python <pywei201209@163.com> Signed-off-by: Angus Gratton <angus@redyak.com.au> Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--.github/workflows/ports_esp32.yml1
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_P4/board.json21
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_P4/board.md2
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.cmake6
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.h31
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C5_WIFI.cmake14
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C6_WIFI.cmake14
-rwxr-xr-xtools/ci.sh7
8 files changed, 96 insertions, 0 deletions
diff --git a/.github/workflows/ports_esp32.yml b/.github/workflows/ports_esp32.yml
index eea82126d..6b3700ed5 100644
--- a/.github/workflows/ports_esp32.yml
+++ b/.github/workflows/ports_esp32.yml
@@ -30,6 +30,7 @@ jobs:
- esp32_build_cmod_spiram_s2
- esp32_build_s3_c3
- esp32_build_c2_c5_c6
+ - esp32_build_p4
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
diff --git a/ports/esp32/boards/ESP32_GENERIC_P4/board.json b/ports/esp32/boards/ESP32_GENERIC_P4/board.json
new file mode 100644
index 000000000..00761d511
--- /dev/null
+++ b/ports/esp32/boards/ESP32_GENERIC_P4/board.json
@@ -0,0 +1,21 @@
+{
+ "deploy": [
+ "../deploy.md"
+ ],
+ "deploy_options": {
+ "flash_offset": "0x2000"
+ },
+ "docs": "",
+ "features": [
+ "BLE",
+ "WiFi"
+ ],
+ "images": [
+ "esp32p4_devkitmini.jpg"
+ ],
+ "mcu": "esp32p4",
+ "product": "ESP32-P4",
+ "thumbnail": "",
+ "url": "https://www.espressif.com/en/products/modules",
+ "vendor": "Espressif"
+}
diff --git a/ports/esp32/boards/ESP32_GENERIC_P4/board.md b/ports/esp32/boards/ESP32_GENERIC_P4/board.md
new file mode 100644
index 000000000..22a450cb8
--- /dev/null
+++ b/ports/esp32/boards/ESP32_GENERIC_P4/board.md
@@ -0,0 +1,2 @@
+The following firmware is applicable to most development boards based on ESP32-P4, and
+the development boards must be equipped with at least 16 MiB external SPI Flash.
diff --git a/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.cmake b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.cmake
new file mode 100644
index 000000000..876a186de
--- /dev/null
+++ b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.cmake
@@ -0,0 +1,6 @@
+set(IDF_TARGET esp32p4)
+
+set(SDKCONFIG_DEFAULTS
+ boards/sdkconfig.base
+ boards/sdkconfig.p4
+)
diff --git a/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.h b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.h
new file mode 100644
index 000000000..b7a887848
--- /dev/null
+++ b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigboard.h
@@ -0,0 +1,31 @@
+// Both of these can be set by mpconfigboard.cmake if a BOARD_VARIANT is
+// specified.
+
+#ifndef MICROPY_HW_BOARD_NAME
+#define MICROPY_HW_BOARD_NAME "Generic ESP32P4 module"
+#endif
+
+#ifndef MICROPY_HW_MCU_NAME
+#define MICROPY_HW_MCU_NAME "ESP32P4"
+#endif
+
+#define MICROPY_PY_ESPNOW (0)
+
+#define MICROPY_HW_ENABLE_SDCARD (1)
+
+#ifndef USB_SERIAL_JTAG_PACKET_SZ_BYTES
+#define USB_SERIAL_JTAG_PACKET_SZ_BYTES (64)
+#endif
+
+// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
+#define MICROPY_HW_ENABLE_UART_REPL (1)
+
+#define MICROPY_PY_MACHINE_I2S (1)
+
+// Disable Wi-Fi and Bluetooth by default, these are re-enabled in the WIFI variants
+#ifndef MICROPY_PY_NETWORK_WLAN
+#define MICROPY_PY_NETWORK_WLAN (0)
+#endif
+#ifndef MICROPY_PY_BLUETOOTH
+#define MICROPY_PY_BLUETOOTH (0)
+#endif
diff --git a/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C5_WIFI.cmake b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C5_WIFI.cmake
new file mode 100644
index 000000000..507ed2ccc
--- /dev/null
+++ b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C5_WIFI.cmake
@@ -0,0 +1,14 @@
+set(IDF_TARGET esp32p4)
+
+set(SDKCONFIG_DEFAULTS
+ boards/sdkconfig.base
+ boards/sdkconfig.p4
+ boards/sdkconfig.p4_wifi_common
+ boards/sdkconfig.p4_wifi_c5
+)
+
+list(APPEND MICROPY_DEF_BOARD
+ MICROPY_HW_BOARD_NAME="Generic ESP32P4 module with WIFI module of external ESP32C5"
+ MICROPY_PY_NETWORK_WLAN=1
+ MICROPY_PY_BLUETOOTH=1
+)
diff --git a/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C6_WIFI.cmake b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C6_WIFI.cmake
new file mode 100644
index 000000000..36de6d1bf
--- /dev/null
+++ b/ports/esp32/boards/ESP32_GENERIC_P4/mpconfigvariant_C6_WIFI.cmake
@@ -0,0 +1,14 @@
+set(IDF_TARGET esp32p4)
+
+set(SDKCONFIG_DEFAULTS
+ boards/sdkconfig.base
+ boards/sdkconfig.p4
+ boards/sdkconfig.p4_wifi_common
+ boards/sdkconfig.p4_wifi_c6
+)
+
+list(APPEND MICROPY_DEF_BOARD
+ MICROPY_HW_BOARD_NAME="Generic ESP32P4 module with WIFI module of external ESP32C6"
+ MICROPY_PY_NETWORK_WLAN=1
+ MICROPY_PY_BLUETOOTH=1
+)
diff --git a/tools/ci.sh b/tools/ci.sh
index 098efbf9a..60e870ce6 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -254,6 +254,13 @@ function ci_esp32_build_c2_c5_c6 {
make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_C6
}
+function ci_esp32_build_p4 {
+ ci_esp32_build_common
+
+ make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_P4
+ make ${MAKEOPTS} -C ports/esp32 BOARD=ESP32_GENERIC_P4 BOARD_VARIANT=C6_WIFI
+}
+
########################################################################################
# ports/esp8266