Browse Source

Update FYSETC STM32F103 ldscript and script (#18179)

George Fu 5 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
 MEMORY
5
 MEMORY
6
 {
6
 {
7
 	ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
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
 /* Provide memory region aliases for common.inc */
11
 /* Provide memory region aliases for common.inc */

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

1
+import os
1
 from os.path import join
2
 from os.path import join
2
 from os.path import expandvars
3
 from os.path import expandvars
3
-Import("env", "projenv")
4
+Import("env")
4
 
5
 
5
 # Relocate firmware from 0x08000000 to 0x08010000
6
 # Relocate firmware from 0x08000000 to 0x08010000
6
-# for define in env['CPPDEFINES']:
7
+#for define in env['CPPDEFINES']:
7
 #    if define[0] == "VECT_TAB_ADDR":
8
 #    if define[0] == "VECT_TAB_ADDR":
8
 #        env['CPPDEFINES'].remove(define)
9
 #        env['CPPDEFINES'].remove(define)
9
-#env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728))
10
 #env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
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
 # Custom HEX from ELF
19
 # Custom HEX from ELF
13
 env.AddPostAction(
20
 env.AddPostAction(
14
 	join("$BUILD_DIR","${PROGNAME}.elf"),
21
 	join("$BUILD_DIR","${PROGNAME}.elf"),

Loading…
Cancel
Save