summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/kinetis/kinetis_start.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-12 22:10:48 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-12 22:10:48 +0000
commitd212c46891d73fec2a1bbc4069d5fecfc360b8f1 (patch)
tree401de244f5464fd9d593cc676395702d0510f915 /nuttx/arch/arm/src/kinetis/kinetis_start.c
parent8e8fff821c980d0f4c5577367395b9c309383bbf (diff)
downloadnuttx-d212c46891d73fec2a1bbc4069d5fecfc360b8f1.tar.gz
nuttx-d212c46891d73fec2a1bbc4069d5fecfc360b8f1.tar.bz2
nuttx-d212c46891d73fec2a1bbc4069d5fecfc360b8f1.zip
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
Diffstat (limited to 'nuttx/arch/arm/src/kinetis/kinetis_start.c')
-rwxr-xr-xnuttx/arch/arm/src/kinetis/kinetis_start.c31
1 files changed, 27 insertions, 4 deletions
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 */