@@ -190,7 +190,7 @@ def parse_args(extra_args, lv_cflags, brd):
190
190
esp_args , extra_args = esp_argParser .parse_known_args (extra_args )
191
191
flash_size = esp_args .flash_size
192
192
193
- if board == 'ESP32_GENERIC' :
193
+ elif board == 'ESP32_GENERIC' :
194
194
esp_argParser = ArgumentParser (prefix_chars = '-' )
195
195
196
196
esp_argParser .add_argument (
@@ -404,6 +404,7 @@ def setup_idf_environ():
404
404
result , output = spawn (cmds , env = env , out_to_screen = False )
405
405
406
406
if result != 0 :
407
+ print ('********* ERROR **********' )
407
408
print (output )
408
409
sys .exit (result )
409
410
@@ -509,39 +510,34 @@ def compile(): # NOQA
509
510
'CONFIG_PARTITION_TABLE_CUSTOM=y' ,
510
511
]
511
512
513
+ if flash_size == 2 :
514
+ base_config .extend ([
515
+ 'CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y' ,
516
+ 'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
517
+ '"partitions-2MiB.csv"'
518
+ ])
519
+
512
520
if flash_size == 4 :
513
521
base_config .extend ([
514
522
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y' ,
515
- 'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n' ,
516
- 'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n' ,
517
- 'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n' ,
518
523
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
519
524
'"partitions-4MiB.csv"'
520
525
])
521
526
elif flash_size == 8 :
522
527
base_config .extend ([
523
- 'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n' ,
524
528
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y' ,
525
- 'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n' ,
526
- 'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n' ,
527
529
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
528
530
'"partitions-8MiB.csv"'
529
531
])
530
532
531
533
elif flash_size == 16 :
532
534
base_config .extend ([
533
- 'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n' ,
534
- 'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n' ,
535
535
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y' ,
536
- 'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n' ,
537
536
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
538
537
'"partitions-16MiB.csv"'
539
538
])
540
539
if flash_size == 32 :
541
540
base_config .extend ([
542
- 'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n' ,
543
- 'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n' ,
544
- 'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n' ,
545
541
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y' ,
546
542
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
547
543
'"partitions-32MiB.csv"'
0 commit comments