Procházet zdrojové kódy

🔨 Clean up build scripts (#22264)

* Add 10K to marlin_blackSTM32F407VET6 (typo?)
* Document custom build scripts.
* Add a Robin common build script.
* Extraneous .ldscript specifiers
Scott Lahteine před 3 roky
rodič
revize
b90de62197
No account linked to committer's email address

+ 1
- 1
buildroot/share/PlatformIO/boards/marlin_blackSTM32F407VET6.json Zobrazit soubor

@@ -48,7 +48,7 @@
48 48
   "upload": {
49 49
     "disable_flushing": false,
50 50
     "maximum_ram_size": 131072,
51
-    "maximum_size": 514288,
51
+    "maximum_size": 524288,
52 52
     "protocol": "stlink",
53 53
     "protocols": [
54 54
       "stlink",

+ 3
- 0
buildroot/share/PlatformIO/scripts/custom_board.py Zobrazit soubor

@@ -1,6 +1,9 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/custom_board.py
3 3
 #
4
+# - For build.address replace VECT_TAB_ADDR to relocate the firmware
5
+# - For build.ldscript use one of the linker scripts in buildroot/share/PlatformIO/ldscripts
6
+#
4 7
 import marlin
5 8
 board = marlin.env.BoardConfig()
6 9
 

+ 0
- 8
buildroot/share/PlatformIO/scripts/marlin.py Zobrazit soubor

@@ -67,11 +67,3 @@ def encrypt_mks(source, target, env, new_name):
67 67
 
68 68
 def add_post_action(action):
69 69
 	env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.bin"), action);
70
-
71
-# Apply customizations for a MKS Robin
72
-def prepare_robin(address, ldname, fwname):
73
-	def encrypt(source, target, env):
74
-		encrypt_mks(source, target, env, fwname)
75
-	relocate_firmware(address)
76
-	custom_ld_script(ldname)
77
-	add_post_action(encrypt);

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08007000", "mks_robin.ld", "Robin.bin")
4
+import robin
5
+robin.prepare("0x08007000", "mks_robin.ld", "Robin.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_e3.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_e3.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin")
4
+import robin
5
+robin.prepare("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_e3p.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_e3p.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin")
4
+import robin
5
+robin.prepare("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_lite.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_lite.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite.bin")
4
+import robin
5
+robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_lite3.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_lite3.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite3.bin")
4
+import robin
5
+robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite3.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_mini.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_mini.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin")
4
+import robin
5
+robin.prepare("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_nano.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_nano.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")
4
+import robin
5
+robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_nano35.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin")
4
+import robin
5
+robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin")

+ 2
- 2
buildroot/share/PlatformIO/scripts/mks_robin_pro.py Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #
2 2
 # buildroot/share/PlatformIO/scripts/mks_robin_pro.py
3 3
 #
4
-import marlin
5
-marlin.prepare_robin("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin")
4
+import robin
5
+robin.prepare("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin")

+ 12
- 0
buildroot/share/PlatformIO/scripts/robin.py Zobrazit soubor

@@ -0,0 +1,12 @@
1
+#
2
+# buildroot/share/PlatformIO/scripts/robin.py
3
+#
4
+import marlin
5
+
6
+# Apply customizations for a MKS Robin
7
+def prepare(address, ldname, fwname):
8
+	def encrypt(source, target, env):
9
+		marlin.encrypt_mks(source, target, env, fwname)
10
+	marlin.relocate_firmware(address)
11
+	marlin.custom_ld_script(ldname)
12
+	marlin.add_post_action(encrypt);

+ 7
- 0
buildroot/share/PlatformIO/scripts/stm32_bootloader.py Zobrazit soubor

@@ -1,6 +1,13 @@
1 1
 #
2 2
 # stm32_bootloader.py
3 3
 #
4
+# - If 'build.offset' is provided, either by JSON or by the environment...
5
+# 	- Set linker flag LD_FLASH_OFFSET and relocate the VTAB based on 'build.offset'.
6
+# 	- Set linker flag LD_MAX_DATA_SIZE based on 'build.maximum_ram_size'.
7
+# 	- Define STM32_FLASH_SIZE from 'upload.maximum_size' for use by Flash-based EEPROM emulation.
8
+#
9
+# - For 'board_build.rename' add a post-action to rename the firmware file.
10
+#
4 11
 import os,sys,marlin
5 12
 Import("env")
6 13
 

+ 0
- 7
ini/stm32f1.ini Zobrazit soubor

@@ -41,7 +41,6 @@ board                = genericSTM32F103RC
41 41
 monitor_speed        = 115200
42 42
 board_build.core     = stm32
43 43
 board_build.variant  = MARLIN_F103Rx
44
-board_build.ldscript = ldscript.ld
45 44
 extra_scripts        = ${common_stm32.extra_scripts}
46 45
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
47 46
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
@@ -108,7 +107,6 @@ extends              = common_stm32
108 107
 board                = genericSTM32F103ZE
109 108
 board_build.core     = stm32
110 109
 board_build.variant  = MARLIN_F103Zx
111
-board_build.ldscript = ldscript.ld
112 110
 board_build.offset   = 0x7000
113 111
 board_build.encrypt  = Robin.bin
114 112
 build_flags          = ${common_stm32.build_flags}
@@ -150,7 +148,6 @@ monitor_speed        = 115200
150 148
 board_build.core     = stm32
151 149
 board_build.variant  = MARLIN_F103Rx
152 150
 board_build.offset   = 0x7000
153
-board_build.ldscript = ldscript.ld
154 151
 board_upload.offset_address = 0x08007000
155 152
 build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
156 153
 extra_scripts        = ${common.extra_scripts}
@@ -175,7 +172,6 @@ monitor_speed        = 115200
175 172
 board_build.core     = stm32
176 173
 board_build.variant  = MARLIN_F103Rx
177 174
 board_build.offset   = 0x7000
178
-board_build.ldscript = ldscript.ld
179 175
 board_upload.offset_address = 0x08007000
180 176
 build_unflags        = ${common_stm32.build_unflags}
181 177
 extra_scripts        = ${common.extra_scripts}
@@ -207,7 +203,6 @@ build_flags          = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=
207 203
 board                = genericSTM32F103VE
208 204
 board_build.core     = stm32
209 205
 board_build.variant  = MARLIN_F103Vx
210
-board_build.ldscript = ldscript.ld
211 206
 board_build.offset   = 0x7000
212 207
 board_build.encrypt  = Robin_mini.bin
213 208
 board_upload.offset_address = 0x08007000
@@ -227,7 +222,6 @@ build_flags          = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=
227 222
 board                = genericSTM32F103VE
228 223
 board_build.core     = stm32
229 224
 board_build.variant  = MARLIN_F103Vx
230
-board_build.ldscript = ldscript.ld
231 225
 board_build.offset   = 0x7000
232 226
 board_build.encrypt  = Robin_nano35.bin
233 227
 board_upload.offset_address = 0x08007000
@@ -248,7 +242,6 @@ extends              = common_stm32
248 242
 board                = genericSTM32F103ZE
249 243
 board_build.core     = stm32
250 244
 board_build.variant  = MARLIN_F103Zx
251
-board_build.ldscript = ldscript.ld
252 245
 board_build.offset   = 0x10000
253 246
 build_flags          = ${common_stm32.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
254 247
 build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC

+ 0
- 5
ini/stm32f4.ini Zobrazit soubor

@@ -112,7 +112,6 @@ build_flags          = ${common_stm32.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL
112 112
 board                = marlin_STM32F407VGT6_CCM
113 113
 board_build.core     = stm32
114 114
 board_build.variant  = MARLIN_F4x7Vx
115
-board_build.ldscript = ldscript.ld
116 115
 board_build.encrypt  = firmware.srec
117 116
 # Just openblt.py (not stm32_bootloader.py) generates the file
118 117
 board_build.offset   = 0x10000
@@ -222,7 +221,6 @@ extends              = common_stm32
222 221
 board                = marlin_STM32F407VGT6_CCM
223 222
 board_build.core     = stm32
224 223
 board_build.variant  = MARLIN_F4x7Vx
225
-board_build.ldscript = ldscript.ld
226 224
 board_build.offset   = 0x8000
227 225
 board_upload.offset_address = 0x08008000
228 226
 extra_scripts     = ${common.extra_scripts}
@@ -344,7 +342,6 @@ upload_protocol      = dfu
344 342
 monitor_speed        = 500000
345 343
 board_build.core     = stm32
346 344
 board_build.variant  = MARLIN_F446VE
347
-board_build.ldscript = ldscript.ld
348 345
 board_build.offset   = 0x0000
349 346
 extra_scripts        = ${common.extra_scripts}
350 347
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
@@ -361,7 +358,6 @@ build_flags          = ${stm_flash_drive.build_flags}
361 358
 board                = genericSTM32F407VET6
362 359
 board_build.core     = stm32
363 360
 board_build.variant  = MARLIN_F4x7Vx
364
-board_build.ldscript = ldscript.ld
365 361
 board_build.offset   = 0x0000
366 362
 board_upload.offset_address = 0x08000000
367 363
 build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
@@ -387,7 +383,6 @@ build_flags          = ${common_stm32.build_flags} ${stm32f4_I2C1.build_flags} -
387 383
 board                = marlin_STM32F407VGT6_CCM
388 384
 board_build.core     = stm32
389 385
 board_build.variant  = MARLIN_F4x7Vx
390
-board_build.ldscript = ldscript.ld
391 386
 board_build.rename   = Robin_nano_v3.bin
392 387
 board_build.offset   = 0xC000
393 388
 board_upload.offset_address = 0x0800C000

Loading…
Zrušit
Uložit