Skip to content

Commit a22cd45

Browse files
committed
修复scons编译无法安全签名
1 parent 3a54357 commit a22cd45

File tree

24 files changed

+108
-103
lines changed

24 files changed

+108
-103
lines changed

projects/Edgi_Talk_M33_ADC/SConstruct

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,16 @@ else:
135135
DoBuilding(TARGET, objs)
136136

137137
# Generate HEX file
138-
DEBUG_DIR = '../Debug'
138+
DEBUG_DIR = 'build'
139139
if not os.path.exists(DEBUG_DIR):
140140
os.makedirs(DEBUG_DIR)
141141
hex_file = env.Command(DEBUG_DIR + '/rtthread.hex', TARGET, OBJCOPY + ' -O ihex $SOURCE $TARGET')
142142

143143
# Secure image packaging using edgeprotecttools (Windows only)
144144
if platform.system() == 'Windows':
145-
EDGEPROTECTTOOLS = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(SDK_ROOT))), 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
145+
# SDK_ROOT is the project directory, go up 2 levels to reach sdk-bsp root
146+
SDK_BSP_ROOT = os.path.dirname(os.path.dirname(SDK_ROOT))
147+
EDGEPROTECTTOOLS = os.path.join(SDK_BSP_ROOT, 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
146148
BOOT_CONFIG = os.path.join(SDK_ROOT, 'config', 'boot_with_extended_boot_scons.json')
147149

148150
if os.path.exists(EDGEPROTECTTOOLS) and os.path.exists(BOOT_CONFIG):

projects/Edgi_Talk_M33_ADC/config/boot_with_extended_boot_scons.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"command": "hex-relocate",
1111
"inputs": [
1212
{
13-
"file": "../Debug/rtthread.hex",
13+
"file": "rtthread.hex",
1414
"regions": [
1515
{ "start": "0x02000000", "size": "0x00080000", "dest": "0x22000000" },
1616
{ "start": "0x04000000", "size": "0x00100000", "dest": "0x24000000" },
@@ -27,7 +27,7 @@
2727
],
2828
"outputs": [
2929
{
30-
"file": "../Debug/rtthread.hex"
30+
"file": "build/rtthread.hex"
3131
}
3232
]
3333
}
@@ -44,16 +44,16 @@
4444
"inputs" :
4545
[
4646
{
47-
"file" : "../Debug/rtthread.hex"
47+
"file" : "build/rtthread.hex"
4848
},
4949
{
50-
"file" : "../../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
50+
"file" : "../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
5151
}
5252
],
5353
"outputs" :
5454
[
5555
{
56-
"file" : "../Debug/rtthread.hex",
56+
"file" : "build/rtthread.hex",
5757
"format" : "ihex",
5858
"overlap" : "ignore"
5959
}

projects/Edgi_Talk_M33_AHT20/SConstruct

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,16 @@ else:
135135
DoBuilding(TARGET, objs)
136136

137137
# Generate HEX file
138-
DEBUG_DIR = '../Debug'
138+
DEBUG_DIR = 'build'
139139
if not os.path.exists(DEBUG_DIR):
140140
os.makedirs(DEBUG_DIR)
141141
hex_file = env.Command(DEBUG_DIR + '/rtthread.hex', TARGET, OBJCOPY + ' -O ihex $SOURCE $TARGET')
142142

143143
# Secure image packaging using edgeprotecttools (Windows only)
144144
if platform.system() == 'Windows':
145-
EDGEPROTECTTOOLS = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(SDK_ROOT))), 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
145+
# SDK_ROOT is the project directory, go up 2 levels to reach sdk-bsp root
146+
SDK_BSP_ROOT = os.path.dirname(os.path.dirname(SDK_ROOT))
147+
EDGEPROTECTTOOLS = os.path.join(SDK_BSP_ROOT, 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
146148
BOOT_CONFIG = os.path.join(SDK_ROOT, 'config', 'boot_with_extended_boot_scons.json')
147149

148150
if os.path.exists(EDGEPROTECTTOOLS) and os.path.exists(BOOT_CONFIG):

projects/Edgi_Talk_M33_AHT20/config/boot_with_extended_boot_scons.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"command": "hex-relocate",
1111
"inputs": [
1212
{
13-
"file": "../Debug/rtthread.hex",
13+
"file": "rtthread.hex",
1414
"regions": [
1515
{ "start": "0x02000000", "size": "0x00080000", "dest": "0x22000000" },
1616
{ "start": "0x04000000", "size": "0x00100000", "dest": "0x24000000" },
@@ -27,7 +27,7 @@
2727
],
2828
"outputs": [
2929
{
30-
"file": "../Debug/rtthread.hex"
30+
"file": "build/rtthread.hex"
3131
}
3232
]
3333
}
@@ -44,16 +44,16 @@
4444
"inputs" :
4545
[
4646
{
47-
"file" : "../Debug/rtthread.hex"
47+
"file" : "build/rtthread.hex"
4848
},
4949
{
50-
"file" : "../../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
50+
"file" : "../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
5151
}
5252
],
5353
"outputs" :
5454
[
5555
{
56-
"file" : "../Debug/rtthread.hex",
56+
"file" : "build/rtthread.hex",
5757
"format" : "ihex",
5858
"overlap" : "ignore"
5959
}

projects/Edgi_Talk_M33_Audio/SConstruct

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,16 @@ else:
135135
DoBuilding(TARGET, objs)
136136

137137
# Generate HEX file
138-
DEBUG_DIR = '../Debug'
138+
DEBUG_DIR = 'build'
139139
if not os.path.exists(DEBUG_DIR):
140140
os.makedirs(DEBUG_DIR)
141141
hex_file = env.Command(DEBUG_DIR + '/rtthread.hex', TARGET, OBJCOPY + ' -O ihex $SOURCE $TARGET')
142142

143143
# Secure image packaging using edgeprotecttools (Windows only)
144144
if platform.system() == 'Windows':
145-
EDGEPROTECTTOOLS = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(SDK_ROOT))), 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
145+
# SDK_ROOT is the project directory, go up 2 levels to reach sdk-bsp root
146+
SDK_BSP_ROOT = os.path.dirname(os.path.dirname(SDK_ROOT))
147+
EDGEPROTECTTOOLS = os.path.join(SDK_BSP_ROOT, 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
146148
BOOT_CONFIG = os.path.join(SDK_ROOT, 'config', 'boot_with_extended_boot_scons.json')
147149

148150
if os.path.exists(EDGEPROTECTTOOLS) and os.path.exists(BOOT_CONFIG):

projects/Edgi_Talk_M33_Audio/config/boot_with_extended_boot_scons.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"command": "hex-relocate",
1111
"inputs": [
1212
{
13-
"file": "../Debug/rtthread.hex",
13+
"file": "rtthread.hex",
1414
"regions": [
1515
{ "start": "0x02000000", "size": "0x00080000", "dest": "0x22000000" },
1616
{ "start": "0x04000000", "size": "0x00100000", "dest": "0x24000000" },
@@ -27,7 +27,7 @@
2727
],
2828
"outputs": [
2929
{
30-
"file": "../Debug/rtthread.hex"
30+
"file": "build/rtthread.hex"
3131
}
3232
]
3333
}
@@ -44,16 +44,16 @@
4444
"inputs" :
4545
[
4646
{
47-
"file" : "../Debug/rtthread.hex"
47+
"file" : "build/rtthread.hex"
4848
},
4949
{
50-
"file" : "../../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
50+
"file" : "../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
5151
}
5252
],
5353
"outputs" :
5454
[
5555
{
56-
"file" : "../Debug/rtthread.hex",
56+
"file" : "build/rtthread.hex",
5757
"format" : "ihex",
5858
"overlap" : "ignore"
5959
}

projects/Edgi_Talk_M33_Blink_LED/SConstruct

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,16 @@ else:
135135
DoBuilding(TARGET, objs)
136136

137137
# Generate HEX file
138-
DEBUG_DIR = '../Debug'
138+
DEBUG_DIR = 'build'
139139
if not os.path.exists(DEBUG_DIR):
140140
os.makedirs(DEBUG_DIR)
141141
hex_file = env.Command(DEBUG_DIR + '/rtthread.hex', TARGET, OBJCOPY + ' -O ihex $SOURCE $TARGET')
142142

143143
# Secure image packaging using edgeprotecttools (Windows only)
144144
if platform.system() == 'Windows':
145-
EDGEPROTECTTOOLS = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(SDK_ROOT))), 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
145+
# SDK_ROOT is the project directory, go up 2 levels to reach sdk-bsp root
146+
SDK_BSP_ROOT = os.path.dirname(os.path.dirname(SDK_ROOT))
147+
EDGEPROTECTTOOLS = os.path.join(SDK_BSP_ROOT, 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
146148
BOOT_CONFIG = os.path.join(SDK_ROOT, 'config', 'boot_with_extended_boot_scons.json')
147149

148150
if os.path.exists(EDGEPROTECTTOOLS) and os.path.exists(BOOT_CONFIG):

projects/Edgi_Talk_M33_Blink_LED/config/boot_with_extended_boot_scons.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"command": "hex-relocate",
1111
"inputs": [
1212
{
13-
"file": "../Debug/rtthread.hex",
13+
"file": "rtthread.hex",
1414
"regions": [
1515
{ "start": "0x02000000", "size": "0x00080000", "dest": "0x22000000" },
1616
{ "start": "0x04000000", "size": "0x00100000", "dest": "0x24000000" },
@@ -27,7 +27,7 @@
2727
],
2828
"outputs": [
2929
{
30-
"file": "../Debug/rtthread.hex"
30+
"file": "build/rtthread.hex"
3131
}
3232
]
3333
}
@@ -44,16 +44,16 @@
4444
"inputs" :
4545
[
4646
{
47-
"file" : "../Debug/rtthread.hex"
47+
"file" : "build/rtthread.hex"
4848
},
4949
{
50-
"file" : "../../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
50+
"file" : "../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
5151
}
5252
],
5353
"outputs" :
5454
[
5555
{
56-
"file" : "../Debug/rtthread.hex",
56+
"file" : "build/rtthread.hex",
5757
"format" : "ihex",
5858
"overlap" : "ignore"
5959
}

projects/Edgi_Talk_M33_CDC_Echo/SConstruct

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,6 @@ if rtconfig.PLATFORM in ['iccarm']:
3939

4040
Export('RTT_ROOT')
4141
Export('rtconfig')
42-
Export('env')
43-
44-
# Resolve path to shared BSP sources so we can add the generated headers once.
45-
if os.path.exists(os.path.join(os.getcwd(), "libs")):
46-
libs_source = 'libs'
47-
else:
48-
libs_source = '../libs'
49-
50-
libs_root = os.path.abspath(os.path.join(os.getcwd(), libs_source))
51-
libs_bsp_dir = os.path.join(libs_root, 'TARGET_APP_KIT_PSE84_EVAL_EPC2')
52-
53-
if os.path.isdir(libs_bsp_dir):
54-
env.AppendUnique(CPPPATH=[
55-
libs_bsp_dir,
56-
os.path.join(libs_bsp_dir, 'config'),
57-
os.path.join(libs_bsp_dir, 'config', 'GeneratedSource'),
58-
os.path.join(libs_bsp_dir, 'bluetooth'),
59-
])
6042

6143
SDK_ROOT = os.path.abspath('./')
6244
if os.path.exists(SDK_ROOT + '/libraries/components'):
@@ -127,7 +109,6 @@ if os.path.exists(os.path.join(os.getcwd(), "libraries")):
127109
objs.extend(SConscript('libraries/components/serial-memory/SConscript', variant_dir='build/libraries/components/serial-memory', duplicate=0))
128110
objs.extend(SConscript('libraries/components/Infineon_retarget-io-latest/SConscript', variant_dir='build/libraries/components/Infineon_retarget-io-latest', duplicate=0))
129111
objs.extend(SConscript('libraries/components/ASRC/SConscript', variant_dir='build/libraries/components/ASRC', duplicate=0))
130-
objs.extend(SConscript('libraries/components/emusb-device/SConscript', variant_dir='build/libraries/components/emusb-device', duplicate=0))
131112
objs.extend(SConscript('libraries/components/SConscript', variant_dir='build/libraries/components', duplicate=0))
132113
objs.extend(SConscript('libraries/components/mtb-srf/SConscript', variant_dir='build/libraries/components/mtb-srf', duplicate=0))
133114
objs.extend(SConscript('libraries/components/mtb-ipc/SConscript', variant_dir='build/libraries/components/mtb-ipc', duplicate=0))
@@ -155,14 +136,16 @@ else:
155136
DoBuilding(TARGET, objs)
156137

157138
# Generate HEX file
158-
DEBUG_DIR = '../Debug'
139+
DEBUG_DIR = 'build'
159140
if not os.path.exists(DEBUG_DIR):
160141
os.makedirs(DEBUG_DIR)
161142
hex_file = env.Command(DEBUG_DIR + '/rtthread.hex', TARGET, OBJCOPY + ' -O ihex $SOURCE $TARGET')
162143

163144
# Secure image packaging using edgeprotecttools (Windows only)
164145
if platform.system() == 'Windows':
165-
EDGEPROTECTTOOLS = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(SDK_ROOT))), 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
146+
# SDK_ROOT is the project directory, go up 2 levels to reach sdk-bsp root
147+
SDK_BSP_ROOT = os.path.dirname(os.path.dirname(SDK_ROOT))
148+
EDGEPROTECTTOOLS = os.path.join(SDK_BSP_ROOT, 'tools', 'edgeprotecttools', 'bin', 'edgeprotecttools.exe')
166149
BOOT_CONFIG = os.path.join(SDK_ROOT, 'config', 'boot_with_extended_boot_scons.json')
167150

168151
if os.path.exists(EDGEPROTECTTOOLS) and os.path.exists(BOOT_CONFIG):

projects/Edgi_Talk_M33_CDC_Echo/config/boot_with_extended_boot_scons.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"command": "hex-relocate",
1111
"inputs": [
1212
{
13-
"file": "../Debug/rtthread.hex",
13+
"file": "rtthread.hex",
1414
"regions": [
1515
{ "start": "0x02000000", "size": "0x00080000", "dest": "0x22000000" },
1616
{ "start": "0x04000000", "size": "0x00100000", "dest": "0x24000000" },
@@ -27,7 +27,7 @@
2727
],
2828
"outputs": [
2929
{
30-
"file": "../Debug/rtthread.hex"
30+
"file": "build/rtthread.hex"
3131
}
3232
]
3333
}
@@ -44,16 +44,16 @@
4444
"inputs" :
4545
[
4646
{
47-
"file" : "../Debug/rtthread.hex"
47+
"file" : "build/rtthread.hex"
4848
},
4949
{
50-
"file" : "../../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
50+
"file" : "../../tools/edgeprotecttools/cm33_s_signed_fw/proj_cm33_s_signed.hex"
5151
}
5252
],
5353
"outputs" :
5454
[
5555
{
56-
"file" : "../Debug/rtthread.hex",
56+
"file" : "build/rtthread.hex",
5757
"format" : "ihex",
5858
"overlap" : "ignore"
5959
}

0 commit comments

Comments
 (0)