From 0a1d2bb9e80b683bf62e883d5af3803db1da5d05 Mon Sep 17 00:00:00 2001 From: Oliver Walter Date: Fri, 2 Feb 2024 19:54:04 +0100 Subject: [PATCH] fixed some LTO issues --- CMakeLists.txt | 4 ++-- Core/Inc/FreeRTOSConfig.h | 2 ++ STM32H723VGTX_FLASH.ld | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4346930..a29b9e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ add_compile_options( -Wextra -Wpedantic -Wno-unused-parameter - -flto + -flto=8 ) add_link_options( @@ -86,7 +86,7 @@ add_link_options( -lstdc++ -lsupc++ -Wl,--end-group - -flto + -flto=8 -Wl,-z,max-page-size=8 # Allow good software remapping across address space (with proper GCC section making) -Wl,--print-memory-usage ) diff --git a/Core/Inc/FreeRTOSConfig.h b/Core/Inc/FreeRTOSConfig.h index 3b45202..7ee1549 100644 --- a/Core/Inc/FreeRTOSConfig.h +++ b/Core/Inc/FreeRTOSConfig.h @@ -166,6 +166,8 @@ standard names. */ #define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0 +#define portDONT_DISCARD __attribute__((used)) + /* USER CODE BEGIN Defines */ /* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ /* USER CODE END Defines */ diff --git a/STM32H723VGTX_FLASH.ld b/STM32H723VGTX_FLASH.ld index 55f73dc..e820d09 100644 --- a/STM32H723VGTX_FLASH.ld +++ b/STM32H723VGTX_FLASH.ld @@ -43,12 +43,12 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { - ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K - DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + ITCMRAM (rw) : ORIGIN = 0x00000000, LENGTH = 64K + DTCMRAM (rw) : ORIGIN = 0x20000000, LENGTH = 128K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K - RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K - RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K - RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K + RAM_D1 (rw) : ORIGIN = 0x24000000, LENGTH = 320K + RAM_D2 (rw) : ORIGIN = 0x30000000, LENGTH = 32K + RAM_D3 (rw) : ORIGIN = 0x38000000, LENGTH = 16K } /* Define output sections */