Browse Source

Update FYSETC STM32F103 ldscript and script (#18179)

George Fu 4 years ago
parent
commit
8477dbf65d
No account linked to committer's email address

buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld → buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld View File

@@ -5,7 +5,7 @@
5 5
 MEMORY
6 6
 {
7 7
 	ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
8
-	rom (rx)  : ORIGIN = 0x08010000, LENGTH = 256K - 40K - 4K
8
+	rom (rx)  : ORIGIN = 0x08010000, LENGTH = 256K - 64K
9 9
 }
10 10
 
11 11
 /* Provide memory region aliases for common.inc */

+ 10
- 3
buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py View File

@@ -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"),

Loading…
Cancel
Save