Skip to content

Commit 0eb2fbb

Browse files
Vincent1-pythonprojectgus
authored andcommitted
esp32: Add support for ESP32P4.
Signed-off-by: Vincent1-python <[email protected]> Signed-off-by: Angus Gratton <[email protected]>
1 parent 0f9b09f commit 0eb2fbb

38 files changed

+502
-35
lines changed

.github/workflows/ports_esp32.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- esp32_build_cmod_spiram_s2
3131
- esp32_build_s3_c3
3232
- esp32_build_c2_c5_c6
33+
- esp32_build_p4
3334
runs-on: ubuntu-latest
3435
steps:
3536
- uses: actions/checkout@v5
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"deploy_options": {
6+
"flash_offset": "0x2000"
7+
},
8+
"docs": "",
9+
"features": [
10+
"BLE",
11+
"WiFi"
12+
],
13+
"images": [
14+
"esp32p4_devkitmini.jpg"
15+
],
16+
"mcu": "esp32p4",
17+
"product": "ESP32-P4",
18+
"thumbnail": "",
19+
"url": "https://www.espressif.com/en/products/modules",
20+
"vendor": "Espressif"
21+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
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.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set(IDF_TARGET esp32p4)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
boards/sdkconfig.base
5+
boards/sdkconfig.p4
6+
)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Both of these can be set by mpconfigboard.cmake if a BOARD_VARIANT is
2+
// specified.
3+
4+
#ifndef MICROPY_HW_BOARD_NAME
5+
#define MICROPY_HW_BOARD_NAME "Generic ESP32P4 module"
6+
#endif
7+
8+
#ifndef MICROPY_HW_MCU_NAME
9+
#define MICROPY_HW_MCU_NAME "ESP32P4"
10+
#endif
11+
12+
#define MICROPY_PY_ESPNOW (0)
13+
14+
#define MICROPY_HW_ENABLE_SDCARD (1)
15+
16+
#ifndef USB_SERIAL_JTAG_PACKET_SZ_BYTES
17+
#define USB_SERIAL_JTAG_PACKET_SZ_BYTES (64)
18+
#endif
19+
20+
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
21+
#define MICROPY_HW_ENABLE_UART_REPL (1)
22+
23+
#define MICROPY_PY_MACHINE_I2S (1)
24+
25+
// Disable all networking, Wi-Fi and Bluetooth by default, these are re-enabled in the WIFI variants
26+
// (note the ESP32-P4 also has an ethernet MAC, not currently supported in MicroPython)
27+
#ifndef MICROPY_PY_NETWORK
28+
#define MICROPY_PY_NETWORK (0)
29+
#endif
30+
#ifndef MICROPY_PY_NETWORK_WLAN
31+
#define MICROPY_PY_NETWORK_WLAN (0)
32+
#endif
33+
#ifndef MICROPY_PY_BLUETOOTH
34+
#define MICROPY_PY_BLUETOOTH (0)
35+
#endif
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set(IDF_TARGET esp32p4)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
boards/sdkconfig.base
5+
boards/sdkconfig.p4
6+
boards/sdkconfig.p4_wifi_common
7+
boards/sdkconfig.p4_wifi_c5
8+
)
9+
10+
list(APPEND MICROPY_DEF_BOARD
11+
MICROPY_HW_BOARD_NAME="Generic ESP32P4 module with WIFI module of external ESP32C5"
12+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(IDF_TARGET esp32p4)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
boards/sdkconfig.base
5+
boards/sdkconfig.p4
6+
boards/sdkconfig.p4_wifi_common
7+
boards/sdkconfig.p4_wifi_c6
8+
)
9+
10+
list(APPEND MICROPY_DEF_BOARD
11+
MICROPY_HW_BOARD_NAME="Generic ESP32P4 module with WIFI module of external ESP32C6"
12+
MICROPY_PY_NETWORK=1
13+
MICROPY_PY_NETWORK_WLAN=1
14+
MICROPY_PY_BLUETOOTH=1
15+
)

ports/esp32/boards/make-pins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import boardgen
88

99

10-
# Pins start at zero, and the highest pin index on any ESP32* chip is 48.
11-
NUM_GPIOS = 49
10+
# Pins start at zero, and the highest pin index on any ESP32* chip is 54.
11+
NUM_GPIOS = 55
1212

1313

1414
class Esp32Pin(boardgen.Pin):

ports/esp32/boards/sdkconfig.p4

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Flash
2+
CONFIG_FLASHMODE_QIO=y
3+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
4+
5+
# Memory
6+
CONFIG_SPIRAM=y
7+
CONFIG_SPIRAM_MEMTEST=
8+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
9+
CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
10+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
11+
12+
13+
# ULP : not fixed
14+
CONFIG_SOC_ULP_SUPPORTED=n
15+
CONFIG_ULP_COPROC_ENABLED=n
16+
CONFIG_ULP_COPROC_TYPE_FSM=n
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Most settings are in sdkconfig.p4_wifi_common
2+
CONFIG_SLAVE_IDF_TARGET_ESP32C5=y

0 commit comments

Comments
 (0)