Переглянути джерело

Comment, clean up some PlatformIO scripts

Scott Lahteine 3 роки тому
джерело
коміт
832059967c

+ 3
- 3
buildroot/share/PlatformIO/ldscripts/lerdge.ld Переглянути файл

@@ -40,9 +40,9 @@ _Min_Stack_Size = 0x400;; /* required amount of stack */
40 40
 /* Specify the memory areas */
41 41
 MEMORY
42 42
 {
43
-FLASH (rx)      : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
44
-RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
45
-CCMRAM (rw)      : ORIGIN = 0x10000000, LENGTH = 64K
43
+FLASH (rx)  : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
44
+RAM (xrw)   : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
45
+CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
46 46
 }
47 47
 
48 48
 /* Define output sections */

+ 4
- 3
buildroot/share/PlatformIO/scripts/openblt.py Переглянути файл

@@ -1,5 +1,6 @@
1
-# Generate the firmware as OpenBLT needs
2
-
1
+#
2
+# Convert the ELF to an SREC file suitable for some bootloaders
3
+#
3 4
 import os,sys
4 5
 from os.path import join
5 6
 
@@ -10,5 +11,5 @@ env.AddPostAction(
10 11
     env.VerboseAction(" ".join([
11 12
         "$OBJCOPY", "-O", "srec",
12 13
         "\"$BUILD_DIR/${PROGNAME}.elf\"", "\"$BUILD_DIR/${PROGNAME}.srec\""
13
-    ]), "Building " + join("$BUILD_DIR","${PROGNAME}.srec"))
14
+    ]), "Building " + join("$BUILD_DIR", "${PROGNAME}.srec"))
14 15
 )

+ 13
- 1
buildroot/share/PlatformIO/scripts/stm32_bootloader.py Переглянути файл

@@ -7,18 +7,28 @@ Import("env")
7 7
 from SCons.Script import DefaultEnvironment
8 8
 board = DefaultEnvironment().BoardConfig()
9 9
 
10
+#
11
+# Copy the firmware.bin file to build.firmware, no encryption
12
+#
10 13
 def noencrypt(source, target, env):
11 14
   firmware = os.path.join(target[0].dir.path, board.get("build.firmware"))
12 15
   shutil.copy(target[0].path, firmware)
13 16
 
17
+#
18
+# For build.offset define LD_FLASH_OFFSET, used by ldscript.ld
19
+#
14 20
 if 'offset' in board.get("build").keys():
15 21
   LD_FLASH_OFFSET = board.get("build.offset")
16 22
 
23
+  # Remove an existing VECT_TAB_OFFSET from CPPDEFINES
17 24
   for define in env['CPPDEFINES']:
18 25
     if define[0] == "VECT_TAB_OFFSET":
19 26
       env['CPPDEFINES'].remove(define)
27
+
28
+  # Replace VECT_TAB_OFFSET with our LD_FLASH_OFFSET
20 29
   env['CPPDEFINES'].append(("VECT_TAB_OFFSET", LD_FLASH_OFFSET))
21 30
 
31
+  # Get upload.maximum_ram_size (defined by /buildroot/share/PlatformIO/boards/VARIOUS.json)
22 32
   maximum_ram_size = board.get("upload.maximum_ram_size")
23 33
 
24 34
   for i, flag in enumerate(env["LINKFLAGS"]):
@@ -27,7 +37,9 @@ if 'offset' in board.get("build").keys():
27 37
     if "-Wl,--defsym=LD_MAX_DATA_SIZE" in flag:
28 38
       env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40)
29 39
 
40
+#
41
+# Only copy the file if there's no encrypt
42
+#
30 43
 board_keys = board.get("build").keys()
31
-# Only copy file if there's no encryptation
32 44
 if 'firmware' in board_keys and not 'encrypt' in board_keys:
33 45
   env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt)

+ 3
- 3
buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/ldscript.ld Переглянути файл

@@ -58,9 +58,9 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
58 58
 /* Specify the memory areas */
59 59
 MEMORY
60 60
 {
61
-RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
62
-CCMRAM (rw)      : ORIGIN = 0x10000000, LENGTH = 64K
63
-FLASH (rx)     : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
61
+RAM (xrw)   : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
62
+CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
63
+FLASH (rx)  : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
64 64
 }
65 65
 
66 66
 /* Define output sections */

Завантаження…
Відмінити
Зберегти