diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-02 19:04:44 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-02 19:04:44 +0000 |
commit | f5d629b65b9588ddae1333f06aa392083c284949 (patch) | |
tree | 01e8e16f655b7738037330adbef3120df72bfb3f /nuttx/configs/sam3u-ek/knsh | |
parent | c3e496ad6e836db85c8c8fa7118aa9ed8b99ded3 (diff) | |
download | px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.tar.gz px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.tar.bz2 px4-nuttx-f5d629b65b9588ddae1333f06aa392083c284949.zip |
Add SAM3U kernel build logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3456 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/sam3u-ek/knsh')
-rwxr-xr-x | nuttx/configs/sam3u-ek/knsh/Make.defs | 2 | ||||
-rwxr-xr-x | nuttx/configs/sam3u-ek/knsh/defconfig | 7 | ||||
-rwxr-xr-x | nuttx/configs/sam3u-ek/knsh/ld.script | 36 |
3 files changed, 34 insertions, 11 deletions
diff --git a/nuttx/configs/sam3u-ek/knsh/Make.defs b/nuttx/configs/sam3u-ek/knsh/Make.defs index 83e766d77..d735f887a 100755 --- a/nuttx/configs/sam3u-ek/knsh/Make.defs +++ b/nuttx/configs/sam3u-ek/knsh/Make.defs @@ -117,7 +117,7 @@ LDNXFLATFLAGS = -e main -s 2048 OBJEXT = .o LIBEXT = .a -EXEEXT = +EXEEXT = .elf ifneq ($(CROSSDEV),arm-elf-) LDFLAGS += -nostartfiles -nodefaultlibs diff --git a/nuttx/configs/sam3u-ek/knsh/defconfig b/nuttx/configs/sam3u-ek/knsh/defconfig index fb0a988a0..b59ac08bf 100755 --- a/nuttx/configs/sam3u-ek/knsh/defconfig +++ b/nuttx/configs/sam3u-ek/knsh/defconfig @@ -208,6 +208,13 @@ CONFIG_RAW_BINARY=y CONFIG_HAVE_LIBM=n # +# Setup for a two-pass build +# +CONFIG_BUILD_2PASS=y +CONFIG_PASS1_BUILDIR=configs/sam3u-ek/kernel +CONFIG_PASS1_OBJECT= + +# # General OS setup # # CONFIG_APPS_DIR - Identifies the relative path to the directory diff --git a/nuttx/configs/sam3u-ek/knsh/ld.script b/nuttx/configs/sam3u-ek/knsh/ld.script index 2fe8d94ed..c3a31090c 100755 --- a/nuttx/configs/sam3u-ek/knsh/ld.script +++ b/nuttx/configs/sam3u-ek/knsh/ld.script @@ -39,12 +39,26 @@ * FLASH memory is aliased to address 0x0000:0000 where the code expects to * begin execution by jumping to the entry point in the 0x0800:0000 address * range. + * + * For MPU support, the kernel-mode NuttX section is assumed to be 64Kb of + * FLASH and 4Kb of SRAM. That, of course, can be optimized as needed (See + * also configs/sam3u-ek/kernel/kernel.ld. */ MEMORY { - flash (rx) : ORIGIN = 0x00080000, LENGTH = 256K - sram1 (rwx) : ORIGIN = 0x20000000, LENGTH = 32K + /* 256Kb FLASH */ + + kflash (rx) : ORIGIN = 0x00080000, LENGTH = 64K + uflash (rx) : ORIGIN = 0x00090000, LENGTH = 192K + + /* 32Kb SRAM */ + + ksram1 (rwx) : ORIGIN = 0x20000000, LENGTH = 4K + usram1 (rwx) : ORIGIN = 0x20001000, LENGTH = 28K + + /* 16Kb SRAM */ + sram2 (rwx) : ORIGIN = 0x20080000, LENGTH = 16K } @@ -66,9 +80,9 @@ SECTIONS *(.gcc_except_table) *(.gnu.linkonce.r.*) _etext = ABSOLUTE(.); - } > flash + } > kflash - _eronly = ABSOLUTE(.); /* See below */ + _eronly = ABSOLUTE(.); .data : { _sdata = ABSOLUTE(.); @@ -76,26 +90,28 @@ SECTIONS *(.gnu.linkonce.d.*) CONSTRUCTORS _edata = ABSOLUTE(.); - } > sram1 AT > flash + } > ksram1 AT > kflash .ARM.extab : { *(.ARM.extab*) - } >sram1 + } >ksram1 .ARM.exidx : { __exidx_start = ABSOLUTE(.); *(.ARM.exidx*) __exidx_end = ABSOLUTE(.); - } >sram1 + } >ksram1 - .bss : { /* BSS */ + .bss : { _sbss = ABSOLUTE(.); *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) _ebss = ABSOLUTE(.); - } > sram1 - /* Stabs debugging sections. */ + } > ksram1 + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } |