Skip to content

Commit d3b1912

Browse files
committed
Merge branch 'release/v0.0.2'
2 parents 72f5aa3 + d98349c commit d3b1912

File tree

6 files changed

+41
-47
lines changed

6 files changed

+41
-47
lines changed

boards/uno_r4_minima.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"ldscript": "fsp.ld"
55
},
66
"extra_flags": [
7+
"-DARDUINO_MINIMA",
78
"-DARDUINO_UNOR4_MINIMA",
8-
"-DLWIP_DNS=1",
99
"-DCFG_TUSB_MCU=OPT_MCU_RAXXX"
1010
],
1111
"core": "arduino",

boards/uno_r4_wifi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"ldscript": "fsp.ld"
55
},
66
"extra_flags": [
7+
"-DARDUINO_UNOWIFIR4",
78
"-DARDUINO_UNOR4_WIFI",
89
"-DNO_USB",
910
"-DBACKTRACE_SUPPORT",

builder/frameworks/arduino.py

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
from SCons.Script import DefaultEnvironment
2727

28+
from platformio import fs
29+
2830
env = DefaultEnvironment()
2931
platform = env.PioPlatform()
3032
board = env.BoardConfig()
@@ -56,7 +58,7 @@ def load_flags(filename):
5658
ccflags = cflags.intersection(cxxflags)
5759

5860
env.Append(
59-
ASFLAGS=[f for f in ccflags if isinstance(f, str) and f.startswith("-m")],
61+
ASFLAGS=[f for f in sorted(ccflags) if isinstance(f, str) and f.startswith("-m")],
6062

6163
ASPPFLAGS=["-x", "assembler-with-cpp"],
6264

@@ -77,7 +79,10 @@ def load_flags(filename):
7779
"-mcpu=%s" % board.get("build.cpu"),
7880
"-mthumb",
7981
"-Wl,--gc-sections",
80-
"--specs=nosys.specs"
82+
"--specs=nano.specs",
83+
"--specs=nosys.specs",
84+
"-nostdlib",
85+
'-Wl,-Map="%s"' % os.path.join("${BUILD_DIR}", "${PROGNAME}.map")
8186
],
8287

8388
LIBSOURCE_DIRS=[os.path.join(FRAMEWORK_DIR, "libraries")],
@@ -86,12 +91,26 @@ def load_flags(filename):
8691
)
8792

8893
env.Append(
94+
ASFLAGS=[
95+
"-Os",
96+
"-fsigned-char",
97+
"-ffunction-sections",
98+
"-fdata-sections"
99+
],
100+
101+
CFLAGS=[
102+
"-std=gnu11"
103+
],
104+
89105
# Due to long path names "-iprefix" hook is required to avoid toolchain crashes
90106
CCFLAGS=[
91-
"-iprefix" + FRAMEWORK_DIR,
92-
"@%s" % os.path.join(FRAMEWORK_DIR, "variants", board.get(
93-
"build.variant"), "includes.txt"),
94-
"-w"
107+
"-Os",
108+
# Remove the 'to_unix_path' call when PIO Core v6.1.10 is released
109+
"-iprefix" + fs.to_unix_path(FRAMEWORK_DIR),
110+
"@%s" % fs.to_unix_path(os.path.join(FRAMEWORK_DIR, "variants", board.get(
111+
"build.variant"), "includes.txt")),
112+
"-w",
113+
"-fno-builtin"
95114
],
96115

97116
CPPDEFINES=[
@@ -102,6 +121,13 @@ def load_flags(filename):
102121
("F_CPU", "$BOARD_F_CPU")
103122
],
104123

124+
CXXFLAGS=[
125+
"-std=gnu++17",
126+
"-fno-rtti",
127+
"-fno-exceptions",
128+
"-fno-use-cxa-atexit"
129+
],
130+
105131
CPPPATH=[
106132
os.path.join(FRAMEWORK_DIR, "cores", board.get("build.core"), "tinyusb"),
107133
os.path.join(FRAMEWORK_DIR, "cores", board.get("build.core")),
@@ -121,14 +147,6 @@ def load_flags(filename):
121147
fpv_version = "5"
122148

123149
env.Append(
124-
ASFLAGS=[
125-
"-mfloat-abi=hard",
126-
"-mfpu=fpv%s-d16" % fpv_version
127-
],
128-
CCFLAGS=[
129-
"-mfloat-abi=hard",
130-
"-mfpu=fpv%s-d16" % fpv_version
131-
],
132150
LINKFLAGS=[
133151
"-mfloat-abi=hard",
134152
"-mfpu=fpv%s-d16" % fpv_version

builder/main.py

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys
1616
from platform import system
1717
from os import makedirs
18-
from os.path import isdir, join
18+
from os.path import basename, isdir, join
1919

2020
from platformio.public import list_serial_ports
2121

@@ -147,44 +147,19 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
147147

148148
# default tool for all boards with embedded DFU bootloader over USB
149149
_upload_tool = '"%s"' % join(
150-
platform.get_package_dir("tool-dfuutil") or "", "bin", "dfu-util"
150+
platform.get_package_dir("tool-dfuutil-arduino") or "", "dfu-util"
151151
)
152152
_upload_flags = [
153153
"-d",
154154
",".join(["%s:%s" % (hwid[0], hwid[1]) for hwid in hwids]),
155155
"-a",
156156
"0",
157-
"-s",
158-
"%s:leave" % board.get("upload.offset_address", "0x08000000"),
159-
"-D",
157+
"-Q",
158+
"-D"
160159
]
161160

162161
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
163162

164-
if "dfu-util" in _upload_tool:
165-
# Add special DFU header to the binary image
166-
env.AddPostAction(
167-
join("$BUILD_DIR", "${PROGNAME}.bin"),
168-
env.VerboseAction(
169-
" ".join(
170-
[
171-
'"%s"'
172-
% join(
173-
platform.get_package_dir("tool-dfuutil") or "",
174-
"bin",
175-
"dfu-suffix",
176-
),
177-
"-v %s" % vid,
178-
"-p %s" % pid,
179-
"-d 0xffff",
180-
"-a",
181-
"$TARGET",
182-
]
183-
),
184-
"Adding dfu suffix to ${PROGNAME}.bin",
185-
),
186-
)
187-
188163
env.Replace(
189164
UPLOADER=_upload_tool,
190165
UPLOADERFLAGS=_upload_flags,

platform.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"type": "git",
2222
"url": "https://github.com/platformio/platform-renesas-ra.git"
2323
},
24-
"version": "0.0.1",
24+
"version": "0.0.2",
2525
"frameworks": {
2626
"arduino": {
2727
"package": "framework-arduinorenesas-uno",
@@ -46,7 +46,7 @@
4646
"owner": "platformio",
4747
"version": "~1.0.1"
4848
},
49-
"tool-dfuutil": {
49+
"tool-dfuutil-arduino": {
5050
"type": "uploader",
5151
"optional": true,
5252
"owner": "platformio",

platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _configure_uploader_packages(package_name, interface_name):
4444
for package, interface in (
4545
("tool-jlink", "jlink"),
4646
("tool-openocd", "cmsis-dap"),
47-
("tool-dfuutil", "dfu"),
47+
("tool-dfuutil-arduino", "dfu"),
4848
("tool-bossac", "sam-ba"),
4949
):
5050
_configure_uploader_packages(package, interface)

0 commit comments

Comments
 (0)