diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs
index 1fc0c18299c225c1453ef76da11189cc6528a1d9..402a3253308b490ea7ccaae51552066aad12afed 100644
--- a/arch/arm/src/stm32/Make.defs
+++ b/arch/arm/src/stm32/Make.defs
@@ -57,7 +57,7 @@ CHIP_CSRCS	= stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c \
 		  stm32_gpio.c  stm32_exti.c stm32_flash.c stm32_irq.c \
 		  stm32_timerisr.c stm32_dma.c stm32_lowputc.c stm32_serial.c \
 		  stm32_spi.c stm32_usbdev.c stm32_sdio.c stm32_tim.c stm32_i2c.c \
-		  stm32_pwr.c stm32_idle.c stm32_waste.c
+		  stm32_idle.c stm32_waste.c
 
 ifeq ($(CONFIG_STM32_ETHMAC),y)
 CHIP_CSRCS	+= stm32_eth.c
@@ -67,6 +67,10 @@ ifeq ($(CONFIG_STM32_RCCLOCK),y)
 CHIP_CSRCS	+= stm32_rcclock.c
 endif
 
+ifeq ($(CONFIG_STM32_PWR),y)
+CHIP_CSRCS	+= stm32_pwr.c
+endif
+
 ifeq ($(CONFIG_RTC),y)
 CHIP_CSRCS	+= stm32_rtc.c
 endif
diff --git a/arch/arm/src/stm32/chip/stm32_exti.h b/arch/arm/src/stm32/chip/stm32_exti.h
index 31b50136dad7c889bf4077596528fd077ed88174..d3fb6b3fe2cb306cb4a6562abe282a70cc6f46b8 100644
--- a/arch/arm/src/stm32/chip/stm32_exti.h
+++ b/arch/arm/src/stm32/chip/stm32_exti.h
@@ -99,7 +99,7 @@
 #  define EXTI_OTGHS_WAKEUP      (1 << 20) /* EXTI line 20 is connected to the USB OTG HS Wakeup event */
 #  define EXTI_RTC_TAMPER        (1 << 21) /* EXTI line 21 is connected to the RTC Tamper and TimeStamp events */
 #  define EXTI_RTC_TIMESTAMP     (1 << 22) /* EXTI line 21 is connected to the RTC Tamper and TimeStamp events */
-#  define EXTI_RTC_WAKEUP        (1 << 23) /* EXTI line 22 is connected to the RTC Wakeup event
+#  define EXTI_RTC_WAKEUP        (1 << 23) /* EXTI line 22 is connected to the RTC Wakeup event */
 #endif
 
 /* Interrupt mask register */
diff --git a/arch/arm/src/stm32/stm32f40xxx_rtc.c b/arch/arm/src/stm32/stm32f40xxx_rtc.c
index e249dc27b4b5d34c519853325b55be1953c582db..7eb1a896b16321cedacbd330cfe9d6a852fe50d9 100644
--- a/arch/arm/src/stm32/stm32f40xxx_rtc.c
+++ b/arch/arm/src/stm32/stm32f40xxx_rtc.c
@@ -43,6 +43,9 @@
 #include <nuttx/irq.h>
 #include <nuttx/rtc.h>
 
+#include <time.h>
+#include <errno.h>
+
 #include <arch/board/board.h>
 
 #include "up_arch.h"
@@ -61,10 +64,14 @@
 #  error "CONFIG_RTC_DATETIME must be set to use this driver"
 #endif
 
-#ifndef CONFIG_RTC_HIRES
+#ifdef CONFIG_RTC_HIRES
 #  error "CONFIG_RTC_HIRES must NOT be set with this driver"
 #endif
 
+#ifndef CONFIG_STM32_PWR
+#  error "CONFIG_STM32_PWR must selected to use this driver"
+#endif
+
 /* Constants ************************************************************************/
 
 #define SYNCHRO_TIMEOUT  (0x00020000)
