Skip to content

Commit 3556130

Browse files
committed
builder: Fix build failure
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent f39b643 commit 3556130

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

builder/framework/siwiduino.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def gen_bin_file(target, source, env):
7878
remove(temp_firm)
7979

8080
def gen_fota_file(target, source, env):
81-
if env.BoardConfig.get("build.mcu") == "MT2625":
81+
if env.BoardConfig().get("build.mcu") == "MT2625":
8282
print("Use http://dfota.quectel.com:8081/ to Generate FOTA Patch file")
8383
return
8484

builder/framework/siwisdk.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MIT
44
#
55

6-
from os.path import isdir, isfile, join, dirname
6+
from os.path import abspath, isdir, isfile, join, dirname, getsize
77
from os import remove
88
from shutil import copyfile
99
from hashlib import md5
@@ -41,7 +41,7 @@ def gen_bin_file(target, source, env):
4141
(target_firm, ) = target
4242
(target_elf, ) = source
4343

44-
temp_firm = os.path.dirname(target_firm.get_abspath()) + "/temp.bin"
44+
temp_firm = dirname(target_firm.get_abspath()) + "/temp.bin"
4545
cmd.extend(["-O", "binary"])
4646
cmd.append(target_elf.get_abspath())
4747
cmd.append(temp_firm)
@@ -57,7 +57,7 @@ def gen_bin_file(target, source, env):
5757
0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
5858
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5959
])
60-
firm_size = (os.path.getsize(temp_firm) + 64).to_bytes(4, "little")
60+
firm_size = (getsize(temp_firm) + 64).to_bytes(4, "little")
6161
GFH_Header[0x20:0x23] = firm_size[0:3]
6262

6363
with open(target_firm.get_abspath(), "wb") as out_firm:
@@ -74,7 +74,7 @@ def gen_bin_file(target, source, env):
7474
remove(temp_firm)
7575

7676
def gen_fota_file(target, source, env):
77-
if env.BoardConfig.get("build.mcu") == "MT2625":
77+
if env.BoardConfig().get("build.mcu") == "MT2625":
7878
print("Use http://dfota.quectel.com:8081/ to Generate FOTA Patch file")
7979
return
8080

@@ -94,7 +94,7 @@ def gen_fota_file(target, source, env):
9494
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
9595
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00
9696
])
97-
firm_size = os.path.getsize(firm_bin.get_abspath()).to_bytes(4, "little")
97+
firm_size = getsize(firm_bin.get_abspath()).to_bytes(4, "little")
9898
FOTA_Header[0x1c:0x1f] = firm_size[0:3]
9999
crc = fota_crc16(FOTA_Header, len(FOTA_Header) - 4).to_bytes(4, "little")
100100
FOTA_Header[0x4c:0x4f] = crc[0:3]

0 commit comments

Comments
 (0)