Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
0c22150f
Unverified
Commit
0c22150f
authored
Sep 26, 2021
by
Mike Lynch
Committed by
GitHub
Sep 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add compiler Optimize option (#322)
parent
423476dc
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
482 additions
and
4 deletions
+482
-4
boards.txt
boards.txt
+469
-0
platform.txt
platform.txt
+5
-4
tools/makeboards.py
tools/makeboards.py
+8
-0
No files found.
boards.txt
View file @
0c22150f
This diff is collapsed.
Click to expand it.
platform.txt
View file @
0c22150f
...
@@ -40,7 +40,7 @@ compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualif
...
@@ -40,7 +40,7 @@ compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualif
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt"
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt"
compiler.flags=-
Os -
march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections -fno-exceptions
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections -fno-exceptions
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
compiler.libpico="{runtime.platform.path}/lib/libpico.a"
compiler.libpico="{runtime.platform.path}/lib/libpico.a"
compiler.libstdcpp="-lstdc++"
compiler.libstdcpp="-lstdc++"
...
@@ -48,7 +48,7 @@ compiler.libstdcpp="-lstdc++"
...
@@ -48,7 +48,7 @@ compiler.libstdcpp="-lstdc++"
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} {compiler.includes} -std=gnu17 -g
compiler.c.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} {compiler.includes} -std=gnu17 -g
compiler.c.elf.cmd=arm-none-eabi-g++
compiler.c.elf.cmd=arm-none-eabi-g++
compiler.c.elf.flags={compiler.warning_flags} {compiler.defines} {compiler.flags} -u _printf_float -u _scanf_float
compiler.c.elf.flags={compiler.warning_flags} {compiler.defines} {compiler.flags}
{build.flags.optimize}
-u _printf_float -u _scanf_float
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-c {compiler.warning_flags} -g -x assembler-with-cpp -MMD {compiler.includes} -g
compiler.S.flags=-c {compiler.warning_flags} -g -x assembler-with-cpp -MMD {compiler.includes} -g
compiler.cpp.cmd=arm-none-eabi-g++
compiler.cpp.cmd=arm-none-eabi-g++
...
@@ -80,6 +80,7 @@ compiler.elf2hex.extra_flags=
...
@@ -80,6 +80,7 @@ compiler.elf2hex.extra_flags=
# Board configuration, set in boards.txt. Present here to ensure substitution works
# Board configuration, set in boards.txt. Present here to ensure substitution works
build.flash_length=
build.flash_length=
build.eeprom_start=
build.eeprom_start=
build.flags.optimize=
build.fs_start=
build.fs_start=
build.fs_end=
build.fs_end=
build.usbstack_flags=
build.usbstack_flags=
...
@@ -94,10 +95,10 @@ discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" -I "{runtime
...
@@ -94,10 +95,10 @@ discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" -I "{runtime
# ----------------
# ----------------
## Compile c files
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {
build.flags.optimize} {
includes} "{source_file}" -o "{object_file}"
## Compile c++ files
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {
build.flags.optimize} {
includes} "{source_file}" -o "{object_file}"
## Compile S files
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DBOARD_NAME="{build.board}" -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
...
...
tools/makeboards.py
View file @
0c22150f
...
@@ -36,6 +36,12 @@ def BuildFreq(name):
...
@@ -36,6 +36,12 @@ def BuildFreq(name):
print
(
"%s.menu.freq.%s=%s MHz%s"
%
(
name
,
f
,
f
,
warn
))
print
(
"%s.menu.freq.%s=%s MHz%s"
%
(
name
,
f
,
f
,
warn
))
print
(
"%s.menu.freq.%s.build.f_cpu=%dL"
%
(
name
,
f
,
f
*
1000000
))
print
(
"%s.menu.freq.%s.build.f_cpu=%dL"
%
(
name
,
f
,
f
*
1000000
))
def
BuildOptimize
(
name
):
for
l
in
[
(
"Small"
,
"Small"
,
"-Os"
,
"(standard)"
),
(
"Optimize"
,
"Optimize"
,
"-O"
,
""
),
(
"Optimize2"
,
"Optimize More"
,
"-O2"
,
""
),
(
"Optimize3"
,
"Optimize Even More"
,
"-O3"
,
""
),
(
"Fast"
,
"Fast"
,
"-Ofast"
,
"(maybe slower)"
),
(
"Debug"
,
"Debug"
,
"-Og"
,
""
)
]:
print
(
"%s.menu.opt.%s=%s (%s) %s"
%
(
name
,
l
[
0
],
l
[
1
],
l
[
2
],
l
[
3
]))
print
(
"%s.menu.opt.%s.build.flags.optimize=%s"
%
(
name
,
l
[
0
],
l
[
2
]))
def
BuildBoot
(
name
):
def
BuildBoot
(
name
):
for
l
in
[
(
"Generic SPI /2"
,
"boot2_generic_03h_2_padded_checksum"
),
(
"Generic SPI /4"
,
"boot2_generic_03h_4_padded_checksum"
),
for
l
in
[
(
"Generic SPI /2"
,
"boot2_generic_03h_2_padded_checksum"
),
(
"Generic SPI /4"
,
"boot2_generic_03h_4_padded_checksum"
),
(
"IS25LP080 QSPI /2"
,
"boot2_is25lp080_2_padded_checksum"
),
(
"IS25LP080 QSPI /4"
,
"boot2_is25lp080_4_padded_checksum"
),
(
"IS25LP080 QSPI /2"
,
"boot2_is25lp080_2_padded_checksum"
),
(
"IS25LP080 QSPI /4"
,
"boot2_is25lp080_4_padded_checksum"
),
...
@@ -90,6 +96,7 @@ def BuildGlobalMenuList():
...
@@ -90,6 +96,7 @@ def BuildGlobalMenuList():
print
(
"menu.BoardModel=Model"
)
print
(
"menu.BoardModel=Model"
)
print
(
"menu.flash=Flash Size"
)
print
(
"menu.flash=Flash Size"
)
print
(
"menu.freq=CPU Speed"
)
print
(
"menu.freq=CPU Speed"
)
print
(
"menu.opt=Optimize"
)
print
(
"menu.dbgport=Debug Port"
)
print
(
"menu.dbgport=Debug Port"
)
print
(
"menu.dbglvl=Debug Level"
)
print
(
"menu.dbglvl=Debug Level"
)
print
(
"menu.boot2=Boot Stage 2"
)
print
(
"menu.boot2=Boot Stage 2"
)
...
@@ -122,6 +129,7 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, boarddefine, flashsizem
...
@@ -122,6 +129,7 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, boarddefine, flashsizem
else
:
else
:
BuildFlashMenu
(
n
,
flashsizemb
*
1024
*
1024
,
fssizelist
)
BuildFlashMenu
(
n
,
flashsizemb
*
1024
*
1024
,
fssizelist
)
BuildFreq
(
n
)
BuildFreq
(
n
)
BuildOptimize
(
n
)
BuildDebugPort
(
n
)
BuildDebugPort
(
n
)
BuildDebugLevel
(
n
)
BuildDebugLevel
(
n
)
if
a
==
"picodebug"
:
if
a
==
"picodebug"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment