summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-17 20:27:29 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-17 20:27:29 +0000
commitd7a9800e3ecdd8f6bce4b5ee83bfe91e4238b61e (patch)
tree8f4195e59f0692c34653236e64f632d37dcfdb8d /nuttx
parent2329a560c03845b21f525cf269106bae13b1039e (diff)
downloadpx4-nuttx-d7a9800e3ecdd8f6bce4b5ee83bfe91e4238b61e.tar.gz
px4-nuttx-d7a9800e3ecdd8f6bce4b5ee83bfe91e4238b61e.tar.bz2
px4-nuttx-d7a9800e3ecdd8f6bce4b5ee83bfe91e4238b61e.zip
LPC2148 oots partially into NuttX
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@924 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/arch/arm/src/Makefile7
-rw-r--r--nuttx/arch/arm/src/lpc214x/lpc214x_head.S11
-rw-r--r--nuttx/configs/mcu123-lpc214x/defconfig2
-rw-r--r--nuttx/configs/mcu123-lpc214x/ld.script15
4 files changed, 23 insertions, 12 deletions
diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile
index 44c417409..098b69ed1 100644
--- a/nuttx/arch/arm/src/Makefile
+++ b/nuttx/arch/arm/src/Makefile
@@ -82,7 +82,12 @@ board/libboard$(LIBEXT):
nuttx: $(HEAD_AOBJ) board/libboard$(LIBEXT)
@echo "LD: nuttx"
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
- --start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
+ --start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
+ifeq ($(CONFIG_BOOT_FROM_FLASH),y)
+ @export flashloc=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _eronly | cut -d' ' -f1`; \
+ $(OBJCOPY) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage
+ @mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@
+endif
@$(NM) $(TOPDIR)/$@ | \
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
sort > $(TOPDIR)/System.map
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_head.S b/nuttx/arch/arm/src/lpc214x/lpc214x_head.S
index 15939a3ad..b3c2a9ee6 100644
--- a/nuttx/arch/arm/src/lpc214x/lpc214x_head.S
+++ b/nuttx/arch/arm/src/lpc214x/lpc214x_head.S
@@ -415,7 +415,7 @@ __start:
/* Configure VPBDIV */
configvpbdiv r0, r1
-
+
/* Configure the PLL */
configpll r0, r1, r2, r3
@@ -471,12 +471,9 @@ __start:
mov fp, #0
bl up_earlyserialinit
-#ifdef CONFIG_DEBUG
- mov r0, #'C'
- bl up_putc
- mov r0, #'\n'
- bl up_putc
-#endif
+ showprogress 'C'
+ showprogress '\n'
+
/* Initialize onboard LEDs */
#ifdef CONFIG_ARCH_LEDS
diff --git a/nuttx/configs/mcu123-lpc214x/defconfig b/nuttx/configs/mcu123-lpc214x/defconfig
index 1229ec525..a1f0b9086 100644
--- a/nuttx/configs/mcu123-lpc214x/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/defconfig
@@ -347,7 +347,7 @@ CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
-CONFIG_BOOT_FROM_FLASH=n
+CONFIG_BOOT_FROM_FLASH=y
CONFIG_CUSTOM_STACK=n
CONFIG_STACK_POINTER=
CONFIG_PROC_STACK_SIZE=4096
diff --git a/nuttx/configs/mcu123-lpc214x/ld.script b/nuttx/configs/mcu123-lpc214x/ld.script
index 80138e3b3..cf802e803 100644
--- a/nuttx/configs/mcu123-lpc214x/ld.script
+++ b/nuttx/configs/mcu123-lpc214x/ld.script
@@ -37,7 +37,10 @@ OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
- /* The OS entry point is here (default MEMMAP mode assumed) */
+ /* The lpc2148 has 512Kb of non-volatile memory beginning at address
+ * 0x00000000. The OS entry point is via the reset vector at address
+ * 0x00000000 (default MEMMAP mode assumed)
+ */
. = 0x00000000;
.text : {
@@ -51,10 +54,16 @@ SECTIONS
*(.got) /* Global offset table */
_etext = ABSOLUTE(.);
}
+ _eronly = ABSOLUTE(.); /* This is where the .data section
+ * is relocated for execution out
+ * FLASH */
- _eronly = ABSOLUTE(.); /* See below */
- . = ALIGN(4096);
+ /* The lpc2148 has 32Kb of on-chip static RAM beginning at address
+ * 0x40000000. The .data section will be relocated from _eronly
+ * to _sdata at boot time.
+ */
+ . = 0x40000000;
.data : {
_sdata = ABSOLUTE(.);
*(.data)