@@ -140,22 +140,44 @@ def __fetch_spiffs_size(target, source, env):
140
140
SIZETOOL = "xtensa-esp32-elf-size" ,
141
141
142
142
ARFLAGS = ["rc" ],
143
+
143
144
ASFLAGS = ["-x" , "assembler-with-cpp" ],
145
+
144
146
CFLAGS = ["-std=gnu99" ],
147
+
145
148
CCFLAGS = [
146
- "-Os" , "-Wall" , "-nostdlib" , "-Wpointer-arith" ,
147
- "-Wno-error=unused-but-set-variable" , "-Wno-error=unused-variable" ,
148
- "-mlongcalls" , "-ffunction-sections" , "-fdata-sections" ,
149
+ "-Os" ,
150
+ "-Wall" ,
151
+ "-nostdlib" ,
152
+ "-Wpointer-arith" ,
153
+ "-Wno-error=unused-but-set-variable" ,
154
+ "-Wno-error=unused-variable" ,
155
+ "-mlongcalls" ,
156
+ "-ffunction-sections" ,
157
+ "-fdata-sections" ,
149
158
"-fstrict-volatile-bitfields"
150
159
],
151
- CXXFLAGS = ["-fno-rtti" , "-fno-exceptions" , "-std=gnu++11" ],
160
+
161
+ CXXFLAGS = [
162
+ "-fno-rtti" ,
163
+ "-fno-exceptions" ,
164
+ "-std=gnu++11"
165
+ ],
166
+
152
167
CPPDEFINES = [
153
- "ESP32" , "ESP_PLATFORM" , ("F_CPU" , "$BOARD_F_CPU" ), "HAVE_CONFIG_H" ,
168
+ "ESP32" ,
169
+ "ESP_PLATFORM" ,
170
+ ("F_CPU" , "$BOARD_F_CPU" ),
171
+ "HAVE_CONFIG_H" ,
154
172
("MBEDTLS_CONFIG_FILE" , '\\ "mbedtls/esp_config.h\\ "' )
155
173
],
174
+
156
175
LINKFLAGS = [
157
- "-nostdlib" , "-Wl,-static" , "-u" , "call_user_start_cpu0" ,
158
- "-Wl,--undefined=uxTopUsedPriority" , "-Wl,--gc-sections"
176
+ "-nostdlib" ,
177
+ "-Wl,-static" ,
178
+ "-u" , "call_user_start_cpu0" ,
179
+ "-Wl,--undefined=uxTopUsedPriority" ,
180
+ "-Wl,--gc-sections"
159
181
],
160
182
161
183
SIZEPROGREGEXP = r"^(?:\.iram0\.text|\.dram0\.text|\.flash\.text|\.dram0\.data|\.flash\.rodata|)\s+(\d+).*" ,
@@ -177,17 +199,24 @@ def __fetch_spiffs_size(target, source, env):
177
199
BUILDERS = dict (
178
200
ElfToBin = Builder (
179
201
action = env .VerboseAction (" " .join ([
180
- '"$PYTHONEXE" "$OBJCOPY"' , "--chip" , "esp32" , "elf2image" ,
181
- "--flash_mode" , "$BOARD_FLASH_MODE" , "--flash_freq" ,
182
- "${__get_board_f_flash(__env__)}" , "--flash_size" ,
183
- env .BoardConfig ().get ("upload.flash_size" ,
184
- "detect" ), "-o" , "$TARGET" , "$SOURCES"
202
+ '"$PYTHONEXE" "$OBJCOPY"' ,
203
+ "--chip" , "esp32" ,
204
+ "elf2image" ,
205
+ "--flash_mode" , "$BOARD_FLASH_MODE" ,
206
+ "--flash_freq" , "${__get_board_f_flash(__env__)}" ,
207
+ "--flash_size" , env .BoardConfig ().get (
208
+ "upload.flash_size" , "detect" ),
209
+ "-o" , "$TARGET" , "$SOURCES"
185
210
]), "Building $TARGET" ),
186
211
suffix = ".bin" ),
187
212
DataToBin = Builder (
188
213
action = env .VerboseAction (" " .join ([
189
- '"$MKSPIFFSTOOL"' , "-c" , "$SOURCES" , "-p" , "$SPIFFS_PAGE" ,
190
- "-b" , "$SPIFFS_BLOCK" , "-s" , "$SPIFFS_SIZE" , "$TARGET"
214
+ '"$MKSPIFFSTOOL"' ,
215
+ "-c" , "$SOURCES" ,
216
+ "-p" , "$SPIFFS_PAGE" ,
217
+ "-b" , "$SPIFFS_BLOCK" ,
218
+ "-s" , "$SPIFFS_SIZE" ,
219
+ "$TARGET"
191
220
]), "Building SPIFFS image from '$SOURCES' directory to $TARGET" ),
192
221
emitter = __fetch_spiffs_size ,
193
222
source_factory = env .Dir ,
@@ -252,11 +281,15 @@ def __fetch_spiffs_size(target, source, env):
252
281
UPLOADEROTA = join (
253
282
platform .get_package_dir ("tool-espotapy" ) or "" , "espota.py" ),
254
283
UPLOADERFLAGS = [
255
- "--chip" , "esp32" , "--port" , '"$UPLOAD_PORT"' , "--baud" ,
256
- "$UPLOAD_SPEED" , "--before" , "default_reset" , "--after" ,
257
- "hard_reset" , "write_flash" , "-z" , "--flash_mode" ,
258
- "${__get_board_flash_mode(__env__)}" , "--flash_freq" ,
259
- "${__get_board_f_flash(__env__)}" , "--flash_size" , "detect"
284
+ "--chip" , "esp32" ,
285
+ "--port" , '"$UPLOAD_PORT"' ,
286
+ "--baud" , "$UPLOAD_SPEED" ,
287
+ "--before" , "default_reset" ,
288
+ "--after" , "hard_reset" ,
289
+ "write_flash" , "-z" ,
290
+ "--flash_mode" , "${__get_board_flash_mode(__env__)}" ,
291
+ "--flash_freq" , "${__get_board_f_flash(__env__)}" ,
292
+ "--flash_size" , "detect"
260
293
],
261
294
UPLOADEROTAFLAGS = [
262
295
"--debug" , "--progress" , "-i" , "$UPLOAD_PORT" , "-p" , "3232" ,
@@ -281,10 +314,15 @@ def __fetch_spiffs_size(target, source, env):
281
314
if "uploadfs" in COMMAND_LINE_TARGETS :
282
315
env .Replace (
283
316
UPLOADERFLAGS = [
284
- "--chip" , "esp32" , "--port" , '"$UPLOAD_PORT"' , "--baud" ,
285
- "$UPLOAD_SPEED" , "--before" , "default_reset" , "--after" ,
286
- "hard_reset" , "write_flash" , "-z" , "--flash_mode" ,
287
- "$BOARD_FLASH_MODE" , "--flash_size" , "detect" , "$SPIFFS_START"
317
+ "--chip" , "esp32" ,
318
+ "--port" , '"$UPLOAD_PORT"' ,
319
+ "--baud" , "$UPLOAD_SPEED" ,
320
+ "--before" , "default_reset" ,
321
+ "--after" , "hard_reset" ,
322
+ "write_flash" , "-z" ,
323
+ "--flash_mode" , "$BOARD_FLASH_MODE" ,
324
+ "--flash_size" , "detect" ,
325
+ "$SPIFFS_START"
288
326
],
289
327
UPLOADCMD = '"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE' ,
290
328
)
0 commit comments