@@ -45,6 +45,11 @@ def gen_bin_file(target, source, env):
45
45
(target_firm , ) = target
46
46
(target_elf , ) = source
47
47
48
+ flash_addr = {
49
+ "bc20" : [0x00 , 0x40 , 0x2D , 0x08 ],
50
+ "6261" : [0x00 , 0x00 , 0x2E , 0x10 ],
51
+ }
52
+
48
53
temp_firm = dirname (target_firm .get_abspath ()) + "/temp.bin"
49
54
cmd .extend (["-O" , "binary" ])
50
55
cmd .append (target_elf .get_abspath ())
@@ -67,8 +72,8 @@ def gen_bin_file(target, source, env):
67
72
with open (target_firm .get_abspath (), "wb" ) as out_firm :
68
73
with open (temp_firm , "rb" ) as in_firm :
69
74
buf = in_firm .read ()
70
- if env .BoardConfig ().get ("build.mcu" ) == "MT2625" :
71
- GFH_Header [ 0x1C : 0x20 ] = [ 0x00 , 0x40 , 0x2D , 0x80 ]
75
+ GFH_Header [ 0x1C : 0x20 ] = flash_addr . get ( env .BoardConfig ().get (
76
+ "build.variant" ), flash_addr [ '6261' ])
72
77
crc32 = zlib .crc32 (buf ).to_bytes (4 , "little" )
73
78
GFH_Header [0x3C :] = crc32
74
79
out_firm .write (GFH_Header )
@@ -79,7 +84,7 @@ def gen_bin_file(target, source, env):
79
84
80
85
def gen_fota_file (target , source , env ):
81
86
if env .BoardConfig ().get ("build.mcu" ) == "MT2625" :
82
- print ("Use http://dfota.quectel.com:8081/ to Generate FOTA Patch file" )
87
+ print ("\n Use http://dfota.quectel.com:8081/ to Generate FOTA Patch file\n " )
83
88
return
84
89
85
90
(fota_firm , ) = target
0 commit comments