Skip to content

Commit e6f1f78

Browse files
Vincent1-pythondpgeorge
authored andcommitted
esp32: Add support for ESP32-P4.
This commit adds support for ESP32-P4 SoCs. Signed-off-by: Vincent1-python <[email protected]> Signed-off-by: Angus Gratton <[email protected]> Signed-off-by: Damien George <[email protected]>
1 parent 604cda5 commit e6f1f78

31 files changed

+393
-31
lines changed

ports/esp32/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ microcontrollers. It uses the ESP-IDF framework and MicroPython runs as
66
a task under FreeRTOS.
77

88
Currently supports ESP32, ESP32-C2 (aka ESP8684), ESP32-C3, ESP32-C5, ESP32-C6,
9-
ESP32-S2 and ESP32-S3. ESP8266 is supported by a separate MicroPython port.
9+
ESP32-P4, ESP32-S2 and ESP32-S3. ESP8266 is supported by a separate MicroPython port.
1010

1111
Supported features include:
1212
- REPL (Python prompt) over UART0 and/or the integrated USB peripheral.

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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
# ULP: not fixed
13+
CONFIG_SOC_ULP_SUPPORTED=n
14+
CONFIG_ULP_COPROC_ENABLED=n
15+
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
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_ESP32C6=y
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This sdkconfig file has the common settings for an ESP32-P4
2+
# host with an external ESP-Hosted Wi-Fi/BT interface.
3+
4+
# Wifi
5+
CONFIG_ESP_HOSTED_ENABLED=y
6+
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16
7+
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64
8+
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64
9+
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
10+
CONFIG_ESP_WIFI_TX_BA_WIN=32
11+
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
12+
CONFIG_ESP_WIFI_RX_BA_WIN=32
13+
14+
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534
15+
CONFIG_LWIP_TCP_WND_DEFAULT=65534
16+
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
17+
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
18+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
19+
20+
CONFIG_LWIP_TCP_SACK_OUT=y
21+
22+
# Bluetooth Support
23+
CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID=y
24+
CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE=y
25+
CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI=y
26+
CONFIG_ESP_WIFI_REMOTE_ENABLED=y
27+
CONFIG_SLAVE_SOC_WIFI_SUPPORTED=y
28+
CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT=y
29+
CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT=y
30+
CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT=y
31+
CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12
32+
CONFIG_SLAVE_SOC_WIFI_HW_TSF=y
33+
CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT=y
34+
CONFIG_SLAVE_FREERTOS_UNICORE=y
35+
CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT=y
36+
CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV=y
37+
CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT=y
38+
CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM=2
39+
CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y
40+
41+
CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y
42+
43+
# BLE
44+
CONFIG_ESP_ENABLE_BT=y
45+
CONFIG_BT_ENABLED=y
46+
CONFIG_BT_NIMBLE_ENABLED=y
47+
CONFIG_BT_CONTROLLER_DISABLED=y
48+
CONFIG_BT_BLUEDROID_ENABLED=n
49+
CONFIG_BT_NIMBLE_TRANSPORT_UART=n
50+
CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR=y
51+
52+
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="MPY ESP32"
53+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4
54+
55+
CONFIG_BT_HCI_LOG_DEBUG_EN=y
56+
57+
# Increase NimBLE task stack size from the default, because Python code
58+
# (BLE IRQ handlers) will most likely run on this task.
59+
CONFIG_BT_NIMBLE_TASK_STACK_SIZE=6144

ports/esp32/esp32_common.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(CONFIG_IDF_TARGET_ARCH_RISCV)
2323
endif()
2424

2525
if(NOT DEFINED MICROPY_PY_TINYUSB)
26-
if(CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3)
26+
if(CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3 OR CONFIG_IDF_TARGET_ESP32P4)
2727
set(MICROPY_PY_TINYUSB ON)
2828
endif()
2929
endif()
@@ -167,6 +167,7 @@ list(APPEND IDF_COMPONENTS
167167
esp_adc
168168
esp_app_format
169169
esp_common
170+
esp_driver_touch_sens
170171
esp_eth
171172
esp_event
172173
esp_hw_support

ports/esp32/lockfiles/dependencies.lock.esp32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ direct_dependencies:
3030
- espressif/lan867x
3131
- espressif/mdns
3232
- idf
33-
manifest_hash: da32add5eb5e196ac97a99eb579025222ec572f5db4038873fbf9d3b9d6ed5a3
33+
manifest_hash: cc42b6ea8bc1d77d04370604f0b1c1a93a4f2c9b9200690722458faedaee68a4
3434
target: esp32
3535
version: 2.0.0

ports/esp32/lockfiles/dependencies.lock.esp32c2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ dependencies:
1616
direct_dependencies:
1717
- espressif/mdns
1818
- idf
19-
manifest_hash: da32add5eb5e196ac97a99eb579025222ec572f5db4038873fbf9d3b9d6ed5a3
19+
manifest_hash: cc42b6ea8bc1d77d04370604f0b1c1a93a4f2c9b9200690722458faedaee68a4
2020
target: esp32c2
2121
version: 2.0.0

ports/esp32/lockfiles/dependencies.lock.esp32c3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ dependencies:
1616
direct_dependencies:
1717
- espressif/mdns
1818
- idf
19-
manifest_hash: da32add5eb5e196ac97a99eb579025222ec572f5db4038873fbf9d3b9d6ed5a3
19+
manifest_hash: cc42b6ea8bc1d77d04370604f0b1c1a93a4f2c9b9200690722458faedaee68a4
2020
target: esp32c3
2121
version: 2.0.0

0 commit comments

Comments
 (0)