From 17a4efe031178690f7283f87f7ab267124cd5b69 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Aug 2019 13:31:21 -0600 Subject: [PATCH] boards/arm/s32k1xx/s32k118evb: More build fixes. --- arch/arm/src/s32k1xx/Make.defs | 5 +- arch/arm/src/s32k1xx/s32k1xx_start.c | 1 - .../s32k1xx/s32k118evb/configs/nsh/defconfig | 4 +- .../arm/s32k1xx/s32k118evb/scripts/flash.ld | 136 +++++++++--------- .../s32k1xx/s32k118evb/src/s32k118_autoleds.c | 2 +- .../s32k1xx/s32k118evb/src/s32k118_bringup.c | 1 + 6 files changed, 79 insertions(+), 70 deletions(-) diff --git a/arch/arm/src/s32k1xx/Make.defs b/arch/arm/src/s32k1xx/Make.defs index 6024c19d50..8a933f8096 100644 --- a/arch/arm/src/s32k1xx/Make.defs +++ b/arch/arm/src/s32k1xx/Make.defs @@ -36,8 +36,9 @@ # Common ARM source files HEAD_ASRC = -CMN_ASRCS = up_allocateheap.c up_exit.c up_initialize.c up_interruptcontext.c -CMN_ASRCS += up_lowputs.c up_mdelay.c up_modifyreg8.c up_modifyreg16.c +CMN_ASRCS = +CMN_CSRCS = up_allocateheap.c up_exit.c up_initialize.c up_interruptcontext.c +CMN_CSRCS += up_lowputs.c up_mdelay.c up_modifyreg8.c up_modifyreg16.c CMN_CSRCS += up_modifyreg32.c up_puts.c up_releasestack.c up_stackframe.c CMN_CSRCS += up_task_start.c up_udelay.c up_usestack.c up_vfork.c diff --git a/arch/arm/src/s32k1xx/s32k1xx_start.c b/arch/arm/src/s32k1xx/s32k1xx_start.c index c69deb6baf..98d33e0c92 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_start.c +++ b/arch/arm/src/s32k1xx/s32k1xx_start.c @@ -192,7 +192,6 @@ void __start(void) { const uint32_t *src; uint32_t *dest; - uint32_t regval; /* Make sure that interrupts are disabled */ diff --git a/boards/arm/s32k1xx/s32k118evb/configs/nsh/defconfig b/boards/arm/s32k1xx/s32k118evb/configs/nsh/defconfig index 0c30029066..cc5da59b73 100644 --- a/boards/arm/s32k1xx/s32k118evb/configs/nsh/defconfig +++ b/boards/arm/s32k1xx/s32k118evb/configs/nsh/defconfig @@ -48,8 +48,8 @@ CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 CONFIG_PREALLOC_WDOGS=4 CONFIG_PTHREAD_STACK_DEFAULT=1536 -CONFIG_RAM_SIZE=16384 -CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=23552 +CONFIG_RAM_START=0x1ffffc00 CONFIG_RAW_BINARY=y CONFIG_RR_INTERVAL=200 CONFIG_S32K1XX_LPUART0=y diff --git a/boards/arm/s32k1xx/s32k118evb/scripts/flash.ld b/boards/arm/s32k1xx/s32k118evb/scripts/flash.ld index 4c78f49a7f..88dcf086ca 100644 --- a/boards/arm/s32k1xx/s32k118evb/scripts/flash.ld +++ b/boards/arm/s32k1xx/s32k118evb/scripts/flash.ld @@ -34,7 +34,7 @@ ****************************************************************************/ /* The S32K118 has 256KB of FLASH beginning at address 0x0000:0000 and - * 25KB of SRAM beginning at address 0x1fff:fc00 (incl. 2Kb of FlexRAM) + * 23KB of SRAM beginning at address 0x1fff:fc00 (plus 2Kb of FlexRAM) * * The on-chip RAM is split in two regions: SRAM_L and SRAM_U. The RAM is * implemented such that the SRAM_L and SRAM_U ranges form a contiguous @@ -46,7 +46,7 @@ MEMORY { flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 23K + sram (rwx) : ORIGIN = 0x1ffffc00, LENGTH = 23K } OUTPUT_ARCH(arm) @@ -55,75 +55,83 @@ ENTRY(_stext) SECTIONS { - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash + .text : + { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > flash - .init_section : { - _sinit = ABSOLUTE(.); - *(.init_array .init_array.*) - _einit = ABSOLUTE(.); - } > flash + .init_section : + { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > flash - .ARM.extab : { - *(.ARM.extab*) - } >flash + .ARM.extab : + { + *(.ARM.extab*) + } >flash - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } >flash - __exidx_end = ABSOLUTE(.); + __exidx_start = ABSOLUTE(.); + .ARM.exidx : + { + *(.ARM.exidx*) + } >flash + __exidx_end = ABSOLUTE(.); - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash - _eronly = LOADADDR(.data); + _eronly = LOADADDR(.data); - .ramfunc ALIGN(4): { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - } > sram AT > flash + .ramfunc ALIGN(4): + { + _sramfuncs = ABSOLUTE(.); + *(.ramfunc .ramfunc.*) + _eramfuncs = ABSOLUTE(.); + } > sram AT > flash - _framfuncs = LOADADDR(.ramfunc); + _framfuncs = LOADADDR(.ramfunc); - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - _ebss = ABSOLUTE(.); - } > sram + .bss : + { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } + /* Stabs debugging sections. */ + + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } } diff --git a/boards/arm/s32k1xx/s32k118evb/src/s32k118_autoleds.c b/boards/arm/s32k1xx/s32k118evb/src/s32k118_autoleds.c index 62ec68331a..ab8a766aea 100644 --- a/boards/arm/s32k1xx/s32k118evb/src/s32k118_autoleds.c +++ b/boards/arm/s32k1xx/s32k118evb/src/s32k118_autoleds.c @@ -49,7 +49,7 @@ #include "chip.h" #include "up_arch.h" #include "up_internal.h" -#include "stm32.h" + #include "s32k118evb.h" #ifdef CONFIG_ARCH_LEDS diff --git a/boards/arm/s32k1xx/s32k118evb/src/s32k118_bringup.c b/boards/arm/s32k1xx/s32k118evb/src/s32k118_bringup.c index 91fd9779de..fd61da84e9 100644 --- a/boards/arm/s32k1xx/s32k118evb/src/s32k118_bringup.c +++ b/boards/arm/s32k1xx/s32k118evb/src/s32k118_bringup.c @@ -39,6 +39,7 @@ #include +#include #include #include