diff --git a/.github/workflows/ports_esp32.yml b/.github/workflows/ports_esp32.yml index eea82126d4..6b3700ed5e 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 0000000000..00761d511f --- /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 0000000000..22a450cb89 --- /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 0000000000..876a186dec --- /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 0000000000..b7a8878480 --- /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 0000000000..507ed2ccc5 --- /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 0000000000..36de6d1bf7 --- /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 098efbf9a2..60e870ce65 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