Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1308,11 +1308,12 @@ comment "Board Settings"

config BOARD_LOOPSPERMSEC
int "Delay loops per millisecond"
default 5000
default -1
---help---
Simple delay loops are used by some logic, especially during boot-up,
driver initialization. These delay loops must be calibrated for each
board in order to assure accurate timing by the delay loops.
driver initialization. These delay loops must be calibrated for each
board in order to assure accurate timing by the delay loops. You can
do so with `calib_udelay` (EXAMPLES_CALIB_UDELAY).

comment "Interrupt options"

Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/at32/at32_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway.
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/at32/at32f43xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/gd32f4/gd32f4xx_rcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* Allow 2 milliseconds for the IRC16M to become ready. */

#define IRC16M_STARTUP_TIMEOUT (2 * CONFIG_BOARD_LOOPSPERMSEC)
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway.
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32f10xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32f20xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32f30xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32f33xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32f37xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32f40xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32g4xxxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@
# define USE_HSI
#endif

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

#if (STM32_SYSCLK_SW == RCC_CFGR_SW_PLL)
# define USE_PLL
# define PLLRDY_TIMEOUT (100 * CONFIG_BOARD_LOOPSPERMSEC)
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32/stm32l15xxx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f0l0g0/stm32_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
# endif
#endif

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway.
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f0l0g0/stm32c0_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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 hosed anyway. Normally this is very fast, but I have
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f0l0g0/stm32g0_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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 hosed anyway. Normally this is very fast, but I have
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f0l0g0/stm32l0_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f7/stm32_lse.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)

#ifdef CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f7/stm32_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway.
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32f7/stm32f72xx73xx_rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

/* 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
* hosed anyway. Normally this is very fast, but I have seen at least one
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/src/stm32h5/stm32_lse.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
* Pre-processor Definitions
****************************************************************************/

/* Ensure that LOOPSPERMSEC is not the default, invalid value. If it is, let
* the user know that they need to change it and then calibrate it.
*/

static_assert(
CONFIG_BOARD_LOOPSPERMSEC >= 0,
"Please set a non-negative value for CONFIG_BOARD_LOOPSPERMSEC to pass "
"compilation. It is recommended that after your initial build, you use "
"the example 'calib_udelay' to get a precise value for this option. "
"Please search the NuttX documentation for calib_udelay for more "
"information.");

#define LSERDY_TIMEOUT (500 * CONFIG_BOARD_LOOPSPERMSEC)

#ifdef CONFIG_STM32H5_RTC_LSECLOCK_START_DRV_CAPABILITY
Expand Down
Loading
Loading