@@ -175,11 +175,14 @@ def create_project(
175
175
176
176
@time_me
177
177
def populate_maximsdk (target_os , maxim_path , overwrite = True ):
178
+ # Copy readme into template directory
179
+ shutil .copy ("readme.md" , str (Path ("MaximSDK/Template/.vscode" )))
180
+
178
181
print (f"Generating VS Code project files on { target_os } for MaximSDK located at { maxim_path } ..." )
179
182
print (f"Scanning { maxim_path } ..." )
180
183
181
184
# Check for cache file
182
- cachefile = Path (__file__ ). parent .joinpath (".cache" ).joinpath ("msdk" )
185
+ cachefile = Path (maxim_path ) .joinpath (".cache" ).joinpath ("msdk" )
183
186
184
187
if (cachefile .exists ()):
185
188
print ("Loading from cache file..." )
@@ -222,6 +225,18 @@ def populate_maximsdk(target_os, maxim_path, overwrite=True):
222
225
# Linux OpenOCD .cfg files are case senstive. Need to hard-code a lowercase value.
223
226
_m4_ocd_target_file = f"{ str .lower (example .target .name )} .cfg" if target_os == "Linux" else defaults ["M4_OCD_TARGET_FILE" ]
224
227
228
+ # RPi Tools
229
+ if target_os == "RPi" :
230
+ _arm_gcc_path = "${config:MAXIM_PATH}/Tools/GNUTools/gcc-arm-none-eabi/${config:v_Arm_GCC}"
231
+ _xpack_gcc_path = "${config:MAXIM_PATH}/Tools/xPack/riscv-none-embed-gcc/${config:v_xPack_GCC}"
232
+ _v_arm_gcc = "10.3.1"
233
+ _v_xpack_gcc = "10.2.0-1.2"
234
+ else :
235
+ _arm_gcc_path = defaults ["ARM_GCC_PATH" ]
236
+ _xpack_gcc_path = defaults ["XPACK_GCC_PATH" ]
237
+ _v_arm_gcc = defaults ["V_ARM_GCC" ]
238
+ _v_xpack_gcc = defaults ["V_XPACK_GCC" ]
239
+
225
240
create_project (
226
241
_path ,
227
242
_target ,
@@ -230,7 +245,11 @@ def populate_maximsdk(target_os, maxim_path, overwrite=True):
230
245
symbol_file = _symbol_file ,
231
246
i_paths = _ipaths ,
232
247
v_paths = _vpaths ,
233
- m4_ocd_target_file = _m4_ocd_target_file
248
+ m4_ocd_target_file = _m4_ocd_target_file ,
249
+ arm_gcc_path = _arm_gcc_path ,
250
+ xpack_gcc_path = _xpack_gcc_path ,
251
+ v_arm_gcc = _v_arm_gcc ,
252
+ v_xpack_gcc = _v_xpack_gcc
234
253
)
235
254
236
255
count += 1
0 commit comments