2
2
#
3
3
# This is a simple, convenience wrapper around idf.py (which uses cmake).
4
4
5
- # Select the mcu type to build, default is M5STACK_8MB
6
- # M5STACK_xxx -> ESP32
7
- # M5STACK_C3_xxx -> ESP32 C3
8
- # M5STACK_S3_xxx -> ESP32 S3
9
5
-include .workenv
10
6
11
7
BOARD ?= M5STACK_AtomS3
83
79
BUILD ?= build-$(BOARD )
84
80
85
81
# Device serial settings.
86
- # PORT ?= /dev/ttyS8
87
82
PORT ?= /dev/ttyUSB0
88
83
BAUD ?= 1500000
89
84
102
97
103
98
IDFPY_FLAGS += -DMICROPY_BOARD=$(BOARD ) -DBUILD_WITH_LVGL=$(LVGL ) -B$(BUILD ) $(CMAKE_ARGS )
104
99
IDFPY_FLAGS += -DBOARD_TYPE=$(BOARD_TYPE )
100
+
105
101
ifdef FROZEN_MANIFEST
106
102
IDFPY_FLAGS += -D MICROPY_FROZEN_MANIFEST=$(FROZEN_MANIFEST )
107
103
endif
@@ -138,53 +134,48 @@ all: nvs fs pack
138
134
139
135
$(BUILD ) /bootloader/bootloader.bin $(BUILD ) /partition_table/partition-table.bin $(BUILD ) /micropython.bin : FORCE
140
136
141
- # config the menu
137
+ # Config menu
142
138
menu :
143
139
idf.py $(IDFPY_FLAGS ) menuconfig
144
140
141
+ # Show the size summary
145
142
size :
146
143
idf.py $(IDFPY_FLAGS ) size
147
144
148
- # Build the MicroPython firmware.
145
+ # Build the MicroPython firmware
149
146
build : nvs
150
147
idf.py $(IDFPY_FLAGS ) build
151
148
152
- # Deploy the MicroPython.
149
+ # Deploy the MicroPython firmware
153
150
deploy : build
154
151
idf.py $(IDFPY_FLAGS ) -p $(PORT ) -b $(BAUD ) flash
155
152
156
- # Deploy the MicroPython and system filesystem.
153
+ # Deploy the MicroPython and system filesystem
157
154
flash : pack
158
155
esptool.py --chip $(CHIP ) --port $(PORT ) --baud $(BAUD ) write_flash 0x0 $(BUILD ) /uiflow-$(GIT_VERSION ) .bin
159
156
160
- # Deploy the MicroPython, system filesystem and user filesystem.
157
+ # Deploy the MicroPython, system filesystem and user filesystem
161
158
flash_all : pack_all
162
159
esptool.py --chip $(CHIP ) --port $(PORT ) --baud $(BAUD ) write_flash 0x0 $(BUILD ) /uiflow-$(GIT_VERSION ) .bin
163
160
164
- # Clean the build directory.
161
+ # Clean the build directory
165
162
clean :
166
163
idf.py $(IDFPY_FLAGS ) fullclean
167
- # cd ./../micropython && \
168
- # git apply --reverse ./../m5stack/patches/0001_mpconfigport_lvgl_support.patch && cd -
169
- cd ./components/lv_bindings && \
170
- git apply --reverse ./../../patches/0002_avoid_lv_bindings_compile_error.patch && cd -
171
- cd ./components/M5Unified/M5Unified && \
172
- git apply --reverse ./../../../patches/2003-Support-LTR553.patch && cd -
173
164
174
- # Erase the flash chip.
165
+ # Erase the flash chip
175
166
erase :
176
167
idf.py $(IDFPY_FLAGS ) -p $(PORT ) -b $(BAUD ) erase_flash
177
168
178
- # Run the serial monitor.
169
+ # Run the serial monitor
179
170
monitor :
180
171
idf.py $(IDFPY_FLAGS ) -p $(PORT ) -b $(BAUD ) monitor
181
172
182
- # Build the NVS partition firmware.
173
+ # Build the NVS partition firmware
183
174
# fixed size 0x6000
184
175
nvs :
185
176
@$(PYTHON ) ./../tools/nvs_partition_gen.py generate partition_nvs.csv $(BUILD ) /nvs.bin 0x6000
186
177
187
- # Build the system and user filesystem firmware.
178
+ # Build the system and user filesystem firmware
188
179
ifeq ($(TINY_FLAG ) ,1)
189
180
fs : build
190
181
@if [ ! -d $( BUILD) /base-files ]; then \
@@ -216,8 +207,6 @@ fs: build
216
207
$(BUILD ) /partition_table/partition-table.bin
217
208
endif
218
209
219
-
220
-
221
210
# Pack the firmware into a single binary without user filesystem.
222
211
# Released firmware needn't user filesystem.
223
212
pack : fs
@@ -238,7 +227,6 @@ mpy-cross:
238
227
# The two submodules do not belong to the same repository
239
228
# micropython submodule belong to uiflow_micropython
240
229
# berkeley-db-1.xx submodule belong to micropython submodule
241
- # TODO: need update this :)
242
230
submodules :
243
231
git submodule update --init ../tools/littlefs/mbed-littlefs
244
232
git submodule update --init ./components/esp32-camera
@@ -247,7 +235,17 @@ submodules:
247
235
git submodule update --init --recursive ./components/lv_bindings
248
236
git submodule update --init ../micropython
249
237
cd ./../micropython && git submodule update --init $(addprefix ./,$(GIT_SUBMODULES ) ) && cd -
238
+
239
+ # Apply patches
240
+ patch :
250
241
cd ./components/lv_bindings && \
251
242
git apply ./../../patches/0002_avoid_lv_bindings_compile_error.patch && cd -
252
243
cd ./components/M5Unified/M5Unified && \
253
244
git apply ./../../../patches/2003-Support-LTR553.patch && cd -
245
+
246
+ # Unapply patches
247
+ unpatch :
248
+ cd ./components/lv_bindings && \
249
+ git apply -R ./../../patches/0002_avoid_lv_bindings_compile_error.patch && cd -
250
+ cd ./components/M5Unified/M5Unified && \
251
+ git apply -R ./../../../patches/2003-Support-LTR553.patch && cd -
0 commit comments