Skip to content

Commit 51c8081

Browse files
committed
Maybe this can replace several others
1 parent bb8a75e commit 51c8081

File tree

5 files changed

+27
-45
lines changed

5 files changed

+27
-45
lines changed

buildroot/share/PlatformIO/ldscripts/ZONESTAR_ZM3E2.ld

Lines changed: 0 additions & 14 deletions
This file was deleted.

buildroot/share/PlatformIO/ldscripts/ZONESTAR_ZM3E4.ld

Lines changed: 0 additions & 14 deletions
This file was deleted.

buildroot/share/PlatformIO/ldscripts/ZONESTAR_ZM3E4V2.ld

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* custom.ld - Linker script using custom environment defines
3+
*
4+
* LD_MAX_SIZE seems to be defined by the base platform build.
5+
*
6+
* Provided by offset_and_rename.py :
7+
* LD_MAX_DATA_SIZE <= board_upload.maximum_ram_size
8+
* LD_FLASH_OFFSET <= board_build.offset -- also used for marlin.relocate_vtab()
9+
*/
10+
11+
MEMORY
12+
{
13+
ram (rwx) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
14+
rom (rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
15+
}
16+
17+
/* Provide memory region aliases for common.inc */
18+
REGION_ALIAS("REGION_TEXT", rom);
19+
REGION_ALIAS("REGION_DATA", ram);
20+
REGION_ALIAS("REGION_BSS", ram);
21+
REGION_ALIAS("REGION_RODATA", rom);
22+
23+
/* Let common.inc handle the real work. */
24+
INCLUDE common.inc

ini/stm32f1-maple.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,13 @@ build_flags = ${common_stm32f1.build_flags}
368368
platform = ${common_stm32f1.platform}
369369
extends = common_stm32f1
370370
platform_packages = tool-stm32duino
371+
board_build.ldscript = custom.ld
371372
board_build.address = 0x08005000
373+
board_build.offset = 0x5000
372374
board_upload.maximum_size = 237568
373375
extra_scripts = ${common.extra_scripts}
374376
buildroot/share/PlatformIO/scripts/custom_board.py
377+
buildroot/share/PlatformIO/scripts/offset_and_rename.py
375378
build_flags = ${common_stm32f1.build_flags}
376379
-D__STM32F1__=1 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DSERIAL_USB
377380
lib_deps = USBComposite for [email protected]
@@ -381,17 +384,14 @@ lib_ignore = Adafruit NeoPixel, SPI, SailfishLCD, SailfishRGB_LED
381384
platform = ${ZONESTAR_ZM3E.platform}
382385
extends = ZONESTAR_ZM3E
383386
board = genericSTM32F103RC
384-
board_build.ldscript = ZONESTAR_ZM3E4V2.ld
385387

386388
[env:STM32F103VC_ZM3E4_USB]
387389
platform = ${ZONESTAR_ZM3E.platform}
388390
extends = ZONESTAR_ZM3E
389391
board = genericSTM32F103VC
390-
board_build.ldscript = ZONESTAR_ZM3E4.ld
391392

392393
[env:STM32F103VE_ZM3E4V2_USB]
393394
platform = ${ZONESTAR_ZM3E.platform}
394395
extends = ZONESTAR_ZM3E
395396
board = genericSTM32F103VE
396-
board_build.ldscript = ZONESTAR_ZM3E4V2.ld
397397
board_upload.maximum_size = 499712

0 commit comments

Comments
 (0)