Skip to content

Commit f79b231

Browse files
committed
Add generator options for RPi
1 parent 8184c44 commit f79b231

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

generate.py

+21-2
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,14 @@ def create_project(
175175

176176
@time_me
177177
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+
178181
print(f"Generating VS Code project files on {target_os} for MaximSDK located at {maxim_path}...")
179182
print(f"Scanning {maxim_path}...")
180183

181184
# Check for cache file
182-
cachefile = Path(__file__).parent.joinpath(".cache").joinpath("msdk")
185+
cachefile = Path(maxim_path).joinpath(".cache").joinpath("msdk")
183186

184187
if (cachefile.exists()):
185188
print("Loading from cache file...")
@@ -222,6 +225,18 @@ def populate_maximsdk(target_os, maxim_path, overwrite=True):
222225
# Linux OpenOCD .cfg files are case senstive. Need to hard-code a lowercase value.
223226
_m4_ocd_target_file = f"{str.lower(example.target.name)}.cfg" if target_os == "Linux" else defaults["M4_OCD_TARGET_FILE"]
224227

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+
225240
create_project(
226241
_path,
227242
_target,
@@ -230,7 +245,11 @@ def populate_maximsdk(target_os, maxim_path, overwrite=True):
230245
symbol_file=_symbol_file,
231246
i_paths=_ipaths,
232247
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
234253
)
235254

236255
count += 1

0 commit comments

Comments
 (0)