mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
arch/delays: Invalid default value for BOARD_LOOPSPERMSEC
Changes the default value for CONFIG_BOARD_LOOPSPERMSEC to -1, which is invalid. All boards that forget to configure this value will encounter a static assertion at compile time, enforcing that configurations upstreamed to NuttX have calibrated values for correct delay timings. Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the busy-loop delay implementation and thus only have a run-time check to ensure proper delay-timings (in the case where delays are used before the alarm/timer driver is registered). Some boards already in the NuttX upstream do not have calibrated values, but there are no users who currently own the board to submit a calibrated value for the configurations to use. In this scenario, the value is temporarily set to 0 and a warning is displayed so that users of these boards are informed of the calibration process. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
committed by
Alan C. Assis
parent
629a9d4ace
commit
2d768c294e
+4
-3
@@ -1365,11 +1365,12 @@ comment "Board Settings"
|
|||||||
|
|
||||||
config BOARD_LOOPSPERMSEC
|
config BOARD_LOOPSPERMSEC
|
||||||
int "Delay loops per millisecond"
|
int "Delay loops per millisecond"
|
||||||
default 5000
|
default -1
|
||||||
---help---
|
---help---
|
||||||
Simple delay loops are used by some logic, especially during boot-up,
|
Simple delay loops are used by some logic, especially during boot-up,
|
||||||
driver initialization. These delay loops must be calibrated for each
|
driver initialization. These delay loops must be calibrated for each
|
||||||
board in order to assure accurate timing by the delay loops.
|
board in order to assure accurate timing by the delay loops. You can
|
||||||
|
do so with `calib_udelay` (EXAMPLES_CALIB_UDELAY).
|
||||||
|
|
||||||
comment "Interrupt options"
|
comment "Interrupt options"
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "at32_pwr.h"
|
#include "at32_pwr.h"
|
||||||
#include "hardware/at32f43xxx_rcc.h"
|
#include "hardware/at32f43xxx_rcc.h"
|
||||||
@@ -37,6 +39,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -44,6 +44,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow 2 milliseconds for the IRC16M to become ready. */
|
/* Allow 2 milliseconds for the IRC16M to become ready. */
|
||||||
|
|
||||||
#define IRC16M_STARTUP_TIMEOUT (2 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define IRC16M_STARTUP_TIMEOUT (2 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|||||||
@@ -46,6 +46,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
|
|
||||||
/* This file supports only the STM32 F2 family (although it is identical to
|
/* This file supports only the STM32 F2 family (although it is identical to
|
||||||
@@ -34,6 +36,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "itm_syslog.h"
|
#include "itm_syslog.h"
|
||||||
@@ -36,6 +38,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -91,12 +91,17 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "hardware/stm32g4xxxx_pwr.h"
|
#include "hardware/stm32g4xxxx_pwr.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#if (STM32_SYSCLK_SW == RCC_CFGR_SW_HSE)
|
#if (STM32_SYSCLK_SW == RCC_CFGR_SW_HSE)
|
||||||
# define USE_HSE
|
# define USE_HSE
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -54,6 +54,9 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become
|
/* Allow up to 100 milliseconds for the high speed clock to become
|
||||||
* ready. that is a very long delay, but if the clock does not become
|
* ready. that is a very long delay, but if the clock does not become
|
||||||
* ready we are hosed anyway. Normally this is very fast, but I have
|
* ready we are hosed anyway. Normally this is very fast, but I have
|
||||||
|
|||||||
@@ -24,12 +24,17 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become
|
/* Allow up to 100 milliseconds for the high speed clock to become
|
||||||
* ready. that is a very long delay, but if the clock does not become
|
* ready. that is a very long delay, but if the clock does not become
|
||||||
* ready we are hosed anyway. Normally this is very fast, but I have
|
* ready we are hosed anyway. Normally this is very fast, but I have
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
|
|
||||||
#include "hardware/stm32_syscfg.h"
|
#include "hardware/stm32_syscfg.h"
|
||||||
@@ -32,6 +34,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "arm_internal.h"
|
#include "arm_internal.h"
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
@@ -34,6 +36,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
#ifdef CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY
|
#ifdef CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY
|
||||||
|
|||||||
@@ -43,6 +43,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -24,12 +24,17 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "stm32_dbgmcu.h"
|
#include "stm32_dbgmcu.h"
|
||||||
|
|
||||||
@@ -31,6 +33,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "arm_internal.h"
|
#include "arm_internal.h"
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
@@ -34,6 +36,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
#ifdef CONFIG_STM32H5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
#ifdef CONFIG_STM32H5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
||||||
|
|||||||
@@ -40,6 +40,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define PWR_TIMEOUT (10 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define PWR_TIMEOUT (10 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -43,6 +43,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
#include <arch/stm32h5/chip.h>
|
#include <arch/stm32h5/chip.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "stm32_flash.h"
|
#include "stm32_flash.h"
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
@@ -37,6 +39,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "arm_internal.h"
|
#include "arm_internal.h"
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
@@ -35,6 +37,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
#ifdef CONFIG_STM32H7_RTC_LSECLOCK_START_DRV_CAPABILITY
|
#ifdef CONFIG_STM32H7_RTC_LSECLOCK_START_DRV_CAPABILITY
|
||||||
|
|||||||
@@ -43,6 +43,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "hardware/stm32_axi.h"
|
#include "hardware/stm32_axi.h"
|
||||||
#include "hardware/stm32_syscfg.h"
|
#include "hardware/stm32_syscfg.h"
|
||||||
@@ -32,6 +34,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "hardware/stm32_axi.h"
|
#include "hardware/stm32_axi.h"
|
||||||
#include "hardware/stm32_syscfg.h"
|
#include "hardware/stm32_syscfg.h"
|
||||||
@@ -32,6 +34,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -59,6 +59,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <arch/stm32l4/chip.h>
|
#include <arch/stm32l4/chip.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32l4_pwr.h"
|
#include "stm32l4_pwr.h"
|
||||||
#include "stm32l4_flash.h"
|
#include "stm32l4_flash.h"
|
||||||
#include "stm32l4_hsi48.h"
|
#include "stm32l4_hsi48.h"
|
||||||
@@ -35,6 +37,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <arch/stm32l4/chip.h>
|
#include <arch/stm32l4/chip.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32l4_pwr.h"
|
#include "stm32l4_pwr.h"
|
||||||
#include "stm32l4_flash.h"
|
#include "stm32l4_flash.h"
|
||||||
|
|
||||||
@@ -34,6 +36,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <arch/stm32l4/chip.h>
|
#include <arch/stm32l4/chip.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32l4_pwr.h"
|
#include "stm32l4_pwr.h"
|
||||||
#include "stm32l4_flash.h"
|
#include "stm32l4_flash.h"
|
||||||
#include "stm32l4_hsi48.h"
|
#include "stm32l4_hsi48.h"
|
||||||
@@ -35,6 +37,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <arch/stm32l4/chip.h>
|
#include <arch/stm32l4/chip.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32l4_pwr.h"
|
#include "stm32l4_pwr.h"
|
||||||
#include "stm32l4_flash.h"
|
#include "stm32l4_flash.h"
|
||||||
#include "stm32l4_hsi48.h"
|
#include "stm32l4_hsi48.h"
|
||||||
@@ -35,6 +37,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
#include <arch/stm32l5/chip.h>
|
#include <arch/stm32l5/chip.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32l5_pwr.h"
|
#include "stm32l5_pwr.h"
|
||||||
#include "stm32l5_flash.h"
|
#include "stm32l5_flash.h"
|
||||||
#include "stm32l5_rcc.h"
|
#include "stm32l5_rcc.h"
|
||||||
@@ -36,6 +38,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "arm_internal.h"
|
#include "arm_internal.h"
|
||||||
#include "stm32l5_pwr.h"
|
#include "stm32l5_pwr.h"
|
||||||
#include "stm32l5_rcc.h"
|
#include "stm32l5_rcc.h"
|
||||||
@@ -35,6 +37,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
||||||
|
|||||||
@@ -44,6 +44,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "arm_internal.h"
|
#include "arm_internal.h"
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
@@ -35,6 +37,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
#ifdef CONFIG_STM32U5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
#ifdef CONFIG_STM32U5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
||||||
|
|||||||
@@ -40,6 +40,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define PWR_TIMEOUT (10 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define PWR_TIMEOUT (10 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -44,6 +44,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
#include <arch/stm32u5/chip.h>
|
#include <arch/stm32u5/chip.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "stm32_pwr.h"
|
#include "stm32_pwr.h"
|
||||||
#include "stm32_flash.h"
|
#include "stm32_flash.h"
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
@@ -36,6 +38,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway. Normally this is very fast, but I have seen at least one
|
* hosed anyway. Normally this is very fast, but I have seen at least one
|
||||||
|
|||||||
@@ -44,6 +44,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
/* Allow up to 100 milliseconds for the high speed clock to become ready.
|
||||||
* that is a very long delay, but if the clock does not become ready we are
|
* that is a very long delay, but if the clock does not become ready we are
|
||||||
* hosed anyway.
|
* hosed anyway.
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "arm_internal.h"
|
#include "arm_internal.h"
|
||||||
|
|
||||||
#include "stm32wl5_pwr.h"
|
#include "stm32wl5_pwr.h"
|
||||||
@@ -36,6 +38,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
#ifdef CONFIG_STM32WL5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
#ifdef CONFIG_STM32WL5_RTC_LSECLOCK_START_DRV_CAPABILITY
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
||||||
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
||||||
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
||||||
|
|||||||
@@ -36,7 +36,13 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_BOARD_LOOPSPERMSEC
|
/* If no value is given, we proceed with 0 since a one-shot timer is used for
|
||||||
|
* accurate delays. A runtime DEBUGASSERT catches the case where the one-shot
|
||||||
|
* timer lower-half isn't registered in time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if CONFIG_BOARD_LOOPSPERMSEC == -1
|
||||||
|
# undef CONFIG_BOARD_LOOPSPERMSEC
|
||||||
# define CONFIG_BOARD_LOOPSPERMSEC 0
|
# define CONFIG_BOARD_LOOPSPERMSEC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,13 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_BOARD_LOOPSPERMSEC
|
/* If no value is given, we proceed with 0 since a timer is used for accurate
|
||||||
|
* delays. A runtime DEBUGASSERT catches the case where the timer lower-half
|
||||||
|
* isn't registered in time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if CONFIG_BOARD_LOOPSPERMSEC == -1
|
||||||
|
# undef CONFIG_BOARD_LOOPSPERMSEC
|
||||||
# define CONFIG_BOARD_LOOPSPERMSEC 0
|
# define CONFIG_BOARD_LOOPSPERMSEC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ set(SRCS
|
|||||||
# don't want the weak references to conflict.
|
# don't want the weak references to conflict.
|
||||||
|
|
||||||
if(NOT CONFIG_TIMER_ARCH AND NOT CONFIG_ALARM_ARCH)
|
if(NOT CONFIG_TIMER_ARCH AND NOT CONFIG_ALARM_ARCH)
|
||||||
list(APPEND SRCS delay.c)
|
list(APPEND SRCS clock_delay.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_CLOCK_TIMEKEEPING)
|
if(CONFIG_CLOCK_TIMEKEEPING)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ CSRCS += clock_notifier.c
|
|||||||
|
|
||||||
ifneq ($(CONFIG_TIMER_ARCH),y)
|
ifneq ($(CONFIG_TIMER_ARCH),y)
|
||||||
ifneq ($(CONFIG_ALARM_ARCH),y)
|
ifneq ($(CONFIG_ALARM_ARCH),y)
|
||||||
CSRCS += delay.c
|
CSRCS += clock_delay.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* sched/clock/delay.c
|
* sched/clock/clock_delay.c
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
@@ -56,6 +56,20 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#if defined(CONFIG_BOARD_LOOPSPERMSEC) && CONFIG_BOARD_LOOPSPERMSEC == 0
|
||||||
|
#warning \
|
||||||
|
"CONFIG_BOARD_LOOPSPERMSEC is set to 0 even though this architecture does" \
|
||||||
|
"not rely on timer or alarm drivers for correct timings. up_udelay() and " \
|
||||||
|
"similar delay functions will not work correctly. Please determine an " \
|
||||||
|
"appropriate value for CONFIG_BOARD_LOOPSPERMSEC using the calib_udelay " \
|
||||||
|
"application in nuttx-apps. If this configuration is a NuttX provided " \
|
||||||
|
"configuration, it would be appreciated if you submit a patch with the " \
|
||||||
|
"new value to apache/nuttx."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
|
||||||
|
"Configure BOARD_LOOPSPERMSEC to non-default value.");
|
||||||
|
|
||||||
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
||||||
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
||||||
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
||||||
Reference in New Issue
Block a user