Adjust directories for cleaner use w/Arduino

/system is only downloaded tools
/tools is all scripts/submodules that are part of the main core
/lib is the linker libs
This commit is contained in:
Earle F. Philhower, III 2021-03-17 08:33:51 -07:00
parent 22d242d34a
commit c892443b5b
8 changed files with 12 additions and 8 deletions

2
.gitmodules vendored
View file

@ -5,5 +5,5 @@
path = pico-sdk
url = https://github.com/raspberrypi/pico-sdk.git
[submodule "system/pyserial"]
path = system/pyserial
path = tools/pyserial
url = https://github.com/pyserial/pyserial.git

View file

@ -78,7 +78,7 @@ compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=
discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/system/discovery.py"
discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/discovery.py"
# USB Flags
# ---------
@ -106,7 +106,7 @@ archive_file_path={build.path}/{archive_file}
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-Wl,--script={build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {runtime.platform.path}/system/libs/pico.a -lm -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/ -I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include {runtime.platform.path}/assembly/bs2_default_padded_checksummed.S
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-Wl,--script={build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {runtime.platform.path}/lib/pico.a -lm -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/ -I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include {runtime.platform.path}/assembly/bs2_default_padded_checksummed.S
## Create output (UF2 file)
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
@ -133,6 +133,6 @@ tools.uf2conv.upload.protocol=uf2
tools.uf2conv.upload.params.verbose=
tools.uf2conv.upload.params.quiet=
tools.uf2conv.upload.pattern="{cmd}" "{runtime.platform.path}/system/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
tools.uf2conv.upload.network_pattern="{cmd}" "{runtime.platform.path}/system/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
tools.uf2conv.upload.pattern="{cmd}" "{runtime.platform.path}/tools/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
tools.uf2conv.upload.network_pattern="{cmd}" "{runtime.platform.path}/tools/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"

1
system/placeholder Normal file
View file

@ -0,0 +1 @@
placeholder

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
# This script will download and extract required tools into the current directory.
# Tools list is obtained from package/package_esp8266com_index.template.json file.
# Written by Ivan Grokhotkov, 2015.
# This script will download and extract required tools into the system directory.
# Originally written by Ivan Grokhotkov, 2015.
#
from __future__ import print_function
import os
@ -49,14 +48,17 @@ def report_progress(count, blockSize, totalSize):
sys.stdout.flush()
def unpack(filename, destination):
here = os.getcwd()
dirname = ''
print('Extracting {0}'.format(filename))
if filename.endswith('tar.gz'):
tfile = tarfile.open(filename, 'r:gz')
os.chdir("../system/")
tfile.extractall(destination)
dirname= tfile.getnames()[0]
elif filename.endswith('zip'):
zfile = zipfile.ZipFile(filename)
os.chdir("../system/")
zfile.extractall(destination)
dirname = zfile.namelist()[0]
else:
@ -69,6 +71,7 @@ def unpack(filename, destination):
if os.path.isdir(rename_to):
shutil.rmtree(rename_to)
shutil.move(dirname, rename_to)
os.chdir(here)
def get_tool(tool):
archive_name = tool['archiveFileName']