@@ -226,24 +233,25 @@ static int rtc_enterinit(void)
 
   ret = OK;
   if ((regval & RTC_ISR_INITF) == 0)
-  {
-    /* Set the Initialization mode */
+    {
+      /* Set the Initialization mode */
 
-    putreg32(RTC_ISR_INIT, STM32_RTC_ISR);
+      putreg32(RTC_ISR_INIT, STM32_RTC_ISR);
     
-    /* Wait until the RTC is in the INIT state (or a timeout occurs) */
+      /* Wait until the RTC is in the INIT state (or a timeout occurs) */
  
-    ret = -ETIMEDOUT;
-    for (timeout = 0; timeout < INITMODE_TIMEOUT; timeout++)
-      {
-        regval = getreg32(STM32_RTC_ISR);
-        if ((regval & RTC_ISR_INITF) != 0)
-          {
-            ret = OK;
-            break;
-          }
-      }
-    
+      ret = -ETIMEDOUT;
+      for (timeout = 0; timeout < INITMODE_TIMEOUT; timeout++)
+        {
+          regval = getreg32(STM32_RTC_ISR);
+          if ((regval & RTC_ISR_INITF) != 0)
+            {
+              ret = OK;
+              break;
+            }
+        }
+    }
+
   return ret;  
 }
 
@@ -357,7 +365,7 @@ static int rtc_setup(void)
 
       /* Set Initialization mode */
 
