Skip to content

Commit e57e971

Browse files
esp32: Add support for ESP32P4.
Signed-off-by: Vincent1-python <pywei201209@163.com> esp32: Add support for ESP32P4. Signed-off-by: Vincent1-python <pywei201209@163.com> esp32: Add support for ESP32P4. Signed-off-by: Vincent1-python <pywei201209@163.com> esp32: Add support for ESP32P4. Signed-off-by: Vincent1-python <pywei201209@163.com> esp32: Add support for ESP32P4. Signed-off-by: Vincent1-python <pywei201209@163.com>
1 parent e957f63 commit e57e971

28 files changed

Lines changed: 580 additions & 21 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"deploy_options": {
6+
"flash_offset": "0x1000"
7+
},
8+
"docs": "",
9+
"features": [
10+
"BLE",
11+
"External Flash",
12+
"WiFi"
13+
],
14+
"images": [
15+
""
16+
],
17+
"mcu": "esp32p4",
18+
"product": "Expressif ESP32P4",
19+
"thumbnail": "",
20+
"url": "https://www.espressif.com/en/products/modules",
21+
"variants": {
22+
},
23+
"vendor": "Espressif"
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
The following files are firmware that should work on most ESP32-based boards
2+
with 4MiB of flash, including WROOM WROVER, SOLO, PICO, and MINI modules.
3+
4+
This board has multiple variants available:
5+
6+
* If your board is based on a WROVER module, or otherwise has SPIRAM (also known
7+
as PSRAM) then it's recommended to use the "spiram" variant. Look for heading
8+
**Support for SPIRAM / WROVER)**.
9+
* If your board has a ESP32-D2WD chip (with only 2MiB flash) then use the "d2wd"
10+
variant. Look for heading **ESP32 D2WD**.
11+
* If your board has a single-core ESP32 (e.g. the "SOLO" modules) then choose
12+
the "unicore" variant. Look for heading **ESP32 Unicore**.
13+
* If you'd like to perform Over-the-Air updates of the MicroPython firmware,
14+
then choose the "ota" variant. This variant has less room in the flash for
15+
Python files as a result of supporting OTA. Look for heading **Support for
16+
OTA**.
17+
18+
Otherwise, download the generic variant (under the first heading below).
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/ESP32_GENERIC_P4/sdkconfig.board
6+
)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
13+
// not fixed in mpy 1.26.0
14+
#define MICROPY_PY_MACHINE_DAC (0)
15+
16+
#define MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE (0)
17+
#define MICROPY_HW_ENABLE_USBDEV (0)
18+
#define MICROPY_PY_TINYUSB (0)
19+
#define MICROPY_PY_ESPNOW (0)
20+
21+
#define MICROPY_PY_MACHINE_ADC (0)
22+
#define MICROPY_PY_MACHINE_ADC_ATTEN_WIDTH (0)
23+
#define MICROPY_PY_MACHINE_ADC_INIT (0)
24+
#define MICROPY_PY_MACHINE_ADC_READ (0)
25+
#define MICROPY_PY_MACHINE_ADC_READ_UV (0)
26+
#define MICROPY_PY_MACHINE_ADC_BLOCK (0)
27+
28+
29+
30+
#ifndef USB_SERIAL_JTAG_PACKET_SZ_BYTES
31+
#define USB_SERIAL_JTAG_PACKET_SZ_BYTES (64)
32+
#endif
33+
34+
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
35+
#define MICROPY_HW_ENABLE_UART_REPL (1)
36+
37+
#define MICROPY_PY_MACHINE_I2S (1)
38+
39+
/*
40+
#define MICROPY_HW_I2C0_SCL (32)
41+
#define MICROPY_HW_I2C0_SDA (31)
42+
43+
#define MICROPY_HW_SPI1_MOSI (44)
44+
#define MICROPY_HW_SPI1_MISO (39)
45+
#define MICROPY_HW_SPI1_SCK (43)
46+
*/
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
# Flash
3+
CONFIG_FLASHMODE_QIO=y
4+
#CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
5+
CONFIG_ESPTOOLPY_FLASHMODE="dio"
6+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
7+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
8+
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
9+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
10+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
11+
CONFIG_PARTITION_TABLE_CUSTOM=y
12+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"
13+
14+
# Memory
15+
CONFIG_SPIRAM=y
16+
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
17+
CONFIG_SPIRAM_MODE_HEX=y
18+
CONFIG_SPIRAM_SPEED_200M=y
19+
CONFIG_SPIRAM_MEMTEST=
20+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
21+
CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
22+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
23+
24+
25+
# ULP : not fixed
26+
CONFIG_SOC_ULP_SUPPORTED=n
27+
CONFIG_ULP_COPROC_ENABLED=n
28+
CONFIG_ULP_COPROC_TYPE_FSM=n
29+
30+
# Touchpad : not fixed
31+
CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y
32+
SOC_TOUCH_SENSOR_SUPPORTED=y
33+
CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y
34+
35+
36+
# Wifi
37+
#CONFIG_ESP_HOSTED_ENABLED=n
38+
CONFIG_ESP_HOST_WIFI_ENABLED=y
39+
40+
41+
# Ble
42+
CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR=y
43+
CONFIG_BT_ENABLED=y
44+
CONFIG_BT_NIMBLE_ENABLED=y
45+
CONFIG_BT_CONTROLLER_ENABLED=y
46+
CONFIG_CAM_CTLR_MIPI_CSI_ISR_IRAM_SAFE=y
47+
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="MPY ESP32"
48+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4
49+
50+
# Put NimBLE on core 1, and for synchronisation
51+
# with the ringbuffer and scheduler MP needs to be on the same core.
52+
# MP on core 1 prevents interference with WiFi for time sensitive operations.
53+
# Only on: ESP32, ESP32S2, ESP32S3
54+
#CONFIG_BT_NIMBLE_PINNED_TO_CORE_0=n
55+
#CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y
56+
#CONFIG_BT_NIMBLE_PINNED_TO_CORE=1
57+
58+
# Increase NimBLE task stack size from the default, because Python code
59+
# (BLE IRQ handlers) will most likely run on this task.
60+
CONFIG_BT_NIMBLE_TASK_STACK_SIZE=6144
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"deploy_options": {
6+
"flash_offset": "0x1000"
7+
},
8+
"docs": "",
9+
"features": [
10+
"BLE",
11+
"External Flash",
12+
"WiFi"
13+
],
14+
"images": [
15+
""
16+
],
17+
"mcu": "esp32p4",
18+
"product": "M5STACK TAB5",
19+
"thumbnail": "",
20+
"url": "https://docs.m5stack.com/en/core/Tab5",
21+
"variants": {
22+
},
23+
"vendor": "Espressif"
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This board need wifi_remote / esp_hosted with specific version to support wifi and ble on the ESP32C6 hosted.
2+
modify esp32/main/idf_component.yml before compile :
3+
4+
## IDF Component Manager Manifest File
5+
dependencies:
6+
espressif/mdns: ~1.1.0
7+
espressif/esp_tinyusb:
8+
rules:
9+
- if: target in [esp32s2, esp32s3]
10+
version: ~1.0.0
11+
## Required IDF version for M5STACK tab5
12+
idf: '>=5.3'
13+
espressif/esp_hosted: 1.4.0
14+
espressif/esp_wifi_remote: 0.8.5
15+
##chmorgan/esp-audio-player: 1.0.7
16+
chmorgan/esp-file-iterator: 1.0.0
17+
##espressif/led_strip: 3.0.0
18+
espressif/esp_lcd_ek79007: ^1.0.2
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set(IDF_TARGET esp32p4)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
boards/sdkconfig.base
5+
boards/FireBeetle_2_ESP32_P4/sdkconfig.board
6+
)
7+
set(MP_DL_FACE_RECOGNITION_ENABLED 1)
8+
set(MP_DL_COCO_DETECTOR_ENABLED 1)
9+
set(MP_DL_PEDESTRISN_DETECTOR_ENABLED 1)
10+
set(MP_DL_IMAGENET_CLS_ENABLED 0)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 "FireBeetle 2 ESP32 P4"
6+
#endif
7+
8+
#ifndef MICROPY_HW_MCU_NAME
9+
#define MICROPY_HW_MCU_NAME "ESP32P4"
10+
#endif
11+
12+
#define MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE (1)
13+
#define MICROPY_HW_ENABLE_USBDEV (1)
14+
#define MICROPY_PY_ESPNOW (0)
15+
#define MP_SD_LDO (1)
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+
/*
26+
#define MICROPY_HW_I2C0_SCL (32)
27+
#define MICROPY_HW_I2C0_SDA (31)
28+
29+
#define MICROPY_HW_SPI1_MOSI (44)
30+
#define MICROPY_HW_SPI1_MISO (39)
31+
#define MICROPY_HW_SPI1_SCK (43)
32+
*/
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
2+
# Flash
3+
CONFIG_FLASHMODE_QIO=y
4+
#CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
5+
CONFIG_ESPTOOLPY_FLASHMODE="dio"
6+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
7+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
8+
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
9+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
10+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
11+
#CONFIG_PARTITION_TABLE_CUSTOM=y
12+
#CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB_espdl.csv"
13+
14+
# Memory
15+
CONFIG_SPIRAM=y
16+
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
17+
CONFIG_SPIRAM_MODE_HEX=y
18+
CONFIG_SPIRAM_SPEED_200M=y
19+
CONFIG_SPIRAM_MEMTEST=
20+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
21+
CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
22+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
23+
24+
25+
# ULP : not fixed
26+
CONFIG_SOC_ULP_SUPPORTED=n
27+
CONFIG_ULP_COPROC_ENABLED=n
28+
CONFIG_ULP_COPROC_TYPE_FSM=n
29+
30+
# Touchpad : not fixed
31+
CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=n
32+
SOC_TOUCH_SENSOR_SUPPORTED=n
33+
CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=n
34+
35+
36+
# Wifi
37+
CONFIG_ESP_HOSTED_ENABLED=y
38+
#CONFIG_ESP_HOST_WIFI_ENABLED=y
39+
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16
40+
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64
41+
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64
42+
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
43+
CONFIG_ESP_WIFI_TX_BA_WIN=32
44+
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
45+
CONFIG_ESP_WIFI_RX_BA_WIN=32
46+
47+
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534
48+
CONFIG_LWIP_TCP_WND_DEFAULT=65534
49+
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
50+
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
51+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
52+
53+
CONFIG_LWIP_TCP_SACK_OUT=y
54+
# Bluetooth Support
55+
CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE=y
56+
CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI=y
57+
CONFIG_ESP_WIFI_REMOTE_ENABLED=y
58+
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
59+
CONFIG_SLAVE_SOC_WIFI_SUPPORTED=y
60+
CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT=y
61+
CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT=y
62+
CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT=y
63+
CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12
64+
CONFIG_SLAVE_SOC_WIFI_HW_TSF=y
65+
CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT=y
66+
CONFIG_SLAVE_FREERTOS_UNICORE=y
67+
CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT=y
68+
CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV=y
69+
CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT=y
70+
CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM=2
71+
CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y
72+
73+
CONFIG_ESP32_P4_EV_BOARD=y
74+
75+
# Ble
76+
CONFIG_ESP_ENABLE_BT=y
77+
CONFIG_BT_ENABLED=y
78+
CONFIG_BT_NIMBLE_ENABLED=y
79+
CONFIG_BT_CONTROLLER_DISABLED=y
80+
CONFIG_BT_BLUEDROID_ENABLED=n
81+
CONFIG_BT_NIMBLE_TRANSPORT_UART=n
82+
CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR=y
83+
84+
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="MPY ESP32"
85+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4
86+
87+
CONFIG_BT_HCI_LOG_DEBUG_EN=y
88+
89+
# Put NimBLE on core 1, and for synchronisation
90+
# with the ringbuffer and scheduler MP needs to be on the same core.
91+
# MP on core 1 prevents interference with WiFi for time sensitive operations.
92+
# Only on: ESP32, ESP32S2, ESP32S3
93+
#CONFIG_BT_NIMBLE_PINNED_TO_CORE_0=n
94+
#CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y
95+
#CONFIG_BT_NIMBLE_PINNED_TO_CORE=1
96+
97+
# Increase NimBLE task stack size from the default, because Python code
98+
# (BLE IRQ handlers) will most likely run on this task.
99+
CONFIG_BT_NIMBLE_TASK_STACK_SIZE=6144
100+
CONFIG_USB_OTG_SUPPORTED=y
101+
CONFIG_TINYUSB_CDC_ENABLED=y

0 commit comments

Comments
 (0)