|
@@ -1,7 +1,7 @@
|
1
|
1
|
Import("env")
|
2
|
2
|
|
3
|
3
|
# Relocate firmware from 0x08000000 to 0x0800A000
|
4
|
|
-env['CPPDEFINES'].remove(("VECT_TAB_ADDR", "0x8000000"))
|
|
4
|
+env['CPPDEFINES'].remove(("VECT_TAB_ADDR", "0x8000000"))
|
5
|
5
|
#alternatively, for STSTM <=5.1.0 use line below
|
6
|
6
|
#env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728))
|
7
|
7
|
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x0800A000"))
|
|
@@ -9,7 +9,7 @@ env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/jgaurora_a5s_a1.
|
9
|
9
|
|
10
|
10
|
#append ${PROGNAME}.bin firmware after bootloader and save it as 'jgaurora_firmware.bin'
|
11
|
11
|
def addboot(source,target,env):
|
12
|
|
- import os
|
|
12
|
+ import os
|
13
|
13
|
|
14
|
14
|
firmware = open(target[0].path, "rb")
|
15
|
15
|
lengthfirmware = os.path.getsize(target[0].path)
|
|
@@ -29,7 +29,7 @@ def addboot(source,target,env):
|
29
|
29
|
while position < lengthfirmware:
|
30
|
30
|
byte = firmware.read(1)
|
31
|
31
|
firmwareimage.write(byte)
|
32
|
|
- position += 1
|
|
32
|
+ position += 1
|
33
|
33
|
bootloader.close()
|
34
|
34
|
firmware.close()
|
35
|
35
|
firmwareimage.close()
|
|
@@ -37,7 +37,7 @@ def addboot(source,target,env):
|
37
|
37
|
if os.path.exists(firmware_without_bootloader_dir):
|
38
|
38
|
os.remove(firmware_without_bootloader_dir)
|
39
|
39
|
os.rename(target[0].path, firmware_without_bootloader_dir)
|
40
|
|
- #os.rename(target[0].dir.path+'/firmware_with_bootloader.bin', target[0].dir.path+'/firmware.bin')
|
|
40
|
+ #os.rename(target[0].dir.path+'/firmware_with_bootloader.bin', target[0].dir.path+'/firmware.bin')
|
41
|
41
|
|
42
|
42
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", addboot);
|
43
|
43
|
|