From aaeb0766dfa9450358c7e007a484fec2829b32bc Mon Sep 17 00:00:00 2001
From: Damiano Procaccia <dprocaccia@gmail.com>
Date: Sat, 3 Feb 2024 14:08:50 +0100
Subject: [PATCH] cmake debug option (-g3); default linker no xram

Change teh default options for debug build from -g to -g3. This options
make the compiler emit more informations, e.g. about macros
Change linker script to not use the xram by default. Remember that this
change is because ram is supposed to be unreliable in the current
branch, and for testing must remain unused by the system
---
 miosix/config/options.cmake | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/miosix/config/options.cmake b/miosix/config/options.cmake
index 3de563b9..51358108 100644
--- a/miosix/config/options.cmake
+++ b/miosix/config/options.cmake
@@ -1207,8 +1207,8 @@ endif()
 ##
 ## Then, initialize C/C++ flags
 ##
-set(CFLAGS_BASE "-D_MIOSIX_BOARDNAME=\"${OPT_BOARD}\"" -D_DEFAULT_SOURCE=1 -ffunction-sections -Wall -Werror=return-type -g)
-set(CXXFLAGS_BASE "-D_MIOSIX_BOARDNAME=\"${OPT_BOARD}\"" -D_DEFAULT_SOURCE=1 -ffunction-sections -Wall -Werror=return-type -g)
+set(CFLAGS_BASE "-D_MIOSIX_BOARDNAME=\"${OPT_BOARD}\"" -D_DEFAULT_SOURCE=1 -ffunction-sections -Wall -Werror=return-type -g3)
+set(CXXFLAGS_BASE "-D_MIOSIX_BOARDNAME=\"${OPT_BOARD}\"" -D_DEFAULT_SOURCE=1 -ffunction-sections -Wall -Werror=return-type -g3)
 
 ##
 ## Now two big switch-like constructs nested. The first lists all possible
@@ -3228,8 +3228,8 @@ elseif(${ARCH} STREQUAL cortexM7_stm32f7)
         ## Select linker script and boot file
         ## Their path must be relative to the miosix directory.
         set(BOOT_FILE ${KPATH}/${BOARD_INC}/core/stage_1_boot.cpp)
-        # set(LINKER_SCRIPT ${KPATH}/${BOARD_INC}/stm32_2m+384k_ram.ld)
-        set(LINKER_SCRIPT ${KPATH}/${BOARD_INC}/stm32_2m+16m_xram.ld)
+        set(LINKER_SCRIPT ${KPATH}/${BOARD_INC}/stm32_2m+384k_ram.ld)
+        # set(LINKER_SCRIPT ${KPATH}/${BOARD_INC}/stm32_2m+16m_xram.ld)
 
         ## Enables the initialization of the external SDRAM memory
         set(XRAM -D__ENABLE_XRAM)
-- 
GitLab