From ad256db2c0dc06bbae0535c6600e3a40671ba665 Mon Sep 17 00:00:00 2001 From: Yilin Sun Date: Tue, 3 Sep 2024 14:03:35 +0800 Subject: [PATCH] bsp: nxp/mcx/mcxc: FRDM-MCXC444: Fix GCC build suport. This patch fixes GCC build support for FRDM-MCXC444. * Updated compiler flags to Cortex-M0 without FPU. * Updated linker script to add RT-Thread const tables. --- .../board/linker_scripts/MCXC444_flash.ld | 21 +++++++++++++++++++ bsp/nxp/mcx/mcxc/frdm-mcxc444/rtconfig.py | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/bsp/nxp/mcx/mcxc/frdm-mcxc444/board/linker_scripts/MCXC444_flash.ld b/bsp/nxp/mcx/mcxc/frdm-mcxc444/board/linker_scripts/MCXC444_flash.ld index 8abb7faed5..6490b5ea38 100644 --- a/bsp/nxp/mcx/mcxc/frdm-mcxc444/board/linker_scripts/MCXC444_flash.ld +++ b/bsp/nxp/mcx/mcxc/frdm-mcxc444/board/linker_scripts/MCXC444_flash.ld @@ -70,6 +70,27 @@ SECTIONS . = ALIGN(4); } > m_text + .rtt_const_tables : + { + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + + } > m_text + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) diff --git a/bsp/nxp/mcx/mcxc/frdm-mcxc444/rtconfig.py b/bsp/nxp/mcx/mcxc/frdm-mcxc444/rtconfig.py index b86bc760dd..f719ab0477 100644 --- a/bsp/nxp/mcx/mcxc/frdm-mcxc444/rtconfig.py +++ b/bsp/nxp/mcx/mcxc/frdm-mcxc444/rtconfig.py @@ -44,10 +44,10 @@ if PLATFORM == 'gcc': OBJCPY = PREFIX + 'objcopy' STRIP = PREFIX + 'strip' - DEVICE = ' -mcpu=' + CPU + ' -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' - CFLAGS = DEVICE + ' -Wall -D__FPU_PRESENT' + DEVICE = ' -mcpu=' + CPU + ' -mthumb -ffunction-sections -fdata-sections' + CFLAGS = DEVICE + ' -Wall' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__START=entry -D__STARTUP_CLEAR_BSS' - LFLAGS = DEVICE + ' -specs=nano.specs -specs=nosys.specs -Wl,--defsym=__heap_size__=0x10000,--gc-sections,-Map=rtthread.map,--print-memory-usage -Tboard/linker_scripts/MCXC444_flash.ld' + LFLAGS = DEVICE + ' -specs=nano.specs -specs=nosys.specs -Wl,--defsym=__heap_size__=0x4000,--gc-sections,-Map=rtthread.map,--print-memory-usage -Tboard/linker_scripts/MCXC444_flash.ld' CPATH = '' LPATH = ''