Skip to content

Commit 178e187

Browse files
committed
chore: Modify the build system
Assign configuration files to each board individually Signed-off-by: lbuque <[email protected]>
1 parent 359ea9c commit 178e187

34 files changed

+472
-2
lines changed

m5stack/Makefile

+16-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,28 @@
99

1010
BOARD ?= M5STACK_8MB
1111

12+
boards := \
13+
M5STACK_AtomS3:atoms3 \
14+
M5STACK_AtomS3_Lite:atoms3-lite \
15+
M5STACK_StampS3:stamps3 \
16+
M5STACK_CoreS3:cores3 \
17+
M5STACK_AtomS3U:atoms3u \
18+
M5STACK_Core2:core2 \
19+
M5STACK_StickC_PLUS2:stickcplus2 \
20+
M5STACK_StickC_PLUS:stickcplus \
21+
M5STACK_Fire:fire
22+
23+
define find_board
24+
$(if $(filter $(1):%,$(boards)),$(word 2,$(subst :, ,$(filter $(1):%,$(boards)))),$(error Mapping not found for $(1)))
25+
endef
1226

1327
# Board type list
14-
BOARD_TYPE_DEF := none atoms3 stamps3 cores3 atoms3u core2 stickcplus2 stickcplus fire
28+
BOARD_TYPE_DEF := none atoms3 atoms3-lite stamps3 cores3 atoms3u core2 stickcplus2 stickcplus fire
1529

1630
# Select the board type to build, default is None
1731
# This value affects which folder in the "./fs/system/" directory is pack into "fs-system.bin"
1832
# If use default value, it means no directory will pack into "fs-system.bin"
19-
BOARD_TYPE ?= none
33+
BOARD_TYPE ?= $(call find_board,$(BOARD))
2034

