diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-21 20:02:52 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-21 20:02:52 +0000 |
commit | 038192c8c108c106ee6b5d918eabc0c0274b14fa (patch) | |
tree | 37eadf8831c330ab0dbccb6ed6dae66ecb4ac89b | |
parent | afbd98ac2b65181e668993b3cec6ee372dd0660e (diff) | |
download | px4-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
-rw-r--r-- | nuttx/arch/c5471/src/up_assert.c | 2 | ||||
-rw-r--r-- | nuttx/arch/c5471/src/up_internal.h | 2 | ||||
-rw-r--r-- | nuttx/arch/dm320/defconfig | 6 | ||||
-rw-r--r-- | nuttx/arch/dm320/src/up_assert.c | 32 | ||||
-rw-r--r-- | nuttx/arch/dm320/src/up_dataabort.c | 4 | ||||
-rw-r--r-- | nuttx/arch/dm320/src/up_internal.h | 2 | ||||
-rw-r--r-- | nuttx/arch/dm320/src/up_prefetchabort.c | 3 | ||||
-rw-r--r-- | nuttx/examples/README.txt | 19 | ||||
-rw-r--r-- | nuttx/sched/sched_setuptaskfiles.c | 6 |
9 files changed, 64 insertions, 12 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*)¤t_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); } diff --git a/nuttx/examples/README.txt b/nuttx/examples/README.txt new file mode 100644 index 000000000..6d3d14e8b --- /dev/null +++ b/nuttx/examples/README.txt @@ -0,0 +1,19 @@ +examples +^^^^^^^^ + +examples/ostest + + This is the NuttX 'qualification' suite. It attempts to exercise + a broad set of OS functionality. Its coverage is not very extensive + as of this writing, but it is used to qualify each NuttX release. + +examples/nsh + + This directory containst the NuttShell (NSH). This is a primitive + shell-like application. With some additional development, NSH will + someday be a great NuttX application debugger. + +examples/null + + This is the do nothing application. It is only used for bringing + up new NuttX architectures diff --git a/nuttx/sched/sched_setuptaskfiles.c b/nuttx/sched/sched_setuptaskfiles.c index 2aee2e3d1..9fef59278 100644 --- a/nuttx/sched/sched_setuptaskfiles.c +++ b/nuttx/sched/sched_setuptaskfiles.c @@ -76,6 +76,7 @@ int sched_setuptaskfiles(FAR _TCB *tcb) FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; int i; #endif /* CONFIG_DEV_CONSOLE */ + int ret = OK; /* Allocate file descriptors for the TCB */ @@ -101,11 +102,10 @@ int sched_setuptaskfiles(FAR _TCB *tcb) #if CONFIG_NFILE_STREAMS > 0 /* Allocate file streams for the TCB */ - return sched_setupstreams(tcb); -#else - return OK; + ret = sched_setupstreams(tcb); #endif /* CONFIG_NFILE_STREAMS */ #endif /* CONFIG_DEV_CONSOLE */ + return ret; } #endif /* CONFIG_NFILE_DESCRIPTORS */ |