23
23
24
24
SCRIPT_DIR = dirname (abspath (__file__ ))
25
25
MBED_OS_ROOT = abspath (path_join (SCRIPT_DIR , os .pardir , os .pardir ))
26
- MUSCA_B1_BASE = path_join (MBED_OS_ROOT , 'targets' , 'TARGET_ARM_SSG' , 'TARGET_MUSCA_B1' )
27
26
28
- def musca_tfm_bin (t_self , non_secure_bin , secure_bin ):
27
+ def musca_tfm_bin (t_self , non_secure_bin , secure_bin , target_name ):
29
28
29
+ MUSCA_BASE = path_join (MBED_OS_ROOT , 'targets' , 'TARGET_ARM_SSG' , ('TARGET_' + target_name ))
30
30
assert os .path .isfile (secure_bin )
31
31
assert os .path .isfile (non_secure_bin )
32
32
33
33
build_dir = dirname (non_secure_bin )
34
34
tempdir = path_join (build_dir , 'temp' )
35
35
if not isdir (tempdir ):
36
36
os .makedirs (tempdir )
37
- flash_layout = path_join (MUSCA_B1_BASE , 'partition' , 'flash_layout.h' )
38
- mcuboot_bin = path_join (MUSCA_B1_BASE , 'bl2.bin' )
39
- image_macros_s = path_join (MUSCA_B1_BASE , 'partition' , 'signing_layout_s.c' )
40
- image_macros_ns = path_join (MUSCA_B1_BASE , 'partition' , 'signing_layout_ns.c' )
37
+ flash_layout = path_join (MUSCA_BASE , 'partition' , 'flash_layout.h' )
38
+ mcuboot_bin = path_join (MUSCA_BASE , 'bl2.bin' )
39
+ image_macros_s = path_join (MUSCA_BASE , 'partition' , 'signing_layout_s.c' )
40
+ image_macros_ns = path_join (MUSCA_BASE , 'partition' , 'signing_layout_ns.c' )
41
41
s_bin_name , s_bin_ext = splitext (basename (secure_bin ))
42
42
s_signed_bin = abspath (path_join (tempdir , s_bin_name + '_signed' + s_bin_ext ))
43
43
ns_bin_name , ns_bin_ext = splitext (basename (non_secure_bin ))
@@ -54,7 +54,7 @@ def musca_tfm_bin(t_self, non_secure_bin, secure_bin):
54
54
"-v" ,
55
55
'1.2.0' ,
56
56
"-k" ,
57
- path_join (SCRIPT_DIR , 'musca_b1 -root-rsa-3072.pem' ),
57
+ path_join (SCRIPT_DIR , ( target_name . lower () + ' -root-rsa-3072.pem') ),
58
58
"--layout" ,
59
59
image_macros_s ,
60
60
"--public-key-format" ,
@@ -83,7 +83,7 @@ def musca_tfm_bin(t_self, non_secure_bin, secure_bin):
83
83
"-v" ,
84
84
'1.2.0' ,
85
85
"-k" ,
86
- path_join (SCRIPT_DIR , 'musca_b1 -root-rsa-3072_1.pem' ),
86
+ path_join (SCRIPT_DIR , ( target_name . lower () + ' -root-rsa-3072_1.pem') ),
87
87
"--layout" ,
88
88
image_macros_ns ,
89
89
"--public-key-format" ,
0 commit comments