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

Commit 8ef971e

Browse files
committed
Merge branch 'release/v1.4.0'
2 parents 9547acb + ffc269a commit 8ef971e

File tree

21 files changed

+404
-383
lines changed

21 files changed

+404
-383
lines changed

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
os: [ubuntu-16.04, windows-latest, macos-latest]
10+
os: [ubuntu-18.04, windows-latest, macos-latest]
1111
python-version: [3.7]
1212
example:
1313
- "examples/arduino-adc"

boards/cubecell_board_pro.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"lorawan": {
5+
"class": "CLASS_B"
6+
}
7+
},
8+
"core": "asr6601",
9+
"cpu": "cortex-m4",
10+
"extra_flags": "-DCubeCell_BoardPRO",
11+
"f_cpu": "48000000L",
12+
"mcu": "asr6601",
13+
"variant": "CubeCell-Board-PRO"
14+
},
15+
"frameworks": [
16+
"arduino"
17+
],
18+
"name": "Heltec CubeCell-Board PRO (HTCC-AB03)",
19+
"upload": {
20+
"maximum_ram_size": 229376,
21+
"maximum_size": 229376,
22+
"protocol": "serial",
23+
"require_upload_port": true
24+
},
25+
"url": "https://heltec.org/proudct_center",
26+
"vendor": "Heltec"
27+
}

boards/cubecell_capsule_solar_sensor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cpu": "cortex-m0plus",
55
"extra_flags": "-DCubeCell_Capsule",
66
"f_cpu": "48000000L",
7-
"mcu": "asr6502",
7+
"mcu": "asr6051",
88
"variant": "CubeCell-Capsule"
99
},
1010
"frameworks": [

builder/frameworks/arduino.py

Lines changed: 114 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,28 @@
3131
platform = env.PioPlatform()
3232
board = env.BoardConfig()
3333
core = board.get("build.core")
34+
mcu = board.get("build.mcu", "")
35+
is_asr6601 = mcu.startswith("asr6601")
36+
arch = "asr6601" if is_asr6601 else "asr650x"
3437

35-
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoasrmicro650x")
38+
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoasrmicro")
39+
CORE_DIR = os.path.join(FRAMEWORK_DIR, "cores", core)
3640
assert os.path.isdir(FRAMEWORK_DIR)
3741

3842
env.Append(
3943
CPPDEFINES=[
40-
("ARDUINO", 10813),
41-
"ARDUINO_ARCH_ASR650X",
42-
"__%s__" % board.get("build.mcu").upper(),
43-
"__asr650x__",
44+
("ARDUINO", 10815),
45+
"ARDUINO_ARCH_%s" % arch.upper(),
46+
"__%s__" % mcu.upper(),
47+
"__%s__" % arch,
4448
("CONFIG_MANUFACTURER", '\\"ASR\\"'),
45-
("CONFIG_DEVICE_MODEL", '\\"6501\\"'),
49+
("CONFIG_DEVICE_MODEL", '\\"%s\\"' % mcu),
4650
("CONFIG_VERSION", '\\"v4.0\\"'),
4751
("CY_CORE_ID", 0),
4852
"CONFIG_LORA_USE_TCXO",
4953
("F_CPU", "$BOARD_F_CPU"),
5054
"SOFT_SE",
5155
],
52-
5356
CCFLAGS=[
5457
"-w",
5558
"-Wall",
@@ -68,12 +71,10 @@
6871
"-fno-builtin-snprintf",
6972
"-Wno-strict-aliasing",
7073
],
71-
7274
CXXFLAGS=[
7375
"-fno-exceptions",
7476
"-fno-rtti",
7577
],
76-
7778
LINKFLAGS=[
7879
"-Os",
7980
"-Wl,--gc-sections",
@@ -85,53 +86,74 @@
8586
"-mthumb",
8687
"-mthumb-interwork",
8788
"-specs=nano.specs",
88-
"-ffat-lto-objects"
89-
],
90-
91-
CPPPATH=[
92-
os.path.join(FRAMEWORK_DIR, "cores", core),
93-
os.path.join(FRAMEWORK_DIR, "cores", core, "board"),
94-
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "src"),
95-
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "inc"),
96-
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "sx126x"),
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"),
101-
os.path.join(FRAMEWORK_DIR, "cores", core, "port"),
102-
os.path.join(FRAMEWORK_DIR, "cores", core, "port", "include"),
103-
os.path.join(FRAMEWORK_DIR, "cores", core, "projects"),
104-
os.path.join(FRAMEWORK_DIR, "cores", core, "projects", "PSoC4"),
105-
os.path.join(FRAMEWORK_DIR, "cores", core, "cores"),
106-
os.path.join(FRAMEWORK_DIR, "cores", core, "Serial"),
107-
os.path.join(FRAMEWORK_DIR, "cores", core, "Wire"),
108-
os.path.join(FRAMEWORK_DIR, "cores", core, "SPI"),
109-
],
110-
111-
LIBS=[
112-
"stdc++",
113-
"m"
89+
"-specs=nosys.specs",
90+
"-ffat-lto-objects",
11491
],
115-
116-
LIBSOURCE_DIRS=[
117-
os.path.join(FRAMEWORK_DIR, "libraries")
118-
]
92+
LIBS=["stdc++", "m"],
93+
LIBSOURCE_DIRS=[os.path.join(FRAMEWORK_DIR, "libraries")],
11994
)
12095

