diff --git a/configs/README.txt b/configs/README.txt index 6cb302d245..c18bde3210 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -607,6 +607,23 @@ defconfig -- This is a configuration file similar to the Linux option will enable a limited form of memory mapping that is implemented by copying whole files into memory. + RTC + + 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 "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 CONFIG_SPI_OWNBUS - Set if there is only one active device diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt index 3f260e9a83..f82c2243b6 100755 --- a/configs/stm3210e-eval/README.txt +++ b/configs/stm3210e-eval/README.txt @@ -14,6 +14,7 @@ Contents - DFU - LEDs - Temperature Sensor + - RTC - STM3210E-EVAL-specific Configuration Options - Configurations @@ -264,6 +265,38 @@ commands enumerated in include/nuttx/sensors/lm75.h. Also read the descriptions of the stm32_lm75initialize() and stm32_lm75attach() interfaces in the arch/board/board.h file (sames as configs/stm3210e-eval/include/board.h). +RTC +=== + + The STM32 RTC may configured using the following settings. + + 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 "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 + + In hi-res mode, the STM32 RTC operates only at 16384Hz. Overflow interrupts + are handled when the 32-bit RTC counter overflows every 3 days and 43 minutes. + A BKP register is incremented on each overflow interrupt creating, effectively, + a 48-bit RTC counter. + + In the lo-res mode, the RTC operates at 1Hz. Overflow interrupts are not handled + (because the next overflow is not expected until the year 2106. + + WARNING: Overflow interrupts are lost whenever the STM32 is powered down. The + overflow interrupt may be lost even if the STM32 is powered down only momentarily. + Therefore hi-res solution is only useful in systems where the power is always on. + STM3210E-EVAL-specific Configuration Options ============================================ diff --git a/configs/vsn/src/sif.c b/configs/vsn/src/sif.c index 3c304a3b23..e185d8d0df 100644 --- a/configs/vsn/src/sif.c +++ b/configs/vsn/src/sif.c @@ -712,7 +712,7 @@ int sif_main(int argc, char *argv[]) fprintf(stderr, "%s:\tinit\n\tgpio\tA B\n\tpwr\tval\n", argv[0]); struct timespec t_active; - clock_gettime(CLOCK_REALTIME, &t_active); + clock_gettime(CLOCK_ACTIVETIME, &t_active); fprintf(stderr, "rtc time = %u, active = %u / %u, time / systick = %u / %u\n", up_rtc_time(), t_active.tv_sec, t_active.tv_nsec,