Skip to content

Commit b43056c

Browse files
Avoid issues w/other installed Windows Pythons (earlephilhower#253)
When a Python MSI/etc. is installed under Windows, it sets a global PYTHONHOME and other variables. Our shipped Python can end up using these variables and attempt to load the wrong PYC files and fail to run. Avoid by using -I isolated mode in Python calls Fixes earlephilhower#252
1 parent e4c1448 commit b43056c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

platform.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ build.usbstack_flags=
8787
build.boot2=boot2_generic_03h_4_padded_checksum
8888

8989
# Allow Pico boards do be auto-discovered by the IDE
90-
discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/discovery.py"
90+
discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" -I "{runtime.platform.path}/tools/discovery.py"
9191

9292

9393
# Compile patterns
@@ -108,7 +108,7 @@ archive_file_path={build.path}/{archive_file}
108108
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
109109

110110
## Generate the linker map with specific flash sizes/locations
111-
recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/simplesub.py" --input "{runtime.platform.path}/lib/memmap_default.ld" --out "{build.path}/memmap_default.ld" --sub __FLASH_LENGTH__ {build.flash_length} --sub __EEPROM_START__ {build.eeprom_start} --sub __FS_START__ {build.fs_start} --sub __FS_END__ {build.fs_end} --sub __RAM_LENGTH__ {build.ram_length}
111+
recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3" -I "{runtime.platform.path}/tools/simplesub.py" --input "{runtime.platform.path}/lib/memmap_default.ld" --out "{build.path}/memmap_default.ld" --sub __FLASH_LENGTH__ {build.flash_length} --sub __EEPROM_START__ {build.eeprom_start} --sub __FS_START__ {build.fs_start} --sub __FS_END__ {build.fs_end} --sub __RAM_LENGTH__ {build.ram_length}
112112

113113
## Compile the boot stage 2 blob
114114
recipe.hooks.linking.prelink.2.pattern="{compiler.path}{compiler.S.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -c "{runtime.platform.path}/boot2/{build.boot2}.S" "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" -o "{build.path}/boot2.o"
@@ -139,7 +139,7 @@ tools.uf2conv.cmd={runtime.platform.path}/system/python3/python3
139139
tools.uf2conv.upload.protocol=uf2
140140
tools.uf2conv.upload.params.verbose=
141141
tools.uf2conv.upload.params.quiet=
142-
tools.uf2conv.upload.pattern="{cmd}" "{runtime.platform.path}/tools/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
142+
tools.uf2conv.upload.pattern="{cmd}" -I "{runtime.platform.path}/tools/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
143143

144144

145145
#tools.picoprobe.cmd={runtime.tools.pqt-openocd.path}

0 commit comments

Comments
 (0)