2135
ifneq ($(filter $(BOARD_TYPE),$(BOARD_TYPE_DEF)),)
2236
else
+18
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set(IDF_TARGET esp32s3)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
./boards/M5STACK_S3_8MB/sdkconfig.board
5+
./boards/sdkconfig.base
6+
./boards/sdkconfig.240mhz
7+
./boards/sdkconfig.disable_iram
8+
./boards/sdkconfig.ble
9+
./boards/sdkconfig.usb
10+
./boards/sdkconfig.flash_8mb
11+
)
12+
13+
# If not enable LVGL, ignore this...
14+
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=0)
15+
16+
if(NOT MICROPY_FROZEN_MANIFEST)
17+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
18+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define MICROPY_HW_BOARD_NAME "M5STACK"
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)
11+
12+
// If not enable LVGL, ignore this...
13+
#include "./../mpconfiglvgl.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_FLASHMODE_DIO=y # QIO mode has some problem when mount fs
2+
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
3+
CONFIG_ESPTOOLPY_FLASHMODE="dio"
4+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
5+
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
6+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
7+
8+
CONFIG_SPIRAM_MEMTEST=
9+
CONFIG_FREERTOS_UNICORE=y
+18
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set(IDF_TARGET esp32s3)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
./boards/M5STACK_S3_8MB/sdkconfig.board
5+
./boards/sdkconfig.base
6+
./boards/sdkconfig.240mhz
7+
./boards/sdkconfig.disable_iram
8+
./boards/sdkconfig.ble
9+
./boards/sdkconfig.usb
10+
./boards/sdkconfig.flash_8mb
11+
)
12+
13+
# If not enable LVGL, ignore this...
14+
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=0)
15+
16+
if(NOT MICROPY_FROZEN_MANIFEST)
17+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
18+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define MICROPY_HW_BOARD_NAME "M5STACK"
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)
11+
12+
// If not enable LVGL, ignore this...
13+
#include "./../mpconfiglvgl.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_FLASHMODE_DIO=y # QIO mode has some problem when mount fs
2+
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
3+
CONFIG_ESPTOOLPY_FLASHMODE="dio"
4+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
5+
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
6+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
7+
8+
CONFIG_SPIRAM_MEMTEST=
9+
CONFIG_FREERTOS_UNICORE=y
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set(IDF_TARGET esp32s3)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
./boards/M5STACK_S3_8MB/sdkconfig.board
5+
./boards/sdkconfig.base
6+
./boards/sdkconfig.240mhz
7+
./boards/sdkconfig.disable_iram
8+
./boards/sdkconfig.ble
9+
./boards/sdkconfig.usb
10+
./boards/sdkconfig.flash_8mb
11+
)
12+
13+
# If not enable LVGL, ignore this...
14+
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=0)
15+
16+
if(NOT MICROPY_FROZEN_MANIFEST)
17+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
18+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define MICROPY_HW_BOARD_NAME "M5STACK"
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)
11+
12+
// If not enable LVGL, ignore this...
13+
#include "./../mpconfiglvgl.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_FLASHMODE_DIO=y # QIO mode has some problem when mount fs
2+
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
3+
CONFIG_ESPTOOLPY_FLASHMODE="dio"
4+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
5+
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
6+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
7+
8+
CONFIG_SPIRAM_MEMTEST=
9+
CONFIG_FREERTOS_UNICORE=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(SDKCONFIG_DEFAULTS
2+
./boards/sdkconfig.base
3+
./boards/sdkconfig.flash_16mb
4+
./boards/sdkconfig.ble
5+
./boards/sdkconfig.240mhz
6+
./boards/sdkconfig.disable_iram
7+
./boards/M5STACK_Core2/sdkconfig.board
8+
)
9+
10+
# If not enable LVGL, ignore this...
11+
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=0)
12+
13+
if(NOT MICROPY_FROZEN_MANIFEST)
14+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
15+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#define MICROPY_HW_BOARD_NAME "M5STACK"
2+
#define MICROPY_HW_MCU_NAME "ESP32(SPIRAM)"
3+
4+
// If not enable LVGL, ignore this...
5+
#include "./../mpconfiglvgl.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SSL
2+
CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=n
3+
CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC=y
4+
5+
# Flash
6+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
7+
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
8+
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
9+
10+
# MicroPython on ESP32, ESP IDF configuration with SPIRAM support
11+
12+
CONFIG_ESP32_SPIRAM_SUPPORT=y
13+
CONFIG_SPIRAM_CACHE_WORKAROUND=y
14+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
15+
# CONFIG_SPIRAM_USE_MEMMAP=y
16+
CONFIG_SPIRAM_USE_MALLOC=y
17+
CONFIG_SPIRAM_SPEED_80M=y
18+
# CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=8192
19+
# CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=16384
20+
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
+18
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
set(IDF_TARGET esp32s3)
2+
# Enable camera module
3+
set(M5_CAMERA_MODULE_ENABLE TRUE)
4+
5+
set(SDKCONFIG_DEFAULTS
6+
./boards/M5STACK_S3_8MB/sdkconfig.board
7+
./boards/sdkconfig.base
8+
./boards/sdkconfig.240mhz
9+
./boards/sdkconfig.disable_iram
10+
./boards/sdkconfig.ble
11+
./boards/sdkconfig.usb
12+
./boards/sdkconfig.flash_16mb
13+
./boards/sdkconfig.spiram_sx
14+
)
15+
16+
# If not enable LVGL, ignore this...
17+
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=0)
18+
19+
if(NOT MICROPY_FROZEN_MANIFEST)
20+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
21+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define MICROPY_HW_BOARD_NAME "M5STACK"
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)
11+
12+
// If not enable LVGL, ignore this...
13+
#include "./../mpconfiglvgl.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_FLASHMODE_DIO=y # QIO mode has some problem when mount fs
2+
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
3+
CONFIG_ESPTOOLPY_FLASHMODE="dio"
4+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
5+
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
6+
CONFIG_ESPTOOLPY_AFTER_NORESET=y
7+
8+
CONFIG_SPIRAM_MEMTEST=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(SDKCONFIG_DEFAULTS
2+
./boards/sdkconfig.base
3+
./boards/sdkconfig.flash_16mb
4+
./boards/sdkconfig.ble
5+
./boards/sdkconfig.240mhz
6+
./boards/sdkconfig.disable_iram
7+
./boards/M5STACK_Fire/sdkconfig.board
8+
)
9+
10+
# If not enable LVGL, ignore this...
11+
set(LV_CFLAGS -DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=0)
12+
13+
if(NOT MICROPY_FROZEN_MANIFEST)
14+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
15+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#define MICROPY_HW_BOARD_NAME "M5STACK"
2+
#define MICROPY_HW_MCU_NAME "ESP32(SPIRAM)"
3+
4+
// If not enable LVGL, ignore this...
5+
#include "./../mpconfiglvgl.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SSL
2+
CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=n
3+
CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC=y
4+
5+
# Flash
6+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
7+
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
8+
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
9+
10+
# MicroPython on ESP32, ESP IDF configuration with SPIRAM support
11+
12+
CONFIG_ESP32_SPIRAM_SUPPORT=y
13+
CONFIG_SPIRAM_CACHE_WORKAROUND=y
14+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
15+
# CONFIG_SPIRAM_USE_MEMMAP=y
16+
CONFIG_SPIRAM_USE_MALLOC=y
17+
CONFIG_SPIRAM_SPEED_80M=y
18+
# CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=8192
19+
# CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=16384
20+
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
+18
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}

0 commit comments

Comments
 (0)