12196
env.Prepend(
12297
ASFLAGS=env.get("CCFLAGS", [])[:],
123-
_LIBFLAGS='"%s" ' % os.path.join(
124-
FRAMEWORK_DIR, "cores", core, "projects", "CubeCellLib.a")
98+
_LIBFLAGS='"%s" '
99+
% (
100+
os.path.join(CORE_DIR, "asr6601.a")
101+
if is_asr6601
102+
else os.path.join(CORE_DIR, "projects", "CubeCellLib.a")
103+
),
125104
)
126105

106+
if is_asr6601:
107+
env.Append(
108+
CPPPATH=[
109+
CORE_DIR,
110+
os.path.join(CORE_DIR, "drivers", "peripheral", "inc"),
111+
os.path.join(CORE_DIR, "drivers", "crypto", "inc"),
112+
os.path.join(CORE_DIR, "platform", "CMSIS"),
113+
os.path.join(CORE_DIR, "platform", "system"),
114+
os.path.join(CORE_DIR, "lora", "driver"),
115+
os.path.join(CORE_DIR, "lora", "radio"),
116+
os.path.join(CORE_DIR, "lora"),
117+
os.path.join(CORE_DIR, "lora", "radio", "sx126x"),
118+
os.path.join(CORE_DIR, "lora", "system"),
119+
os.path.join(CORE_DIR, "lora", "system", "crypto"),
120+
os.path.join(CORE_DIR, "base"),
121+
os.path.join(CORE_DIR, "peripheral"),
122+
],
123+
)
124+
else:
125+
env.Append(
126+
CPPPATH=[
127+
CORE_DIR,
128+
os.path.join(CORE_DIR, "board"),
129+
os.path.join(CORE_DIR, "board", "src"),
130+
os.path.join(CORE_DIR, "board", "inc"),
131+
os.path.join(CORE_DIR, "device", "sx126x"),
132+
os.path.join(CORE_DIR, "lora"),
133+
os.path.join(CORE_DIR, "lora", "system"),
134+
os.path.join(CORE_DIR, "lora", "system", "crypto"),
135+
os.path.join(CORE_DIR, "port"),
136+
os.path.join(CORE_DIR, "port", "include"),
137+
os.path.join(CORE_DIR, "projects"),
138+
os.path.join(CORE_DIR, "projects", "PSoC4"),
139+
os.path.join(CORE_DIR, "cores"),
140+
os.path.join(CORE_DIR, "Serial"),
141+
os.path.join(CORE_DIR, "Wire"),
142+
os.path.join(CORE_DIR, "SPI"),
143+
],
144+
)
145+
146+
127147
if not board.get("build.ldscript", ""):
128148
env.Append(
129149
LIBPATH=[
130-
os.path.join(FRAMEWORK_DIR, "cores", core, "projects", "PSoC4"),
150+
CORE_DIR if is_asr6601 else os.path.join(CORE_DIR, "projects", "PSoC4"),
131151
]
132152
)
133153
env.Replace(
134-
LDSCRIPT_PATH=board.get("build.arduino.ldscript", "cm0plusgcc.ld")
154+
LDSCRIPT_PATH=board.get(
155+
"build.arduino.ldscript", "gcc.ld" if is_asr6601 else "cm0plusgcc.ld"
156+
)
135157
)
136158

