From f88adcbfd550fc62fb64e552b94397486e2f9ad4 Mon Sep 17 00:00:00 2001 From: Chris Pepper Date: Fri, 15 Jun 2018 21:32:51 +0100 Subject: [PATCH] [2.0.x][LPC176x] Fix binary linking broken by pio update (#11026) --- Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py | 4 +++- frameworks/CMSIS/library.json | 3 +-- platformio.ini | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py b/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py index e66ab4c28f..23f214ba63 100644 --- a/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py +++ b/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py @@ -22,6 +22,7 @@ if __name__ == "__main__": # For MarlinFirmware/U8glib-HAL "-IMarlin/src/HAL/HAL_LPC1768/u8g", + "-DU8G_HAL_LINKS", "-MMD", "-MP", @@ -48,11 +49,12 @@ else: "-fno-threadsafe-statics" ], LINKFLAGS=[ + "-Wl,-Tframeworks/CMSIS/LPC1768/Re-ARM/LPC1768.ld,--gc-sections", "-Os", "-mcpu=cortex-m3", "-mthumb", "--specs=nano.specs", "--specs=nosys.specs", - "-u_printf_float", + "-u_printf_float" ], ) diff --git a/frameworks/CMSIS/library.json b/frameworks/CMSIS/library.json index 7b30a2f203..3af411e290 100644 --- a/frameworks/CMSIS/library.json +++ b/frameworks/CMSIS/library.json @@ -11,8 +11,7 @@ "src_filter": "+", "flags": [ "-ILPC1768/include", - "-ILPC1768/lib", - "-Wl,-Tframeworks/CMSIS/LPC1768/Re-ARM/LPC1768.ld,--gc-sections" + "-ILPC1768/lib" ] } } diff --git a/platformio.ini b/platformio.ini index ea4dda2b31..9bd1108ed8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -150,10 +150,10 @@ monitor_speed = 250000 platform = nxplpc board = lpc1768 board_build.f_cpu = 100000000L -build_flags = !python Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py - ${common.build_flags} - -DU8G_HAL_LINKS -src_build_flags = -Wall +# Override default maximum RAM. LPC1768/9 do have 64k, but in 3 blocks (32K, 16K, 16K). +# The first 32k block is used by default, while the others must be specifically targeted. +board_upload.maximum_ram_size = 32768 +build_flags = !python Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py ${common.build_flags} build_unflags = -Wall lib_ldf_mode = off lib_extra_dirs = frameworks