diff --git a/arch/c5471/src/up_assert.c b/arch/c5471/src/up_assert.c index c2d1d82ee9f..6edc2c4dfe0 100644 --- a/arch/c5471/src/up_assert.c +++ b/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/arch/c5471/src/up_internal.h b/arch/c5471/src/up_internal.h index ec801b17fab..c50a78483eb 100644 --- a/arch/c5471/src/up_internal.h +++ b/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/arch/dm320/defconfig b/arch/dm320/defconfig index cdf7a4326e3..4bf241ebe86 100644 --- a/arch/dm320/defconfig +++ b/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/arch/dm320/src/up_assert.c b/arch/dm320/src/up_assert.c index 49b88c1ddfa..8080d899324 100644 --- a/arch/dm320/src/up_assert.c +++ b/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/arch/dm320/src/up_dataabort.c b/arch/dm320/src/up_dataabort.c index ca1ade72385..007d4acfcf2 100644 --- a/arch/dm320/src/up_dataabort.c +++ b/arch/dm320/src/up_dataabort.c @@ -39,6 +39,8 @@ #include #include +#include +#include #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/arch/dm320/src/up_internal.h b/arch/dm320/src/up_internal.h index 95d1d2c89d8..7420d30535f 100644 --- a/arch/dm320/src/up_internal.h +++ b/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/arch/dm320/src/up_prefetchabort.c b/arch/dm320/src/up_prefetchabort.c index 7756b7c3515..b6c99fc25cf 100644 --- a/arch/dm320/src/up_prefetchabort.c +++ b/arch/dm320/src/up_prefetchabort.c @@ -39,6 +39,7 @@ #include #include +#include #include #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/examples/README.txt b/examples/README.txt new file mode 100644 index 00000000000..6d3d14e8b3a --- /dev/null +++ b/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/sched/sched_setuptaskfiles.c b/sched/sched_setuptaskfiles.c index 2aee2e3d1f8..9fef59278aa 100644 --- a/sched/sched_setuptaskfiles.c +++ b/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 */