8000 ports/esp32: Add modesp32s3. · micropython/micropython@e4f7ead · GitHub
[go: up one dir, main page]

Skip to content

Commit e4f7ead

Browse files
committed
ports/esp32: Add modesp32s3.
Signed-off-by: fvstory <fv1016898007@qq.com>
1 parent 92c7532 commit e4f7ead

File tree

11 files changed

+993
-0
lines changed

11 files changed

+993
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"deploy": [
3+
"../deploy_s3.md"
4+
],
5+
"docs": "",
6+
"features": [
7+
"BLE",
8+
"WiFi"
9+
],
10+
"images": [
11+
"generic_s3.jpg"
12+
],
13+
"mcu": "esp32s3",
14+
"product": "Generic ESP32-S3 (SPIRAM Octal)",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "Espressif"
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set(IDF_TARGET esp32s3)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
boards/sdkconfig.base
5+
boards/sdkconfig.usb
6+
boards/sdkconfig.ble
7+
boards/sdkconfig.240mhz
8+
boards/sdkconfig.gram_oct
9+
boards/GENERIC_S3_SPIRAM_OCT/sdkconfig.board
10+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#define MICROPY_HW_BOARD_NAME "ESP32S3 module (gram octal)"
2+
#define MICROPY_HW_MCU_NAME "ESP32S3"
3+
4+
#define MICROPY_PY_MACHINE_DAC (0)
5+
6+
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
7+
#define MICROPY_HW_ENABLE_UART_REPL (1)
8+
9+
#define MICROPY_HW_I2C0_SCL (9)
10+
#define MICROPY_HW_I2C0_SDA (8)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
2+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
4+
5+
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
6+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
7+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=Y
8+
CONFIG_PARTITION_TABLE_CUSTOM=y
9+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"

ports/esp32/boards/GENERIC_S3_SPIRAM_OCT/mpconfigboard.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
77
#define MICROPY_HW_ENABLE_UART_REPL (1)
88

9+
#define MICROPY_ESP_ENABLE_PSRAM_OCT (1)
10+
911
#define MICROPY_HW_I2C0_SCL (9)
1012
#define MICROPY_HW_I2C0_SDA (8)

ports/esp32/boards/sdkconfig.gram_oct

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# MicroPython on ESP32-S2 and ESP32-PAD1_subscript_3, ESP IDF configuration with SPIRAM support in Octal mode
2+
CONFIG_SPIRAM_MODE_QUAD=y
3+
CONFIG_SPIRAM_TYPE_AUTO=y
4+
CONFIG_SPIRAM_CLK_IO=30
5+
CONFIG_SPIRAM_CS_IO=26
6+
# In espidf5.1 the speed can be up to 120M(improve the display effect), TODO.
7+
# TODO, make other CONFIG which also improve the display effect.
8+
# But in the 120M speed, espidf say that temperature safety cannot be ensured.
9+
CONFIG_SPIRAM_SPEED_80M=y
10+
CONFIG_SPIRAM=y
11+
CONFIG_SPIRAM_BOOT_INIT=y
12+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
13+
CONFIG_SPIRAM_USE_CAPS_ALLOC=y
14+
CONFIG_SPIRAM_MODE_QUAD=
15+
CONFIG_SPIRAM_MODE_OCT=y

ports/esp32/main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "esp_event.h"
3939
#include "esp_log.h"
4040
#include "esp_psram.h"
41+
#include "esp_heap_caps.h"
4142

4243
#include "py/stackctrl.h"
4344
#include "py/nlr.h"
@@ -64,6 +65,10 @@
6465
#include "modespnow.h"
6566
#endif
6667

68+
#if MICROPY_ESP32S3_LCDCAM
69+
#include "modesp32s3.h"
70+
#endif
71+
6772
// MicroPython runs as a task under FreeRTOS
6873
#define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1)
6974
#define MP_TASK_STACK_SIZE (16 * 1024)
@@ -160,6 +165,11 @@ void mp_task(void *pvParameter) {
160165
MP_STATE_PORT(espnow_singleton) = NULL;
161166
#endif
162167

168+
#if MICROPY_ESP32S3_LCDCAM
169+
mp_esp32s3_lcd_cam_global_deinit();
170+
MP_STATE_PORT(esp32s3_lcd_cam_singleton) = NULL;
171+
#endif
172+
163173
machine_timer_deinit_all();
164174

165175
#if MICROPY_PY_THREAD

ports/esp32/main_esp32s3/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@ if(NOT MICROPY_PORT_DIR)
88
get_filename_component(MICROPY_PORT_DIR ${MICROPY_DIR}/ports/esp32 ABSOLUTE)
99
endif()
1010

11+
list(APPEND MICROPY_SOURCE_PORT
12+
modesp32s3.c
13+
)
14+
15+
list(APPEND IDF_COMPONENTS
16+
esp_lcd
17+
)
18+
1119
include(${MICROPY_PORT_DIR}/esp32_common.cmake)

0 commit comments

Comments
 (0)
0