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

Lines changed: 16 additions & 2 deletions
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
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}
Lines changed: 18 additions & 0 deletions
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()
Lines changed: 13 additions & 0 deletions
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"
Lines changed: 9 additions & 0 deletions
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
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}
Lines changed: 18 additions & 0 deletions
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()
Lines changed: 13 additions & 0 deletions
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"
Lines changed: 9 additions & 0 deletions
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
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": "M5Stack S3 Serials",
15+
"thumbnail": "",
16+
"url": "https://www.espressif.com/en/products/modules",
17+
"vendor": "M5Stack"
18+
}

0 commit comments

Comments
 (0)