@@ -58,6 +58,8 @@ def main(pack_path: str, xml_path: str):
5858 if not os .path .isabs (pack_path ):
5959 pack_path = os .path .abspath (pack_path )
6060
61+ jlink_root_dir = os .path .dirname (xml_path )
62+
6163 print ('-> Use cmsis package : ' + pack_path )
6264 print ('-> Use jlink database: ' + xml_path )
6365
@@ -80,8 +82,6 @@ def main(pack_path: str, xml_path: str):
8082 xml_path , parser = ElementTree .XMLParser (target = CommentedTreeBuilder ()))
8183 xml_dom_db = xml_dom .getroot ()
8284
83- flm_dump_dir = os .path .dirname (xml_path ) + '/Devices'
84-
8585 vendor_existed_devs = []
8686 for node in xml_dom .iter ():
8787 if node .tag != 'Device' :
@@ -136,7 +136,7 @@ def main(pack_path: str, xml_path: str):
136136 if rom .is_boot_memory :
137137 name = '{} (Internal Flash)' .format (rom .name )
138138 algo_src_repath = flm_ele .attrib ['name' ]
139- algo_dst_repath = '{}/{}/{}' .format (
139+ algo_dst_repath = 'Devices/ {}/{}/{}' .format (
140140 vendor_name , family_name , os .path .basename (algo_src_repath ))
141141 n_ele_fbi .attrib .update ({
142142 'Name' : name ,
@@ -145,7 +145,7 @@ def main(pack_path: str, xml_path: str):
145145 'Loader' : algo_dst_repath ,
146146 'LoaderType' : 'FLASH_ALGO_TYPE_OPEN' })
147147 bin_data = cmsis_pack .get_file (algo_src_repath )
148- dst_path = flm_dump_dir + '/' + algo_dst_repath
148+ dst_path = jlink_root_dir + '/' + algo_dst_repath
149149 Path (os .path .dirname (dst_path )).mkdir (
150150 parents = True , exist_ok = True )
151151 print ('dump FLM: ' + dst_path )
0 commit comments