Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 213ccad

Browse files
committed
Update build script according to the latest changes in Arduino core
1 parent 277b596 commit 213ccad

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

builder/frameworks/arduino.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@
3838
env.Append(
3939
CPPDEFINES=[
4040
("ARDUINO", 10813),
41-
"__ASR6501__",
41+
"ARDUINO_ARCH_ASR650X",
42+
"__%s__" % board.get("build.mcu").upper(),
43+
"__asr650x__",
4244
("CONFIG_MANUFACTURER", '\\"ASR\\"'),
4345
("CONFIG_DEVICE_MODEL", '\\"6501\\"'),
4446
("CONFIG_VERSION", '\\"v4.0\\"'),
4547
("CY_CORE_ID", 0),
46-
"CONFIG_LORA_USE_TCXO"
48+
"CONFIG_LORA_USE_TCXO",
49+
("F_CPU", "$BOARD_F_CPU"),
50+
"SOFT_SE",
4751
],
4852

4953
CCFLAGS=[
@@ -55,6 +59,7 @@
5559
"-mthumb-interwork",
5660
"-mapcs-frame",
5761
"-ffunction-sections",
62+
"-fdata-sections",
5863
"-ffat-lto-objects",
5964
"-fno-common",
6065
"-fno-builtin-printf",
@@ -77,7 +82,6 @@
7782
"-Wl,--wrap=fflush",
7883
"-Wl,--wrap=sprintf",
7984
"-Wl,--wrap=snprintf",
80-
"-Wl,-Map,pio.map",
8185
"-mthumb",
8286
"-mthumb-interwork",
8387
"-specs=nano.specs",
@@ -89,12 +93,11 @@
8993
os.path.join(FRAMEWORK_DIR, "cores", core, "board"),
9094
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "src"),
9195
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "inc"),
92-
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "asr6501_lrwan"),
9396
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "sx126x"),
94-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "mac"),
95-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "mac", "region"),
96-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "system"),
97-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "system", "crypto"),
97+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora"),
98+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "radio"),
99+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "system"),
100+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "system", "crypto"),
98101
os.path.join(FRAMEWORK_DIR, "cores", core, "port"),
99102
os.path.join(FRAMEWORK_DIR, "cores", core, "port", "include"),
100103
os.path.join(FRAMEWORK_DIR, "cores", core, "projects"),
@@ -136,7 +139,7 @@
136139
#
137140

138141
lorawan_config = board.get("build.arduino.lorawan", {})
139-
region = lorawan_config.get("region", "AS923")
142+
region = lorawan_config.get("region", "US915")
140143
debug_level = lorawan_config.get("debug_level", "NONE")
141144

142145
env.Append(
@@ -152,6 +155,7 @@
152155
("LORAWAN_NET_RESERVE", "true" if lorawan_config.get(
153156
"net_reserve", "OFF") == "ON" else "false"),
154157
("AT_SUPPORT", 1 if lorawan_config.get("at_support", "ON") == "ON" else 0),
158+
("LORAWAN_DEVEUI_AUTO", 0 if lorawan_config.get("deveui", "CUSTOM") == "CUSTOM" else 1),
155159
("LoraWan_RGB", 1 if lorawan_config.get(
156160
"rgb", "ACTIVE") == "ACTIVE" else 0),
157161
("LoRaWAN_DEBUG_LEVEL", 2 if debug_level == "FREQ_AND_DIO" else (
@@ -181,11 +185,11 @@
181185

182186
libs.append(env.BuildLibrary(
183187
os.path.join("$BUILD_DIR", "FrameworkArduino"),
184-
os.path.join(FRAMEWORK_DIR, "cores"),
188+
os.path.join(FRAMEWORK_DIR, "cores", core),
185189
src_filter=[
186190
"+<*>",
187-
"-<%s/projects/PSoC4/CyBootAsmIar.s>" % core,
188-
"-<%s/projects/PSoC4/CyBootAsmRv.s>" % core
191+
"-<projects/PSoC4/CyBootAsmIar.s>",
192+
"-<projects/PSoC4/CyBootAsmRv.s>"
189193
]
190194
))
191195

0 commit comments

Comments
 (0)