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
This commit is contained in:
patacongo 2007-03-21 20:02:52 +00:00
parent 354501be05
commit b7b7b17b6b
9 changed files with 64 additions and 12 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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
#

View File

@ -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()

View File

@ -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);
}

View File

@ -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

View File

@ -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);
}

19
examples/README.txt Normal file
View File

@ -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

View File

@ -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 */