@@ -190,7 +190,7 @@ def parse_args(extra_args, lv_cflags, brd):
190190esp_args ,extra_args = esp_argParser .parse_known_args (extra_args )
191191flash_size = esp_args .flash_size
192192
193- if board == 'ESP32_GENERIC' :
193+ elif board == 'ESP32_GENERIC' :
194194esp_argParser = ArgumentParser (prefix_chars = '-' )
195195
196196esp_argParser .add_argument (
@@ -404,6 +404,7 @@ def setup_idf_environ():
404404result ,output = spawn (cmds ,env = env ,out_to_screen = False )
405405
406406if result != 0 :
407+ print ('********* ERROR **********' )
407408print (output )
408409sys .exit (result )
409410
@@ -509,39 +510,34 @@ def compile(): # NOQA
509510'CONFIG_PARTITION_TABLE_CUSTOM=y' ,
510511 ]
511512
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+
512520if flash_size == 4 :
513521base_config .extend ([
514522'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y' ,
515- 'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n' ,
516- 'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n' ,
517- 'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n' ,
518523'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
519524'"partitions-4MiB.csv"'
520525 ])
521526elif flash_size == 8 :
522527base_config .extend ([
523- 'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n' ,
524528'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y' ,
525- 'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n' ,
526- 'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n' ,
527529'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
528530'"partitions-8MiB.csv"'
529531 ])
530532
531533elif flash_size == 16 :
532534base_config .extend ([
533- 'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n' ,
534- 'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n' ,
535535'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y' ,
536- 'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n' ,
537536'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
538537'"partitions-16MiB.csv"'
539538 ])
540539if flash_size == 32 :
541540base_config .extend ([
542- 'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n' ,
543- 'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n' ,
544- 'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n' ,
545541'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y' ,
546542'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='
547543'"partitions-32MiB.csv"'