From d212c46891d73fec2a1bbc4069d5fecfc360b8f1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 12 Aug 2011 22:10:48 +0000 Subject: Add Kinesis watchdog, ramfuncs, idle loop, start of clock configuration git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3875 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/kinetis/kinetis_start.c | 31 ++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'nuttx/arch/arm/src/kinetis/kinetis_start.c') diff --git a/nuttx/arch/arm/src/kinetis/kinetis_start.c b/nuttx/arch/arm/src/kinetis/kinetis_start.c index eab678760..403424da2 100755 --- a/nuttx/arch/arm/src/kinetis/kinetis_start.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_start.c @@ -99,6 +99,10 @@ void __start(void) const uint32_t *src; uint32_t *dest; + /* Disable the watchdog timer */ + + kinetis_wddisable(); + /* Configure the uart so that we can get debug output as soon as possible */ kinetis_clockconfig(); @@ -127,22 +131,41 @@ void __start(void) } showprogress('C'); + /* Copy any necessary code sections from FLASH to RAM. The correct + * destination in SRAM is geive by _sramfuncs and _eramfuncs. The + * temporary location is in flash after the data initalization code + * at _framfuncs + */ + +#ifndef CONFIG_BOOT_RAMFUNCS + for (src = &_framfuncs, dest = &_sramfuncs; dest < &_eramfuncs; ) + { + *dest++ = *src++; + } +#endif + showprogress('E'); + + /* Perform early serial initialization */ #ifdef CONFIG_USE_EARLYSERIALINIT up_earlyserialinit(); #endif - showprogress('D'); + showprogress('F'); /* Initialize onboard resources */ kinetis_boardinitialize(); - showprogress('E'); + showprogress('G'); + showprogress('\r'); + showprogress('\n'); + + /* Show reset status */ + + dbg("Reset status: %02x:%02x\n", getreg8(KINETIS_SMC_SRSH), getreg8(KINETIS_SMC_SRSL)); /* Then start NuttX */ - showprogress('\r'); - showprogress('\n'); os_start(); /* Shouldn't get here */ -- cgit v1.2.3