@@ -39,24 +39,6 @@ if rtconfig.PLATFORM in ['iccarm']:
3939
4040Export ('RTT_ROOT' )
4141Export ('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
6143SDK_ROOT = os .path .abspath ('./' )
6244if 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:
155136DoBuilding (TARGET , objs )
156137
157138# Generate HEX file
158- DEBUG_DIR = '../Debug '
139+ DEBUG_DIR = 'build '
159140if not os .path .exists (DEBUG_DIR ):
160141 os .makedirs (DEBUG_DIR )
161142hex_file = env .Command (DEBUG_DIR + '/rtthread.hex' , TARGET , OBJCOPY + ' -O ihex $SOURCE $TARGET' )
162143
163144# Secure image packaging using edgeprotecttools (Windows only)
164145if 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 ):
0 commit comments