137159
#
@@ -147,19 +169,32 @@
147169
"REGION_%s" % region,
148170
("ACTIVE_REGION", "LORAMAC_REGION_%s" % region),
149171
("LORAWAN_CLASS", lorawan_config.get("class", "CLASS_A")),
150-
("LORAWAN_NETMODE", "true" if lorawan_config.get(
151-
"netmode", "OTAA") == "OTAA" else "false"),
172+
(
173+
"LORAWAN_NETMODE",
174+
"true" if lorawan_config.get("netmode", "OTAA") == "OTAA" else "false",
175+
),
152176
("LORAWAN_ADR", "true" if lorawan_config.get("adr", "ON") == "ON" else "false"),
153-
("LORAWAN_UPLINKMODE", "true" if lorawan_config.get(
154-
"uplinkmode", "CONFIRMED") == "CONFIRMED" else "false"),
155-
("LORAWAN_NET_RESERVE", "true" if lorawan_config.get(
156-
"net_reserve", "OFF") == "ON" else "false"),
177+
(
178+
"LORAWAN_UPLINKMODE",
179+
"true"
180+
if lorawan_config.get("uplinkmode", "CONFIRMED") == "CONFIRMED"
181+
else "false",
182+
),
183+
(
184+
"LORAWAN_NET_RESERVE",
185+
"true" if lorawan_config.get("net_reserve", "OFF") == "ON" else "false",
186+
),
157187
("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),
159-
("LoraWan_RGB", 1 if lorawan_config.get(
160-
"rgb", "ACTIVE") == "ACTIVE" else 0),
161-
("LoRaWAN_DEBUG_LEVEL", 2 if debug_level == "FREQ_AND_DIO" else (
162-
1 if debug_level == "FREQ" else 0))
188+
(
189+
"LORAWAN_DEVEUI_AUTO",
190+
0 if lorawan_config.get("deveui", "CUSTOM") == "CUSTOM" else 1,
191+
),
192+
("LoraWan_RGB", 1 if lorawan_config.get("rgb", "ACTIVE") == "ACTIVE" else 0),
193+
("LORAWAN_PREAMBLE_LENGTH", lorawan_config.get("preamble_length", 8)),
194+
(
195+
"LoRaWAN_DEBUG_LEVEL",
196+
2 if debug_level == "FREQ_AND_DIO" else (1 if debug_level == "FREQ" else 0),
197+
),
163198
]
164199
)
165200

@@ -169,28 +204,31 @@
169204

170205
libs = []
171206

172-
if "build.variant" in env.BoardConfig():
173-
variants_dir = os.path.join(
174-
"$PROJECT_DIR", board.get("build.variants_dir")) if board.get(
175-
"build.variants_dir", "") else os.path.join(FRAMEWORK_DIR, "variants")
176-
env.Append(
177-
CPPPATH=[
178-
os.path.join(variants_dir, board.get("build.variant"))
179-
]
207+
if "build.variant" in board:
208+
variants_dir = (
209+
os.path.join("$PROJECT_DIR", board.get("build.variants_dir"))
210+
if board.get("build.variants_dir", "")
211+
else os.path.join(FRAMEWORK_DIR, "variants")
180212
)
181-
libs.append(env.BuildLibrary(
182-
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
183-
os.path.join(variants_dir, board.get("build.variant"))
184-
))
185-
186-
libs.append(env.BuildLibrary(
187-
os.path.join("$BUILD_DIR", "FrameworkArduino"),
188-
os.path.join(FRAMEWORK_DIR, "cores", core),
189-
src_filter=[
190-
"+<*>",
191-
"-<projects/PSoC4/CyBootAsmIar.s>",
192-
"-<projects/PSoC4/CyBootAsmRv.s>"
193-
]
194-
))
213+
env.Append(CPPPATH=[os.path.join(variants_dir, board.get("build.variant"))])
214+
libs.append(
215+
env.BuildLibrary(
216+
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
217+
os.path.join(variants_dir, board.get("build.variant")),
218+
)
219+
)
220+
221+
libs.append(
222+
env.BuildLibrary(
223+
os.path.join("$BUILD_DIR", "FrameworkArduino"),
224+
CORE_DIR,
225+
# Only applicable to ASR6501
226+
src_filter=[
227+
"+<*>",
228+
"-<projects/PSoC4/CyBootAsmIar.s>",
229+
"-<projects/PSoC4/CyBootAsmRv.s>",
230+
],
231+
)
232+
)
195233

196234
env.Prepend(LIBS=libs)

0 commit comments

Comments
 (0)