Merged in david_s5/nuttx/master_h7 (pull request #1002)

stm32h7 RTC and friends  support

* stm32h7:Removed f7 in file path

* stm32f7:Fix overwritten IRQ enabled

       System boot order calls clock_initialize then up_initalize.
       clock_initialize was setting up the alarm IRQ
       up_initalize is initializing the NVIC.

       This most likely worked in the past due to a bug in the
       NVIC init code that failed to clear the Interrupt enables.
       That was fixed in 510b0f7e arch/arm/src: Correct all ARMv7-M
       architectures.  Interrupts were not be disabled correctly
       on power up.

* stm32h7:Ported over F7 RTC

* nucleo-h743zi:Add RTC

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
David Sidrane
2019-08-17 14:01:28 +00:00
committed by Gregory Nutt
parent 4383ef6787
commit 1bbf5c9449
19 changed files with 4210 additions and 24 deletions
@@ -1,8 +1,9 @@
/************************************************************************************
* boards/nucleo-h743zi/src/nucleo-h743zi.h
*
# Copyright (C) 2017 Gwenhael Goavec-Merou. All rights reserved.
# Author: Gwenhael Goavec-Merou<gwenhael.goavec-merou@trabucayre.com>
# Copyright (C) 2017, 2019 Gwenhael Goavec-Merou. All rights reserved.
# Authors: Gwenhael Goavec-Merou<gwenhael.goavec-merou@trabucayre.com>
* David Sidrane <david.sidrane@nscdg.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -59,6 +60,7 @@
# endif
#endif
#define HAVE_RTC_DRIVER 1
/* Configuration ********************************************************************/
/* LED
*
@@ -50,6 +50,11 @@
# include <nuttx/input/buttons.h>
#endif
#ifdef HAVE_RTC_DRIVER
# include <nuttx/timers/rtc.h>
# include "stm32_rtc.h"
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -133,6 +138,9 @@ static void stm32_i2ctool(void)
int stm32_bringup(void)
{
int ret = OK;
#ifdef HAVE_RTC_DRIVER
FAR struct rtc_lowerhalf_s *lower;
#endif
UNUSED(ret);
@@ -160,6 +168,32 @@ int stm32_bringup(void)
}
#endif /* CONFIG_FS_PROCFS */
#ifdef HAVE_RTC_DRIVER
/* Instantiate the STM32 lower-half RTC driver */
lower = stm32_rtc_lowerhalf();
if (!lower)
{
syslog(LOG_ERR,
"ERROR: Failed to instantiate the RTC lower-half driver\n");
return -ENOMEM;
}
else
{
/* Bind the lower half driver and register the combined RTC driver
* as /dev/rtc0
*/
ret = rtc_initialize(0, lower);
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Failed to bind/register the RTC driver: %d\n", ret);
return ret;
}
}
#endif
#ifdef CONFIG_BUTTONS
/* Register the BUTTON driver */