|
@@ -1,14 +1,21 @@
|
|
1
|
+import os
|
1
|
2
|
from os.path import join
|
2
|
3
|
from os.path import expandvars
|
3
|
|
-Import("env", "projenv")
|
|
4
|
+Import("env")
|
4
|
5
|
|
5
|
6
|
# Relocate firmware from 0x08000000 to 0x08010000
|
6
|
|
-# for define in env['CPPDEFINES']:
|
|
7
|
+#for define in env['CPPDEFINES']:
|
7
|
8
|
# if define[0] == "VECT_TAB_ADDR":
|
8
|
9
|
# env['CPPDEFINES'].remove(define)
|
9
|
|
-#env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728))
|
10
|
10
|
#env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
|
11
|
11
|
|
|
12
|
+#custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld")
|
|
13
|
+#for i, flag in enumerate(env["LINKFLAGS"]):
|
|
14
|
+# if "-Wl,-T" in flag:
|
|
15
|
+# env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
|
|
16
|
+# elif flag == "-T":
|
|
17
|
+# env["LINKFLAGS"][i + 1] = custom_ld_script
|
|
18
|
+
|
12
|
19
|
# Custom HEX from ELF
|
13
|
20
|
env.AddPostAction(
|
14
|
21
|
join("$BUILD_DIR","${PROGNAME}.elf"),
|