@@ -446,6 +446,12 @@ def merge_region_list(region_list, destination, notify, padding=b'\xFF'):
446
446
merged .tofile (destination , format = format .strip ("." ))
447
447
448
448
449
+ UPDATE_WHITELIST = (
450
+ "application" ,
451
+ "header" ,
452
+ )
453
+
454
+
449
455
def build_project (src_paths , build_path , target , toolchain_name ,
450
456
libraries_paths = None , linker_script = None , clean = False ,
451
457
notify = None , name = None , macros = None , inc_dirs = None , jobs = 1 ,
@@ -532,15 +538,28 @@ def build_project(src_paths, build_path, target, toolchain_name,
532
538
533
539
# Link Program
534
540
if toolchain .config .has_regions :
535
- res , _ = toolchain .link_program (resources , build_path , name + "_application" )
541
+ binary , _ = toolchain .link_program (resources , build_path , name + "_application" )
536
542
region_list = list (toolchain .config .regions )
537
- region_list = [r ._replace (filename = res ) if r .active else r
543
+ region_list = [r ._replace (filename = binary ) if r .active else r
538
544
for r in region_list ]
539
545
res = "%s.%s" % (join (build_path , name ),
540
546
getattr (toolchain .target , "OUTPUT_EXT" , "bin" ))
541
547
merge_region_list (region_list , res , notify )
548
+ update_regions = [
549
+ r for r in region_list if r .name in UPDATE_WHITELIST
550
+ ]
551
+ if update_regions :
552
+ update_res = "%s_update.%s" % (
553
+ join (build_path , name ),
554
+ getattr (toolchain .target , "OUTPUT_EXT" , "bin" )
555
+ )
556
+ merge_region_list (update_regions , update_res , notify )
557
+ res = (res , update_res )
558
+ else :
559
+ res = (res , None )
542
560
else :
543
561
res , _ = toolchain .link_program (resources , build_path , name )
562
+ res = (res , None )
544
563
545
564
memap_instance = getattr (toolchain , 'memap_instance' , None )
546
565
memap_table = ''
0 commit comments