Skip to content

Commit

Permalink
Maybe this can replace several others
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 4, 2021
1 parent bb8a75e commit 51c8081
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 45 deletions.
14 changes: 0 additions & 14 deletions buildroot/share/PlatformIO/ldscripts/ZONESTAR_ZM3E2.ld

This file was deleted.

14 changes: 0 additions & 14 deletions buildroot/share/PlatformIO/ldscripts/ZONESTAR_ZM3E4.ld

This file was deleted.

14 changes: 0 additions & 14 deletions buildroot/share/PlatformIO/ldscripts/ZONESTAR_ZM3E4V2.ld

This file was deleted.

24 changes: 24 additions & 0 deletions buildroot/share/PlatformIO/ldscripts/custom.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* custom.ld - Linker script using custom environment defines
*
* LD_MAX_SIZE seems to be defined by the base platform build.
*
* Provided by offset_and_rename.py :
* LD_MAX_DATA_SIZE <= board_upload.maximum_ram_size
* LD_FLASH_OFFSET <= board_build.offset -- also used for marlin.relocate_vtab()
*/

MEMORY
{
ram (rwx) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
rom (rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
}

/* Provide memory region aliases for common.inc */
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_BSS", ram);
REGION_ALIAS("REGION_RODATA", rom);

/* Let common.inc handle the real work. */
INCLUDE common.inc
6 changes: 3 additions & 3 deletions ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,13 @@ build_flags = ${common_stm32f1.build_flags}
platform = ${common_stm32f1.platform}
extends = common_stm32f1
platform_packages = tool-stm32duino
board_build.ldscript = custom.ld
board_build.address = 0x08005000
board_build.offset = 0x5000
board_upload.maximum_size = 237568
extra_scripts = ${common.extra_scripts}
buildroot/share/PlatformIO/scripts/custom_board.py
buildroot/share/PlatformIO/scripts/offset_and_rename.py
build_flags = ${common_stm32f1.build_flags}
-D__STM32F1__=1 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DSERIAL_USB
lib_deps = USBComposite for [email protected]
Expand All @@ -381,17 +384,14 @@ lib_ignore = Adafruit NeoPixel, SPI, SailfishLCD, SailfishRGB_LED
platform = ${ZONESTAR_ZM3E.platform}
extends = ZONESTAR_ZM3E
board = genericSTM32F103RC
board_build.ldscript = ZONESTAR_ZM3E4V2.ld

[env:STM32F103VC_ZM3E4_USB]
platform = ${ZONESTAR_ZM3E.platform}
extends = ZONESTAR_ZM3E
board = genericSTM32F103VC
board_build.ldscript = ZONESTAR_ZM3E4.ld

[env:STM32F103VE_ZM3E4V2_USB]
platform = ${ZONESTAR_ZM3E.platform}
extends = ZONESTAR_ZM3E
board = genericSTM32F103VE
board_build.ldscript = ZONESTAR_ZM3E4V2.ld
board_upload.maximum_size = 499712

0 comments on commit 51c8081

Please sign in to comment.