Skip to content

Commit 8a3f816

Browse files
committed
builder: Add changes for NBIoT SIWI flash tool
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 3208003 commit 8a3f816

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

builder/main.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
board = env.BoardConfig()
1818
flasher_path = platform.get_package_dir("tool-siwiflasher") or ""
1919

20+
def _get_board_mcu():
21+
return board.get("build.mcu")
22+
2023
env.Replace(
24+
__get_board_mcu=_get_board_mcu,
25+
2126
AR="arm-none-eabi-ar",
2227
AS="arm-none-eabi-as",
2328
CC="arm-none-eabi-gcc",
@@ -38,7 +43,7 @@
3843
)
3944

4045
# Setup tools based on system type
41-
if "windows" in get_systype():
46+
if "windows" in get_systype() and board.get("build.mcu") != "MT2625":
4247
env.Replace(
4348
SIWIFLASHER=join(flasher_path, "siwiflasher"),
4449
REFLASH_FLAGS=[
@@ -113,7 +118,14 @@
113118
upload_source = target_firm
114119
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
115120

116-
if "windows" in get_systype() and env.subst("$UPLOAD_PORT") == "":
121+
if "windows" not in get_systype() or board.get("build.mcu") == "MT2625":
122+
env.Append(
123+
UPLOADERFLAGS=[
124+
"-m", '"${__get_board_mcu()}"',
125+
]
126+
)
127+
128+
if "windows" in get_systype() and board.get("build.mcu") != "MT2625" and env.subst("$UPLOAD_PORT") == "":
117129
env.Append(
118130
UPLOADERFLAGS=[
119131
"-u"

0 commit comments

Comments
 (0)