Skip to content

Commit 06c0418

Browse files
committed
chore/m5stack: Modify build script
1 parent 99d9f15 commit 06c0418

File tree

16 files changed

+94
-54
lines changed

16 files changed

+94
-54
lines changed

m5stack/CMakeLists.txt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,23 @@ if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
2121
message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}")
2222
endif()
2323

24-
# Include main IDF cmake file.
25-
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
26-
2724
# Define the output sdkconfig so it goes in the build directory.
2825
set(SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig)
2926

27+
# Save the manifest file set from the cmake command line.
28+
set(MICROPY_USER_FROZEN_MANIFEST ${MICROPY_FROZEN_MANIFEST})
29+
3030
# Include board config; this is expected to set SDKCONFIG_DEFAULTS (among other options).
3131
include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
3232

33+
# Set the frozen manifest file. Note if MICROPY_FROZEN_MANIFEST is set from the cmake
34+
# command line, then it will override the default and any manifest set by the board.
35+
if (MICROPY_USER_FROZEN_MANIFEST)
36+
set(MICROPY_FROZEN_MANIFEST ${MICROPY_USER_FROZEN_MANIFEST})
37+
elseif (NOT MICROPY_FROZEN_MANIFEST)
38+
set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/boards/manifest.py)
39+
endif()
40+
3341
# Add sdkconfig fragments that depend on the IDF version.
3442
if(IDF_VERSION_MAJOR EQUAL 4 AND IDF_VERSION_MINOR LESS 2)
3543
set(SDKCONFIG_DEFAULTS ${SDKCONFIG_DEFAULTS} boards/sdkconfig.nimble_core0)
@@ -56,5 +64,11 @@ if(BUILD_WITH_LVGL)
5664
idf_build_set_property(COMPILE_DEFINITIONS "${LV_CFLAGS}" APPEND)
5765
endif()
5866

67+
# Include main IDF cmake file.
68+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
69+
70+
# Set the location of the main component for the project (one per target).
71+
list(APPEND EXTRA_COMPONENT_DIRS main_${IDF_TARGET})
72+
5973
# Define the project.
6074
project(micropython)

m5stack/main/CMakeListsDefault.cmake renamed to m5stack/CMakeListsDefault.cmake

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,41 +129,40 @@ set(MICROPY_SOURCE_QSTR
129129

130130
set(IDF_COMPONENTS
131131
app_update
132-
esp_app_format
133132
bootloader_support
134133
bt
135134
driver
136-
# esp_adc_cal
137135
esp_adc
138136
esp_app_format
139137
esp_common
140138
esp_eth
141139
esp_event
142140
esp_hw_support
141+
esp_netif
142+
esp_partition
143+
esp_pm
144+
esp_psram
143145
esp_ringbuf
144146
esp_rom
147+
esp_system
148+
esp_timer
145149
esp_wifi
146150
freertos
151+
hal
147152
heap
148153
log
149154
lwip
150155
mbedtls
151-
mdns
152156
newlib
153157
nvs_flash
154158
sdmmc
155159
soc
156160
spi_flash
157-
esp_psram
158-
esp_partition
159-
# tcpip_adapter
160-
esp_netif
161161
ulp
162162
vfs
163163
xtensa
164164
esp_http_client
165165
esp-tls
166-
nghttp
167166
libffi
168167
json
169168
M5Unified
File renamed without changes.

m5stack/Makefile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,14 @@ define pack_fw
122122
$(BUILD)/uiflow-Sx-$(GIT_VERSION).uf2
123123
endef
124124

125-
.PHONY: all target menu build deploy flash flash_all clean erase nvs fs pack pack_all littlefs mpy-cross submodules FORCE
125+
.PHONY: all menu build deploy flash flash_all clean erase nvs fs pack pack_all littlefs mpy-cross submodules FORCE
126126

127127
all: nvs fs pack
128128
@echo ""
129129
@echo "Done, default packed firmware don't include vfs filesystem, if need vfs filesystem, please use 'make pack_all' command."
130130

131131
$(BUILD)/bootloader/bootloader.bin $(BUILD)/partition_table/partition-table.bin $(BUILD)/micropython.bin: FORCE
132132

133-
# set the target
134-
target:
135-
idf.py $(IDFPY_FLAGS) set-target $(CHIP)
136-
137133
# config the menu
138134
menu:
139135
idf.py $(IDFPY_FLAGS) menuconfig
@@ -142,7 +138,7 @@ size:
142138
idf.py $(IDFPY_FLAGS) size
143139

144140
# Build the MicroPython firmware.
145-
build: target nvs
141+
build: nvs
146142
idf.py $(IDFPY_FLAGS) build
147143

148144
# Deploy the MicroPython.
@@ -237,9 +233,9 @@ mpy-cross:
237233
# TODO: need update this :)
238234
submodules:
239235
git submodule update --init ../tools/littlefs/mbed-littlefs
240-
# git submodule update --init ./components/esp32-camera
241-
# git submodule update --init ./components/M5Unified/M5GFX
242-
# git submodule update --init ./components/M5Unified/M5Unified
236+
git submodule update --init ./components/esp32-camera
237+
git submodule update --init ./components/M5Unified/M5GFX
238+
git submodule update --init ./components/M5Unified/M5Unified
243239
git submodule update --init --recursive ./components/lv_bindings
244240
# git submodule update --init ../micropython
245241
cd ./../micropython && git submodule update --init $(addprefix ./,$(GIT_SUBMODULES)) && cd -

m5stack/components/M5Unified/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ file(GLOB SRCS
2323

2424
set(COMPONENT_SRCS ${SRCS})
2525
if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
26-
set(COMPONENT_REQUIRES esp_adc nvs_flash efuse driver esp_timer main)
26+
set(COMPONENT_REQUIRES esp_adc nvs_flash efuse driver esp_timer main_${IDF_TARGET})
2727
else()
2828
set(COMPONENT_REQUIRES esp_adc_cal nvs_flash efuse main)
2929
endif()

m5stack/esp32_common.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# LVGL support
2+
if(BUILD_WITH_LVGL)
3+
message(STATUS "Build with LVGL enable...")
4+
include(${PROJECT_DIR}/CMakeListsLvgl.cmake)
5+
else()
6+
include(${PROJECT_DIR}/CMakeListsDefault.cmake)
7+
endif()

m5stack/main/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

m5stack/main/idf_component.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

m5stack/main_esp32/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Set location of base MicroPython directory.
2+
if(NOT MICROPY_DIR)
3+
get_filename_component(MICROPY_DIR ${PROJECT_DIR}/../micropython/ ABSOLUTE)
4+
endif()
5+
6+
# include(${MICROPY_PORT_DIR}/esp32_common.cmake)
7+
include(${CMAKE_CURRENT_LIST_DIR}/../esp32_common.cmake)

m5stack/main_esp32/idf_component.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## IDF Component Manager Manifest File
2+
dependencies:
3+
espressif/mdns: "~1.1.0"
4+
idf:
5+
version: ">=5.0.4"

0 commit comments

Comments
 (0)