-      ret = rtc_enterinit()
+      ret = rtc_enterinit();
       if (ret == OK)
         {
           /* Set the 24 hour format by clearing the FMT bit in the RTC
@@ -365,7 +373,7 @@ static int rtc_setup(void)
            */
 
           regval = getreg32(STM32_RTC_CR);
-          regval &= ~RTC_CR_FMT
+          regval &= ~RTC_CR_FMT;
           putreg32(regval, STM32_RTC_CR);
 
           /* Configure RTC pre-scaler to the required, default values for
@@ -405,7 +413,9 @@ static int rtc_setup(void)
 
 static int rtc_resume(void)
 {
+#ifdef CONFIG_RTC_ALARM
   uint32_t regval;
+#endif
   int ret;
 
   /* Wait for the RTC Time and Date registers to be syncrhonized with RTC APB
@@ -473,6 +483,7 @@ static int rtc_interrupt(int irq, void *context)
 int up_rtcinitialize(void)
 {
   uint32_t regval;
+  int ret;
 
   /* Clocking for the PWR block must be provided.  However, this is done
    * unconditionally in stm32f40xxx_rcc.c on power up.  This done unconditionally
@@ -551,7 +562,7 @@ int up_rtcinitialize(void)
  *
  ************************************************************************************/
 
-int up_rtc_getdatetime(FAR const struct tm *tp)
+int up_rtc_getdatetime(FAR struct tm *tp)
 {
   uint32_t dr;
   uint32_t tr;
@@ -575,13 +586,13 @@ int up_rtc_getdatetime(FAR const struct tm *tp)
    * register.
    */
 
-  tmp = (uint8_t)(tr & (RTC_TR_SU_MASK|RTC_TR_ST_MASK)) >> RTC_TR_SU_SHIFT;
+  tmp = (tr & (RTC_TR_SU_MASK|RTC_TR_ST_MASK)) >> RTC_TR_SU_SHIFT;
   tp->tm_sec = rtc_bcd2bin(tmp);
 
-  tmp = (tr & RTC_TR_MNU_MASK|RTC_TR_MNT_MASK) >> RTC_TR_MNU_SHIFT;
+  tmp = (tr & (RTC_TR_MNU_MASK|RTC_TR_MNT_MASK)) >> RTC_TR_MNU_SHIFT;
   tp->tm_min = rtc_bcd2bin(tmp);
 
-  tmp = (tr & RTC_TR_HU_MASK|RTC_TR_HT_MASK) >> RTC_TR_HU_SHIFT;
+  tmp = (tr & (RTC_TR_HU_MASK|RTC_TR_HT_MASK)) >> RTC_TR_HU_SHIFT;
   tp->tm_hour = rtc_bcd2bin(tmp);
 
   /* Now convert the RTC date to fields in struct tm format:
@@ -593,13 +604,13 @@ int up_rtc_getdatetime(FAR const struct tm *tp)
    * years 2000-2099?  I'll assume so.
    */
 
-  tmp = (dr & RTC_DR_DU_MASK|RTC_DR_DT_MASK) >> RTC_DR_DU_SHIFT;
+  tmp = (dr & (RTC_DR_DU_MASK|RTC_DR_DT_MASK)) >> RTC_DR_DU_SHIFT;
   tp->tm_mday = rtc_bcd2bin(tmp);
 
-  tmp = (dr & RTC_DR_MU_MASK|RTC_DR_MT) >> RTC_DR_MU_SHIFT;
+  tmp = (dr & (RTC_DR_MU_MASK|RTC_DR_MT)) >> RTC_DR_MU_SHIFT;
   tp->tm_mon = rtc_bcd2bin(tmp) - 1;
 
-  tmp = (dr & RTC_DR_YU_MASK|RTC_DR_YT_MASK) >> RTC_DR_YU_SHIFT; /* Year units, BCD 0-99 */
+  tmp = (dr & (RTC_DR_YU_MASK|RTC_DR_YT_MASK)) >> RTC_DR_YU_SHIFT;
   tp->tm_year = rtc_bcd2bin(tmp) + 100;
   return OK;
 }
@@ -637,9 +648,9 @@ int up_rtc_settime(FAR const struct timespec *tp)
    * register.
    */
 
-  tr = (rtc_bin2bcd(tp->tm_sec)  << RTC_TR_SU_SHIFT) |
-       (rtc_bin2bcd(tp->tm_min)  << RTC_TR_MNU_SHIFT) |
-       (rtc_bin2bcd(tp->tm_hour) << RTC_TR_HU_SHIFT);
+  tr = (rtc_bin2bcd(newtime.tm_sec)  << RTC_TR_SU_SHIFT) |
+       (rtc_bin2bcd(newtime.tm_min)  << RTC_TR_MNU_SHIFT) |
+       (rtc_bin2bcd(newtime.tm_hour) << RTC_TR_HU_SHIFT);
   tr &= ~RTC_TR_RESERVED_BITS;
 
   /* Now convert the fields in struct tm format to the RTC date register fields:
@@ -651,9 +662,9 @@ int up_rtc_settime(FAR const struct timespec *tp)
    * years 2000-2099?  I'll assume so.
    */
 
-  dr = (rtc_bin2bcd(tp->tm_mday) << RTC_DR_DU_SHIFT) |
-       ((rtc_bin2bcd(tp->tm_mon) + 1)  << RTC_DR_MU_SHIFT) |
-       ((rtc_bin2bcd(tp->tm_year) - 100) << RTC_DR_YU_SHIFT);
+  dr = (rtc_bin2bcd(newtime.tm_mday) << RTC_DR_DU_SHIFT) |
+       ((rtc_bin2bcd(newtime.tm_mon) + 1)  << RTC_DR_MU_SHIFT) |
+       ((rtc_bin2bcd(newtime.tm_year) - 100) << RTC_DR_YU_SHIFT);
   dr &= ~RTC_DR_RESERVED_BITS;
 
   /* Disable the write protection for RTC registers */
@@ -662,7 +673,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
 
   /* Set Initialization mode */
 
-  ret = rtc_enterinit()
+  ret = rtc_enterinit();
   if (ret == OK)
     {
       /* Set the RTC TR and DR registers */
@@ -674,7 +685,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
        * registers to be synchronized with RTC APB clock.
        */
 
-      rtc_enterinit()
+      rtc_exitinit();
       ret = rtc_synchwait();
     }
 
diff --git a/configs/README.txt b/configs/README.txt
index 46b41d1aba72d38ce524f2f742c43de73a95daed..3ed5d256353a932cffc0a31a760cad9f124975c4 100644
--- a/configs/README.txt
+++ b/configs/README.txt
@@ -609,20 +609,29 @@ defconfig -- This is a configuration file similar to the Linux
 
 	RTC
 
-		CONFIG_RTC - Enables general support for a hardware RTC. Specific
+		CONFIG_RTC - Enables general support for a hardware RTC.  Specific
 		  architectures may require other specific settings.
-		CONFIG_RTC_HIRES - The typical RTC keeps time to resolution of 1
-		  second, usually supporting a 32-bit time_t value.  In this case,
-		  the RTC is used to &quot;seed&quot; the normal NuttX timer and the
-		  NuttX timer provides for higher resoution time. If CONFIG_RTC_HIRES
-		  is enabled in the NuttX configuration, then the RTC provides higher
-		  resolution time and completely replaces the system timer for purpose of
-		  date and time.
-		  CONFIG_RTC_FREQUENCY - If CONFIG_RTC_HIRES is defined, then the
-		  frequency of the high resolution RTC must be provided.  If CONFIG_RTC_HIRES
-		  is not defined, CONFIG_RTC_FREQUENCY is assumed to be one.
-		CONFIG_RTC_ALARM - Enable if the RTC hardware supports setting of an alarm. 
-		  A callback function will be executed when the alarm goes off
+		CONFIG_RTC_DATETIME - There are two general types of RTC:  (1) A simple
+		  battery backed counter that keeps the time when power is down, and (2)
+		   A full date / time RTC the provides the date and time information, often
+		  in BCD format.  If CONFIG_RTC_DATETIME is selected, it specifies this
+		  second kind of RTC. In this case, the RTC is used to "seed" the normal
+		  NuttX timer and the NuttX system timer provides for higher resoution
+		  time.
+		CONFIG_RTC_HIRES - If CONFIG_RTC_DATETIME not selected, then the simple,
+		  battery backed counter is used.  There are two different implementations
+		  of such simple counters based on the time resolution of the counter:
+		  The typical RTC keeps time to resolution of 1 second, usually
+		  supporting a 32-bit time_t value.  In this case, the RTC is used to
+		  "seed" the normal NuttX timer and the NuttX timer provides for higher
+		  resoution time. If CONFIG_RTC_HIRES is enabled in the NuttX configuration,
+		  then the RTC provides higher resolution time and completely replaces the
+		  system timer for purpose of date and time.
+		CONFIG_RTC_FREQUENCY - If CONFIG_RTC_HIRES is defined, then the frequency
+		  of the high resolution RTC must be provided.  If CONFIG_RTC_HIRES is
+		  not defined, CONFIG_RTC_FREQUENCY is assumed to be one.
+		CONFIG_RTC_ALARM - Enable if the RTC hardware supports setting of an
+		  alarm.  A callback function will be executed when the alarm goes off
 
 	SPI driver
 
diff --git a/configs/stm3240g-eval/README.txt b/configs/stm3240g-eval/README.txt
index a840e16991e60426607003739e1306c1d01a3d76..3368ef1fb7caf9c2f7b3bf260e709db9eb6f2411 100755
--- a/configs/stm3240g-eval/README.txt
+++ b/configs/stm3240g-eval/README.txt
@@ -335,6 +335,7 @@ STM3240G-EVAL-specific Configuration Options
 	CONFIG_STM32_CAN1
 	CONFIG_STM32_CAN2
 	CONFIG_STM32_DAC
+	CONFIG_STM32_PWR -- Required for RTC
 
 	APB2
 	----
diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig
index a3bdd3f32ea836e82e452cbd5cdabd9b8f67c879..c2f3440f39f62d60b0239dd7789999f38b182de0 100755
--- a/configs/stm3240g-eval/dhcpd/defconfig
+++ b/configs/stm3240g-eval/dhcpd/defconfig
@@ -161,6 +161,7 @@ CONFIG_STM32_I2C3=n
 CONFIG_STM32_CAN1=n
 CONFIG_STM32_CAN2=n
 CONFIG_STM32_DAC=n
+CONFIG_STM32_PWR=n
 # APB2:
 CONFIG_STM32_TIM1=n
 CONFIG_STM32_TIM8=n
@@ -754,6 +755,39 @@ CONFIG_NET_BROADCAST=y
 CONFIG_NET_DHCP_LIGHT=n
 CONFIG_NET_RESOLV_ENTRIES=4
 
+#
+# RTC Configuration
+#
+# CONFIG_RTC - Enables general support for a hardware RTC.  Specific
+#   architectures may require other specific settings.
+# CONFIG_RTC_DATETIME - There are two general types of RTC:  (1) A simple
+#   battery backed counter that keeps the time when power is down, and (2)
+#    A full date / time RTC the provides the date and time information, often
+#   in BCD format.  If CONFIG_RTC_DATETIME is selected, it specifies this
+#   second kind of RTC. In this case, the RTC is used to "seed" the normal
+#   NuttX timer and the NuttX system timer provides for higher resoution
+#   time.
+# CONFIG_RTC_HIRES - If CONFIG_RTC_DATETIME not selected, then the simple,
+#   battery backed counter is used.  There are two different implementations
+#   of such simple counters based on the time resolution of the counter:
+#   The typical RTC keeps time to resolution of 1 second, usually
+#   supporting a 32-bit time_t value.  In this case, the RTC is used to
+#   "seed" the normal NuttX timer and the NuttX timer provides for higher
+#   resoution time. If CONFIG_RTC_HIRES is enabled in the NuttX configuration,
+#   then the RTC provides higher resolution time and completely replaces the
+#   system timer for purpose of date and time.
+# CONFIG_RTC_FREQUENCY - If CONFIG_RTC_HIRES is defined, then the frequency
+#  of the high resolution RTC must be provided.  If CONFIG_RTC_HIRES is
+#   not defined, CONFIG_RTC_FREQUENCY is assumed to be one.
+# CONFIG_RTC_ALARM - Enable if the RTC hardware supports setting of an
+#  alarm.  A callback function will be executed when the alarm goes off
+#
+CONFIG_RTC=n
+CONFIG_RTC_DATETIME=y
+CONFIG_RTC_HIRES=n
+CONFIG_RTC_FREQUENCY=n
+CONFIG_RTC_ALARM=n
+
 #
 # USB Device Configuration
 #
diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig
index 7399ea9ed4a2a16828fd9f478ecfc2f64e965571..94b8075db947733a9aba1134f5ac9b326dc4efd5 100755
--- a/configs/stm3240g-eval/nettest/defconfig
+++ b/configs/stm3240g-eval/nettest/defconfig
@@ -161,6 +161,7 @@ CONFIG_STM32_I2C3=n
 CONFIG_STM32_CAN1=n
 CONFIG_STM32_CAN2=n
 CONFIG_STM32_DAC=n
+CONFIG_STM32_PWR=n
 # APB2:
 CONFIG_STM32_TIM1=n
 CONFIG_STM32_TIM8=n
@@ -754,6 +755,39 @@ CONFIG_NET_BROADCAST=n
 CONFIG_NET_DHCP_LIGHT=n
 CONFIG_NET_RESOLV_ENTRIES=4
 
+#
+# RTC Configuration
+#
+# CONFIG_RTC - Enables general support for a hardware RTC.  Specific
+#   architectures may require other specific settings.
+# CONFIG_RTC_DATETIME - There are two general types of RTC:  (1) A simple
+#   battery backed counter that keeps the time when power is down, and (2)
+#    A full date / time RTC the provides the date and time information, often
+#   in BCD format.  If CONFIG_RTC_DATETIME is selected, it specifies this
+#   second kind of RTC. In this case, the RTC is used to "seed" the normal
+#   NuttX timer and the NuttX system timer provides for higher resoution
+#   time.
+# CONFIG_RTC_HIRES - If CONFIG_RTC_DATETIME not selected, then the simple,
+#   battery backed counter is used.  There are two different implementations
+#   of such simple counters based on the time resolution of the counter:
+#   The typical RTC keeps time to resolution of 1 second, usually
+#   supporting a 32-bit time_t value.  In this case, the RTC is used to
+#   "seed" the normal NuttX timer and the NuttX timer provides for higher
+#   resoution time. If CONFIG_RTC_HIRES is enabled in the NuttX configuration,
+#   then the RTC provides higher resolution time and completely replaces the
+#   system timer for purpose of date and time.
+# CONFIG_RTC_FREQUENCY - If CONFIG_RTC_HIRES is defined, then the frequency
+#  of the high resolution RTC must be provided.  If CONFIG_RTC_HIRES is
+#   not defined, CONFIG_RTC_FREQUENCY is assumed to be one.
+# CONFIG_RTC_ALARM - Enable if the RTC hardware supports setting of an
+#  alarm.  A callback function will be executed when the alarm goes off
+#
+CONFIG_RTC=n
+CONFIG_RTC_DATETIME=y
+CONFIG_RTC_HIRES=n
+CONFIG_RTC_FREQUENCY=n
+CONFIG_RTC_ALARM=n
+
 #
 # USB Device Configuration
 #
diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig
index cc98db02aa227ebce711fdcf9609f4cb620c5dc3..ca378376030cc1fded31d50e05f7d60da625e66c 100755
--- a/configs/stm3240g-eval/nsh/defconfig
+++ b/configs/stm3240g-eval/nsh/defconfig
@@ -161,6 +161,7 @@ CONFIG_STM32_I2C3=n
 CONFIG_STM32_CAN1=n
 CONFIG_STM32_CAN2=n
 CONFIG_STM32_DAC=n
+CONFIG_STM32_PWR=n
 # APB2:
 CONFIG_STM32_TIM1=n
 CONFIG_STM32_TIM8=n
@@ -758,6 +759,39 @@ CONFIG_NET_BROADCAST=n
 CONFIG_NET_DHCP_LIGHT=n
 CONFIG_NET_RESOLV_ENTRIES=4
 
+#
+# RTC Configuration
+#
+# CONFIG_RTC - Enables general support for a hardware RTC.  Specific
+#   architectures may require other specific settings.
+# CONFIG_RTC_DATETIME - There are two general types of RTC:  (1) A simple
+#   battery backed counter that keeps the time when power is down, and (2)
+#    A full date / time RTC the provides the date and time information, often
+#   in BCD format.  If CONFIG_RTC_DATETIME is selected, it specifies this
+#   second kind of RTC. In this case, the RTC is used to "seed" the normal
+#   NuttX timer and the NuttX system timer provides for higher resoution
+#   time.
+# CONFIG_RTC_HIRES - If CONFIG_RTC_DATETIME not selected, then the simple,
+#   battery backed counter is used.  There are two different implementations
+#   of such simple counters based on the time resolution of the counter:
+#   The typical RTC keeps time to resolution of 1 second, usually
+#   supporting a 32-bit time_t value.  In this case, the RTC is used to
+#   "seed" the normal NuttX timer and the NuttX timer provides for higher
+#   resoution time. If CONFIG_RTC_HIRES is enabled in the NuttX configuration,
+#   then the RTC provides higher resolution time and completely replaces the
+#   system timer for purpose of date and time.
+# CONFIG_RTC_FREQUENCY - If CONFIG_RTC_HIRES is defined, then the frequency
+#  of the high resolution RTC must be provided.  If CONFIG_RTC_HIRES is
+#   not defined, CONFIG_RTC_FREQUENCY is assumed to be one.
+# CONFIG_RTC_ALARM - Enable if the RTC hardware supports setting of an
+#  alarm.  A callback function will be executed when the alarm goes off
+#
+CONFIG_RTC=n
+CONFIG_RTC_DATETIME=y
+CONFIG_RTC_HIRES=n
+CONFIG_RTC_FREQUENCY=n
+CONFIG_RTC_ALARM=n
+
 #
 # USB Device Configuration
 #
diff --git a/configs/stm3240g-eval/ostest/defconfig b/configs/stm3240g-eval/ostest/defconfig
index f45820bf9fb094d1ef4f48e0212a37568f6f200b..8acda4c6bfd7ede902a25b3b8eca334a9f2d4b4e 100755
--- a/configs/stm3240g-eval/ostest/defconfig
+++ b/configs/stm3240g-eval/ostest/defconfig
@@ -161,6 +161,7 @@ CONFIG_STM32_I2C3=n
 CONFIG_STM32_CAN1=n
 CONFIG_STM32_CAN2=n
 CONFIG_STM32_DAC=n
+CONFIG_STM32_PWR=n
 # APB2:
 CONFIG_STM32_TIM1=n
 CONFIG_STM32_TIM8=n
@@ -714,6 +715,39 @@ CONFIG_NET_BROADCAST=n
 CONFIG_NET_DHCP_LIGHT=n
 CONFIG_NET_RESOLV_ENTRIES=4
 
+#
+# RTC Configuration
+#
+# CONFIG_RTC - Enables general support for a hardware RTC.  Specific
+#   architectures may require other specific settings.
+# CONFIG_RTC_DATETIME - There are two general types of RTC:  (1) A simple
+#   battery backed counter that keeps the time when power is down, and (2)
+#    A full date / time RTC the provides the date and time information, often
+#   in BCD format.  If CONFIG_RTC_DATETIME is selected, it specifies this
+#   second kind of RTC. In this case, the RTC is used to "seed" the normal
+#   NuttX timer and the NuttX system timer provides for higher resoution
+#   time.
+# CONFIG_RTC_HIRES - If CONFIG_RTC_DATETIME not selected, then the simple,
+#   battery backed counter is used.  There are two different implementations
+#   of such simple counters based on the time resolution of the counter:
+#   The typical RTC keeps time to resolution of 1 second, usually
+#   supporting a 32-bit time_t value.  In this case, the RTC is used to
+#   "seed" the normal NuttX timer and the NuttX timer provides for higher
+#   resoution time. If CONFIG_RTC_HIRES is enabled in the NuttX configuration,
+#   then the RTC provides higher resolution time and completely replaces the
+#   system timer for purpose of date and time.
+# CONFIG_RTC_FREQUENCY - If CONFIG_RTC_HIRES is defined, then the frequency
+#  of the high resolution RTC must be provided.  If CONFIG_RTC_HIRES is
+#   not defined, CONFIG_RTC_FREQUENCY is assumed to be one.
+# CONFIG_RTC_ALARM - Enable if the RTC hardware supports setting of an
+#  alarm.  A callback function will be executed when the alarm goes off
+#
+CONFIG_RTC=n
+CONFIG_RTC_DATETIME=y
+CONFIG_RTC_HIRES=n
+CONFIG_RTC_FREQUENCY=n
+CONFIG_RTC_ALARM=n
+
 #
 # USB Device Configuration
 #
diff --git a/include/nuttx/rtc.h b/include/nuttx/rtc.h
index 30aa7ce85ee7bd3bda4544f12961cc17f189cbbd..46a7c8a2ffe7caaa1ea988383682ff5e6af2cfa9 100644
--- a/include/nuttx/rtc.h
+++ b/include/nuttx/rtc.h
@@ -217,7 +217,7 @@ EXTERN int up_rtc_gettime(FAR struct timespec *tp);
  ************************************************************************************/
 
 #ifdef CONFIG_RTC_DATETIME
-EXTERN int up_rtc_getdatetime(FAR const struct tm *tp);
+EXTERN int up_rtc_getdatetime(FAR struct tm *tp);
 #endif
 
 /************************************************************************************