summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-21 20:02:52 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-21 20:02:52 +0000
commit038192c8c108c106ee6b5d918eabc0c0274b14fa (patch)
tree37eadf8831c330ab0dbccb6ed6dae66ecb4ac89b /nuttx/arch
parentafbd98ac2b65181e668993b3cec6ee372dd0660e (diff)
downloadpx4-nuttx-038192c8c108c106ee6b5d918eabc0c0274b14fa.tar.gz
px4-nuttx-038192c8c108c106ee6b5d918eabc0c0274b14fa.tar.bz2
px4-nuttx-038192c8c108c106ee6b5d918eabc0c0274b14fa.zip
This achieves successful DM320 boot with a minimal system
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@115 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/c5471/src/up_assert.c2
-rw-r--r--nuttx/arch/c5471/src/up_internal.h2
-rw-r--r--nuttx/arch/dm320/defconfig6
-rw-r--r--nuttx/arch/dm320/src/up_assert.c32
-rw-r--r--nuttx/arch/dm320/src/up_dataabort.c4
-rw-r--r--nuttx/arch/dm320/src/up_internal.h2
-rw-r--r--nuttx/arch/dm320/src/up_prefetchabort.c3
7 files changed, 42 insertions, 9 deletions
diff --git a/nuttx/arch/c5471/src/up_assert.c b/nuttx/arch/c5471/src/up_assert.c
index c2d1d82ee..6edc2c4df 100644
--- a/nuttx/arch/c5471/src/up_assert.c
+++ b/nuttx/arch/c5471/src/up_assert.c
@@ -89,7 +89,7 @@ static void up_stackdump(void)
if (rtcb->pid == 0)
{
- stack_base = g_heapbase - CONFIG_PROC_STACK_SIZE;
+ stack_base = g_heapbase - 4;
stack_size = CONFIG_PROC_STACK_SIZE;
}
else
diff --git a/nuttx/arch/c5471/src/up_internal.h b/nuttx/arch/c5471/src/up_internal.h
index ec801b17f..c50a78483 100644
--- a/nuttx/arch/c5471/src/up_internal.h
+++ b/nuttx/arch/c5471/src/up_internal.h
@@ -53,7 +53,7 @@
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
-#undef CONFIG_DUMP_ON_EXIT /* Dumpt task state on exit */
+#undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */
/* LED definitions */
diff --git a/nuttx/arch/dm320/defconfig b/nuttx/arch/dm320/defconfig
index cdf7a4326..4bf241ebe 100644
--- a/nuttx/arch/dm320/defconfig
+++ b/nuttx/arch/dm320/defconfig
@@ -44,9 +44,9 @@
CONFIG_ARCH=dm320
CONFIG_ARCH_DM320=y
CONFIG_ROM_VECTORS=n
-CONFIG_DRAM_START=0x01100000
-CONFIG_DRAM_SIZE=0x02000000
-CONFIG_DRAM_NUTTXENTRY=0x01108000
+CONFIG_DRAM_START=0x01000000
+CONFIG_DRAM_SIZE=0x01000000
+CONFIG_DRAM_NUTTXENTRY=0x01008000
CONFIG_ARCH_STACKDUMP=y
#
diff --git a/nuttx/arch/dm320/src/up_assert.c b/nuttx/arch/dm320/src/up_assert.c
index 49b88c1dd..8080d8993 100644
--- a/nuttx/arch/dm320/src/up_assert.c
+++ b/nuttx/arch/dm320/src/up_assert.c
@@ -83,14 +83,26 @@ static inline uint32 up_getsp(void)
static void up_stackdump(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
- uint32 stack_base = (uint32)rtcb->adj_stack_ptr;
uint32 sp = up_getsp();
+ uint32 stack_base;
+ uint32 stack_size;
+
+ if (rtcb->pid == 0)
+ {
+ stack_base = g_heapbase - 4;
+ stack_size = CONFIG_PROC_STACK_SIZE;
+ }
+ else
+ {
+ stack_base = (uint32)rtcb->adj_stack_ptr;
+ stack_size = (uint32)rtcb->adj_stack_size;
+ }
lldbg("stack_base: %08x\n", stack_base);
- lldbg("stack_size: %08x\n", rtcb->adj_stack_size);
+ lldbg("stack_size: %08x\n", stack_size);
lldbg("sp: %08x\n", sp);
- if (sp >= stack_base || sp < stack_base - rtcb->adj_stack_size)
+ if (sp >= stack_base || sp < stack_base - stack_size)
{
lldbg("ERROR: Stack pointer is not within allocated stack\n");
return;
@@ -107,6 +119,20 @@ static void up_stackdump(void)
ptr[4], ptr[5], ptr[6], ptr[7]);
}
}
+
+ if (current_regs)
+ {
+ int regs;
+
+ for (regs = REG_R0; regs <= REG_R15; regs += 8)
+ {
+ uint32 *ptr = (uint32*)&current_regs[regs];
+ lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ regs, ptr[0], ptr[1], ptr[2], ptr[3],
+ ptr[4], ptr[5], ptr[6], ptr[7]);
+ }
+ lldbg("CPSR: %08x\n", current_regs[REG_CPSR]);
+ }
}
#else
# define up_stackdump()
diff --git a/nuttx/arch/dm320/src/up_dataabort.c b/nuttx/arch/dm320/src/up_dataabort.c
index ca1ade723..007d4acfc 100644
--- a/nuttx/arch/dm320/src/up_dataabort.c
+++ b/nuttx/arch/dm320/src/up_dataabort.c
@@ -39,6 +39,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <debug.h>
+#include <nuttx/irq.h>
#include "os_internal.h"
#include "up_internal.h"
@@ -64,5 +66,7 @@
void up_dataabort(uint32 *regs)
{
+ lldbg("Data abort at 0x%x\n", regs[REG_PC]);
+ current_regs = regs;
PANIC(OSERR_ERREXCEPTION);
}
diff --git a/nuttx/arch/dm320/src/up_internal.h b/nuttx/arch/dm320/src/up_internal.h
index 95d1d2c89..7420d3053 100644
--- a/nuttx/arch/dm320/src/up_internal.h
+++ b/nuttx/arch/dm320/src/up_internal.h
@@ -53,7 +53,7 @@
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
-#undef CONFIG_DUMP_ON_EXIT /* Dumpt task state on exit */
+#undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */
/************************************************************
* Public Types
diff --git a/nuttx/arch/dm320/src/up_prefetchabort.c b/nuttx/arch/dm320/src/up_prefetchabort.c
index 7756b7c35..b6c99fc25 100644
--- a/nuttx/arch/dm320/src/up_prefetchabort.c
+++ b/nuttx/arch/dm320/src/up_prefetchabort.c
@@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <debug.h>
#include <nuttx/irq.h>
#include "os_internal.h"
#include "up_internal.h"
@@ -65,5 +66,7 @@
void up_prefetchabort(uint32 *regs)
{
+ lldbg("Prefetch abort at 0x%x\n", regs[REG_PC]);
+ current_regs = regs;
PANIC(OSERR_ERREXCEPTION);
}