@@ -919,7 +919,7 @@ def generate_empty_partition_image(binary_path, image_size):
919919 env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , empty_partition )
920920
921921
922- def get_partition_info (pt_path , pt_offset , pt_params ):
922+ def get_partition_info (pt_path , pt_params ):
923923 if not os .path .isfile (pt_path ):
924924 sys .stderr .write (
925925 "Missing partition table file `%s`\n " % os .path .basename (pt_path )
@@ -930,8 +930,6 @@ def get_partition_info(pt_path, pt_offset, pt_params):
930930 env .subst ("$PYTHONEXE" ),
931931 os .path .join (FRAMEWORK_DIR , "components" , "partition_table" , "parttool.py" ),
932932 "-q" ,
933- "--partition-table-offset" ,
934- hex (pt_offset ),
935933 "--partition-table-file" ,
936934 pt_path ,
937935 "get_partition_info" ,
@@ -940,8 +938,13 @@ def get_partition_info(pt_path, pt_offset, pt_params):
940938 "offset" ,
941939 ]
942940
943- if pt_params ["name" ] == "boot" :
944- cmd .append ("--partition-boot-default" )
941+ if pt_params ["name" ]:
942+ if pt_params ["name" ] == "*boot" :
943+ cmd .append ("--partition-boot-default" )
944+ else :
945+ cmd .extend ([
946+ "--partition-name" , pt_params ["name" ]
947+ ])
945948 else :
946949 cmd .extend (
947950 [
@@ -955,8 +958,8 @@ def get_partition_info(pt_path, pt_offset, pt_params):
955958 result = exec_command (cmd )
956959 if result ["returncode" ] != 0 :
957960 sys .stderr .write (
958- "Couldn't extract information for %s/%s from the partition table \n "
959- % (pt_params [ "type" ], pt_params [ "subtype" ] )
961+ "Couldn't extract information for {%s} from %s \n "
962+ % (pt_params , pt_path )
960963 )
961964 sys .stderr .write (result ["out" ] + "\n " )
962965 sys .stderr .write (result ["err" ] + "\n " )
@@ -969,12 +972,6 @@ def get_partition_info(pt_path, pt_offset, pt_params):
969972 return {"size" : size , "offset" : offset }
970973
971974
972- def get_app_partition_offset (pt_table , pt_offset ):
973- # Get the default boot partition offset
974- app_params = get_partition_info (pt_table , pt_offset , {"name" : "boot" })
975- return app_params .get ("offset" , "0x10000" )
976-
977-
978975def install_python_deps ():
979976 def _get_installed_pip_packages ():
980977 result = {}
@@ -1285,8 +1282,7 @@ def _skip_prj_source_files(node):
12851282env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , partition_table )
12861283
12871284# linker needs APP_OFFSE and APP_SIZE
1288- partition_table_offset = sdk_config .get ("PARTITION_TABLE_OFFSET" , 0x8000 )
1289- app_params = get_partition_info (env .subst ("$PARTITIONS_TABLE_CSV" ), partition_table_offset , {"name" : "boot" })
1285+ app_params = get_partition_info (env .subst ("$PARTITIONS_TABLE_CSV" ), {"name" : "*boot" })
12901286app_offset = app_params .get ("offset" )
12911287app_size = app_params .get ("size" )
12921288env .Replace (
@@ -1356,7 +1352,6 @@ def _skip_prj_source_files(node):
13561352
13571353ota_partition_params = get_partition_info (
13581354 env .subst ("$PARTITIONS_TABLE_CSV" ),
1359- partition_table_offset ,
13601355 {"name" : "ota" , "type" : "data" , "subtype" : "ota" },
13611356)
13621357
0 commit comments