This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 2887a81ece617edbdcd907be72886616dfe530cf Author: raiden00pl <[email protected]> AuthorDate: Mon Oct 12 09:53:31 2026 +0200 boards/arm: use the common board initialization on Nucleo boards Call stm32_common_initialize() from the bringup logic of all STM32 Nucleo boards, so the watchdogs are registered the same way on every board. The board specific IWDG registration of nucleo-c071rb, nucleo-c092rc, nucleo-h563zi, nucleo-h743zi and nucleo-u083rc is replaced by the common one. Also add the missing blank line after a declaration in the nucleo-h743zi2 and nucleo-h753zi bringup, reported by nxstyle for the touched files. Signed-off-by: raiden00pl <[email protected]> Assisted-by: Claude Code --- boards/arm/stm32c0/nucleo-c071rb/src/stm32_bringup.c | 16 ++++++++-------- boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c | 16 ++++++++-------- boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32f1/nucleo-f103rb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32f2/nucleo-f207zg/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c | 10 ++++++++++ boards/arm/stm32f3/nucleo-f303ze/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f3/nucleo-f334r8/src/stm32_boot.c | 10 ++++++++++ boards/arm/stm32f4/nucleo-f401re/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f4/nucleo-f410rb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32f4/nucleo-f411re/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c | 11 +++++++++++ boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32g0/nucleo-g070rb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32g0/nucleo-g071rb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32g0/nucleo-g0b1re/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32g4/nucleo-g431kb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32g4/nucleo-g474re/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c | 15 ++++++++------- boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c | 20 ++++++++++---------- .../arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c | 12 ++++++++++++ boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c | 12 ++++++++++++ boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c | 10 ++++++++++ boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c | 10 ++++++++++ boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c | 11 +++++++++++ .../arm/stm32n6/nucleo-n657x0-q/src/stm32_bringup.c | 13 ++++++++++++- boards/arm/stm32u0/nucleo-u083rc/src/stm32_bringup.c | 16 ++++++++-------- .../arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c | 15 ++++++++++++++- .../arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c | 11 +++++++++++ boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c | 10 ++++++++++ boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c | 10 ++++++++++ 48 files changed, 498 insertions(+), 43 deletions(-) diff --git a/boards/arm/stm32c0/nucleo-c071rb/src/stm32_bringup.c b/boards/arm/stm32c0/nucleo-c071rb/src/stm32_bringup.c index 0cd7562b6da..3349de674ec 100644 --- a/boards/arm/stm32c0/nucleo-c071rb/src/stm32_bringup.c +++ b/boards/arm/stm32c0/nucleo-c071rb/src/stm32_bringup.c @@ -38,10 +38,6 @@ # include <nuttx/leds/userled.h> #endif -#ifdef CONFIG_STM32_IWDG -# include <stm32_wdg.h> -#endif - #ifdef CONFIG_SENSORS_QENCODER # include "board_qencoder.h" #endif @@ -57,6 +53,7 @@ #include <arch/board/board.h> #include "nucleo-c071rb.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -81,11 +78,14 @@ int stm32_bringup(void) { int ret; -#ifdef CONFIG_STM32_IWDG - /* Initialize the watchdog timer */ + /* Initialize the board features common to all STM32 boards */ - stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY); -#endif + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } #if defined(CONFIG_CDCACM) && !defined(CONFIG_CDCACM_CONSOLE) /* Register the CDC/ACM device at boot. */ diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c index 90a04f6850f..6c3f4eda847 100644 --- a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c +++ b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c @@ -39,10 +39,6 @@ # include <nuttx/leds/userled.h> #endif -#ifdef CONFIG_STM32_IWDG -# include <stm32_wdg.h> -#endif - #ifdef CONFIG_PULSECOUNT # include "stm32_pulsecount.h" #endif @@ -58,6 +54,7 @@ #include <arch/board/board.h> #include "nucleo-c092rc.h" +#include "board_common.h" #include "stm32_can_setup.h" #include "stm32_cansock_setup.h" @@ -87,11 +84,14 @@ int stm32_bringup(void) #endif int ret; -#ifdef CONFIG_STM32_IWDG - /* Initialize the watchdog timer */ + /* Initialize the board features common to all STM32 boards */ - stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY); -#endif + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } #ifdef CONFIG_PULSECOUNT /* Initialize and register the pulse count driver. */ diff --git a/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c b/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c index b615ecdae62..d84c84abdfc 100644 --- a/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c +++ b/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c @@ -32,6 +32,8 @@ #include <nuttx/board.h> #include <nuttx/input/buttons.h> +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -40,6 +42,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS ret = mount(NULL, "/proc", "procfs", 0, NULL); if (ret < 0) diff --git a/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c b/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c index 43149b3c8bf..ce06f09b1cc 100644 --- a/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c +++ b/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c @@ -35,6 +35,7 @@ #include "stm32_i2c.h" #include "nucleo-f072rb.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -71,6 +72,15 @@ int stm32_bringup(void) #endif int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c b/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c index 0a1f1e5eba1..874918c193b 100644 --- a/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c +++ b/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c @@ -32,6 +32,7 @@ #include <nuttx/fs/fs.h> #include "nucleo-f091rc.h" +#include "board_common.h" /**************************************************************************** * Public Functions @@ -52,6 +53,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32f1/nucleo-f103rb/src/stm32_bringup.c b/boards/arm/stm32f1/nucleo-f103rb/src/stm32_bringup.c index d4583edc58e..d0c48314202 100644 --- a/boards/arm/stm32f1/nucleo-f103rb/src/stm32_bringup.c +++ b/boards/arm/stm32f1/nucleo-f103rb/src/stm32_bringup.c @@ -44,6 +44,7 @@ #endif #include "nucleo-f103rb.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -74,6 +75,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_INPUT_BUTTONS /* Register the BUTTON driver */ diff --git a/boards/arm/stm32f2/nucleo-f207zg/src/stm32_bringup.c b/boards/arm/stm32f2/nucleo-f207zg/src/stm32_bringup.c index 1927f3bca09..25ad7a02d1f 100644 --- a/boards/arm/stm32f2/nucleo-f207zg/src/stm32_bringup.c +++ b/boards/arm/stm32f2/nucleo-f207zg/src/stm32_bringup.c @@ -36,6 +36,8 @@ # include <nuttx/input/buttons.h> #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -55,6 +57,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_ADC /* Initialize ADC and register the ADC driver. */ diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c index b0c19bfe349..bac0e07171e 100644 --- a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c +++ b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c @@ -50,6 +50,7 @@ #endif #include "nucleo-f302r8.h" +#include "board_common.h" #include "stm32_can_setup.h" #include "stm32_cansock_setup.h" @@ -87,6 +88,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_INPUT_BUTTONS /* Register the BUTTON driver */ diff --git a/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c b/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c index 73c767c5131..b9594df78c4 100644 --- a/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c +++ b/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c @@ -34,6 +34,7 @@ #include <nuttx/leds/userled.h> #include "nucleo-f303re.h" +#include "board_common.h" #include "stm32_can_setup.h" /**************************************************************************** @@ -113,6 +114,15 @@ void board_late_initialize(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32f3/nucleo-f303ze/src/stm32_bringup.c b/boards/arm/stm32f3/nucleo-f303ze/src/stm32_bringup.c index 3daad9db6c2..08ca6ed54df 100644 --- a/boards/arm/stm32f3/nucleo-f303ze/src/stm32_bringup.c +++ b/boards/arm/stm32f3/nucleo-f303ze/src/stm32_bringup.c @@ -36,6 +36,8 @@ # include <nuttx/input/buttons.h> #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -55,6 +57,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #ifdef CONFIG_ADC diff --git a/boards/arm/stm32f3/nucleo-f334r8/src/stm32_boot.c b/boards/arm/stm32f3/nucleo-f334r8/src/stm32_boot.c index 69051c8f1b3..a357170c870 100644 --- a/boards/arm/stm32f3/nucleo-f334r8/src/stm32_boot.c +++ b/boards/arm/stm32f3/nucleo-f334r8/src/stm32_boot.c @@ -34,6 +34,7 @@ #include <nuttx/leds/userled.h> #include "nucleo-f334r8.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -106,6 +107,15 @@ void board_late_initialize(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32f4/nucleo-f401re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f401re/src/stm32_bringup.c index 224f1ead6d9..32e83027f0e 100644 --- a/boards/arm/stm32f4/nucleo-f401re/src/stm32_bringup.c +++ b/boards/arm/stm32f4/nucleo-f401re/src/stm32_bringup.c @@ -61,6 +61,8 @@ # define HAVE_LEDS 1 #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,6 +82,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32f4/nucleo-f410rb/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f410rb/src/stm32_bringup.c index 53c3ee92501..42deb24066d 100644 --- a/boards/arm/stm32f4/nucleo-f410rb/src/stm32_bringup.c +++ b/boards/arm/stm32f4/nucleo-f410rb/src/stm32_bringup.c @@ -35,6 +35,7 @@ #include <stm32.h> #include "nucleo-f410rb.h" +#include "board_common.h" /**************************************************************************** * Public Functions @@ -55,6 +56,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_ADC /* Initialize ADC and register the ADC driver. */ diff --git a/boards/arm/stm32f4/nucleo-f411re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f411re/src/stm32_bringup.c index 5d0025fdac2..798b5ddb639 100644 --- a/boards/arm/stm32f4/nucleo-f411re/src/stm32_bringup.c +++ b/boards/arm/stm32f4/nucleo-f411re/src/stm32_bringup.c @@ -61,6 +61,8 @@ # define HAVE_LEDS 1 #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,6 +82,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c index 695de2977b5..310a5c88794 100644 --- a/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c +++ b/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c @@ -37,6 +37,8 @@ # include "stm32_usbhost.h" #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -56,6 +58,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST) /* Initialize USB host operation. stm32_usbhost_initialize() starts a * thread will monitor for USB connection and disconnection events. diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c b/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c index 656da24f967..13b1853844a 100644 --- a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c +++ b/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c @@ -51,6 +51,8 @@ # include "stm32_i2c.h" #endif +#include "board_common.h" + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -140,6 +142,15 @@ void board_late_initialize(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c index eec5ccad89e..6875792c45a 100644 --- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c +++ b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c @@ -68,6 +68,7 @@ # include "stm32_romfs.h" #endif #include "nucleo-f446re.h" +#include "board_common.h" #include "stm32_can_setup.h" #include "stm32_cansock_setup.h" @@ -93,6 +94,15 @@ int stm32_bringup(void) #endif int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c index 6339b20c21f..f9ef15cbfd0 100644 --- a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c +++ b/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c @@ -60,6 +60,8 @@ # include <semaphore.h> #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -86,6 +88,15 @@ int stm32_bringup(void) #endif #endif + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c index 15e119321c8..f1dca28d61a 100644 --- a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c +++ b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c @@ -64,6 +64,8 @@ # include <semaphore.h> #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -90,6 +92,15 @@ int stm32_bringup(void) #endif #endif + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c index 8f705ee31e1..cf1e12f6592 100644 --- a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c +++ b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c @@ -64,6 +64,8 @@ # include <nuttx/input/buttons.h> #endif +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -83,6 +85,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_INPUT_BUTTONS /* Register the BUTTON driver */ diff --git a/boards/arm/stm32g0/nucleo-g070rb/src/stm32_bringup.c b/boards/arm/stm32g0/nucleo-g070rb/src/stm32_bringup.c index 8ca8dd171b8..a7b6c885f33 100644 --- a/boards/arm/stm32g0/nucleo-g070rb/src/stm32_bringup.c +++ b/boards/arm/stm32g0/nucleo-g070rb/src/stm32_bringup.c @@ -35,6 +35,7 @@ #include "nucleo-g070rb.h" #include "stm32_i2c.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -129,6 +130,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32g0/nucleo-g071rb/src/stm32_bringup.c b/boards/arm/stm32g0/nucleo-g071rb/src/stm32_bringup.c index d36512d8e58..3d1ecc18306 100644 --- a/boards/arm/stm32g0/nucleo-g071rb/src/stm32_bringup.c +++ b/boards/arm/stm32g0/nucleo-g071rb/src/stm32_bringup.c @@ -33,6 +33,7 @@ #include <nuttx/leds/userled.h> #include "nucleo-g071rb.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -69,6 +70,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32g0/nucleo-g0b1re/src/stm32_bringup.c b/boards/arm/stm32g0/nucleo-g0b1re/src/stm32_bringup.c index ac8455443ae..73c23eb3348 100644 --- a/boards/arm/stm32g0/nucleo-g0b1re/src/stm32_bringup.c +++ b/boards/arm/stm32g0/nucleo-g0b1re/src/stm32_bringup.c @@ -38,6 +38,7 @@ #include <arch/board/board.h> #include "nucleo-g0b1re.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -74,6 +75,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #if defined(CONFIG_CDCACM) && !defined(CONFIG_CDCACM_CONSOLE) /* Register the CDC/ACM device at boot. */ diff --git a/boards/arm/stm32g4/nucleo-g431kb/src/stm32_bringup.c b/boards/arm/stm32g4/nucleo-g431kb/src/stm32_bringup.c index c20ef2f5cdd..d7c08a044e6 100644 --- a/boards/arm/stm32g4/nucleo-g431kb/src/stm32_bringup.c +++ b/boards/arm/stm32g4/nucleo-g431kb/src/stm32_bringup.c @@ -36,6 +36,7 @@ #endif #include "nucleo-g431kb.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -66,6 +67,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c index 32568131db3..a1d9321114d 100644 --- a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c +++ b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c @@ -45,6 +45,7 @@ #endif #include "nucleo-g431rb.h" +#include "board_common.h" #include "stm32_can_setup.h" #include "stm32_cansock_setup.h" @@ -77,6 +78,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32g4/nucleo-g474re/src/stm32_bringup.c b/boards/arm/stm32g4/nucleo-g474re/src/stm32_bringup.c index 89d86a499fe..9d3f836fccb 100644 --- a/boards/arm/stm32g4/nucleo-g474re/src/stm32_bringup.c +++ b/boards/arm/stm32g4/nucleo-g474re/src/stm32_bringup.c @@ -34,6 +34,7 @@ #include <nuttx/usb/cdcacm.h> #include "nucleo-g474re.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -64,6 +65,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #if defined(HAVE_LEDS) /* Register the LED driver */ diff --git a/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c index 914d3977df4..22c3de49afd 100644 --- a/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c +++ b/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c @@ -38,6 +38,8 @@ #include <arch/board/board.h> +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -57,6 +59,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c index 3162519fc6e..f6207256b0e 100644 --- a/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c +++ b/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c @@ -38,6 +38,8 @@ #include <arch/board/board.h> +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -57,6 +59,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c index 9ad3289aaf8..398526a4a48 100644 --- a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c +++ b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c @@ -38,9 +38,7 @@ #include <arch/board/board.h> -#ifdef CONFIG_STM32_IWDG -# include "stm32_wdg.h" -#endif +#include "board_common.h" #include "stm32_can_setup.h" @@ -67,11 +65,14 @@ int stm32_bringup(void) { int ret; -#ifdef CONFIG_STM32_IWDG - /* Initialize the watchdog timer */ + /* Initialize the board features common to all STM32 boards */ - stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY); -#endif + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c index 43d7a676c91..03d5b7dbfb9 100644 --- a/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c @@ -49,6 +49,7 @@ #endif #include "stm32.h" +#include "board_common.h" /**************************************************************************** * Private Functions @@ -131,6 +132,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #if defined(CONFIG_I2C) && defined(CONFIG_SYSTEM_I2CTOOL) diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c index ed614922c43..392b1427b18 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c @@ -63,10 +63,6 @@ # include "stm32_capture.h" #endif -#ifdef CONFIG_STM32_IWDG -# include "stm32_wdg.h" -#endif - #ifdef CONFIG_RNDIS # include <nuttx/usb/rndis.h> #endif @@ -76,6 +72,7 @@ #endif #include "stm32_gpio.h" +#include "board_common.h" /**************************************************************************** * Private Functions @@ -258,6 +255,15 @@ int stm32_bringup(void) struct rtc_lowerhalf_s *lower; #endif + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #if defined(CONFIG_I2C) && defined(CONFIG_SYSTEM_I2CTOOL) @@ -493,11 +499,5 @@ int stm32_bringup(void) #endif /* HAVE_PROGMEM_CHARDEV */ #endif /* CONFIG_MTD */ -#ifdef CONFIG_STM32_IWDG - /* Initialize the watchdog timer */ - - stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY); -#endif - return OK; } diff --git a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c index f526cd6876b..f39257d5a93 100644 --- a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c @@ -57,6 +57,8 @@ # include <nuttx/input/buttons.h> #endif +#include "board_common.h" + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -86,6 +88,15 @@ int stm32_bringup(void) uint8_t *ramstart; #endif + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #ifdef CONFIG_FS_PROCFS @@ -122,6 +133,7 @@ int stm32_bringup(void) /* Initialized the RAM MTD */ struct mtd_dev_s *mtd = rammtd_initialize(ramstart, 128 * 1024); + if (mtd == NULL) { syslog(LOG_ERR, "ERROR: rammtd_initialize failed\n"); diff --git a/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c index aa9ab6abbc6..d94cc6ffeba 100644 --- a/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c @@ -46,6 +46,7 @@ #endif #include "nucleo-h745zi.h" +#include "board_common.h" /**************************************************************************** * Private Functions @@ -91,6 +92,15 @@ int stm32_bringup(void) { int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #ifdef CONFIG_FS_PROCFS diff --git a/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c index 805c1c46368..04a9a3dffc7 100644 --- a/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c @@ -54,6 +54,8 @@ # include <nuttx/input/buttons.h> #endif +#include "board_common.h" + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -80,6 +82,15 @@ int stm32_bringup(void) uint8_t *ramstart; #endif + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #ifdef CONFIG_FS_PROCFS @@ -116,6 +127,7 @@ int stm32_bringup(void) /* Initialized the RAM MTD */ struct mtd_dev_s *mtd = rammtd_initialize(ramstart, 128 * 1024); + if (mtd == NULL) { syslog(LOG_ERR, "ERROR: rammtd_initialize failed\n"); diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c index d833626f973..1def13e400f 100644 --- a/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c +++ b/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c @@ -39,6 +39,7 @@ #endif #include "nucleo-h7s3l8.h" +#include "board_common.h" /**************************************************************************** * Public Functions @@ -59,6 +60,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + UNUSED(ret); #ifdef CONFIG_FS_PROCFS diff --git a/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c index 19eb7ca4858..afc7a6d9e15 100644 --- a/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c +++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c @@ -34,6 +34,7 @@ #include <nuttx/usb/cdcacm.h> #include "nucleo-l073rz.h" +#include "board_common.h" #include "stm32_mfrc522.h" /**************************************************************************** @@ -75,6 +76,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_LEDS /* Register the LED driver */ diff --git a/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c b/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c index 3545cdbafa0..80892d840ed 100644 --- a/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c +++ b/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c @@ -38,6 +38,7 @@ #include "stm32_i2c.h" #include "nucleo-l152re.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -114,6 +115,15 @@ void board_late_initialize(void) struct i2c_master_s *i2c2; #endif + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_STM32_I2C1 /* Get the I2C lower half instance */ diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c index fe5389a2be6..bb23cc493ee 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c @@ -53,6 +53,8 @@ # include "stm32l4_rtc.h" #endif +#include "board_common.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -94,6 +96,15 @@ int stm32_bringup(void) #endif int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_PROC /* Mount the proc filesystem */ diff --git a/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c index 0dcd2af9191..8616fe51e62 100644 --- a/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c @@ -40,6 +40,8 @@ #include <arch/board/board.h> +#include "board_common.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -71,6 +73,15 @@ int stm32_bringup(void) #endif int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c index 0355fb9b0f5..a05231db885 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c @@ -65,6 +65,7 @@ #include "stm32_mpu9250.h" #endif +#include "board_common.h" #include "stm32_can_setup.h" /**************************************************************************** @@ -163,6 +164,15 @@ int stm32_bringup(void) #endif int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_PROC /* Mount the proc filesystem */ diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c index b9133caa56d..05bd260b69a 100644 --- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c @@ -35,6 +35,7 @@ #include <nuttx/leds/userled.h> #include "stm32l4_i2c.h" +#include "board_common.h" /**************************************************************************** * Private Data @@ -72,6 +73,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c b/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c index fb3172cab63..40333ead5e4 100644 --- a/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c +++ b/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c @@ -38,6 +38,8 @@ #include <arch/board/board.h> +#include "board_common.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -61,6 +63,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32n6/nucleo-n657x0-q/src/stm32_bringup.c b/boards/arm/stm32n6/nucleo-n657x0-q/src/stm32_bringup.c index db9bca1a415..c0418957a9b 100644 --- a/boards/arm/stm32n6/nucleo-n657x0-q/src/stm32_bringup.c +++ b/boards/arm/stm32n6/nucleo-n657x0-q/src/stm32_bringup.c @@ -37,6 +37,8 @@ #include <arch/board/board.h> +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -57,9 +59,18 @@ int stm32_bringup(void) { -#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER) int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + +#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER) /* Register the LED driver */ ret = userled_lower_initialize("/dev/userleds"); diff --git a/boards/arm/stm32u0/nucleo-u083rc/src/stm32_bringup.c b/boards/arm/stm32u0/nucleo-u083rc/src/stm32_bringup.c index b51ab8a172d..da493da82db 100644 --- a/boards/arm/stm32u0/nucleo-u083rc/src/stm32_bringup.c +++ b/boards/arm/stm32u0/nucleo-u083rc/src/stm32_bringup.c @@ -38,10 +38,6 @@ # include <nuttx/leds/userled.h> #endif -#ifdef CONFIG_STM32_IWDG -# include <stm32_wdg.h> -#endif - #ifdef CONFIG_TIMER # include <stm32_tim.h> #endif @@ -57,6 +53,7 @@ #include <arch/board/board.h> #include "nucleo-u083rc.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -81,11 +78,14 @@ int stm32_bringup(void) { int ret; -#ifdef CONFIG_STM32_IWDG - /* Initialize the watchdog timer */ + /* Initialize the board features common to all STM32 boards */ - stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY); -#endif + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } #if defined(CONFIG_TIMER) && defined(CONFIG_STM32_TIM6) /* Initialize and register the timer driver - TIM6 */ diff --git a/boards/arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c b/boards/arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c index 199ce1e41a0..3058defac4b 100644 --- a/boards/arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c +++ b/boards/arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c @@ -26,19 +26,32 @@ #include <nuttx/config.h> +#include <syslog.h> + #include <sys/mount.h> #include <nuttx/board.h> +#include "board_common.h" + /**************************************************************************** * Public Functions ****************************************************************************/ int stm32_bringup(void) { -#ifdef CONFIG_FS_PROCFS int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + +#ifdef CONFIG_FS_PROCFS ret = mount(NULL, "/proc", "procfs", 0, NULL); if (ret < 0) { diff --git a/boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c b/boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c index 5cde87263ab..038a58b5460 100644 --- a/boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c +++ b/boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c @@ -54,6 +54,8 @@ struct i2c_master_s *i2c2_m; #endif /* CONFIG_I2C */ +#include "board_common.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -91,6 +93,15 @@ int stm32_bringup(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ diff --git a/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c b/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c index 6420d71a698..5bf0f180286 100644 --- a/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c +++ b/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c @@ -52,6 +52,7 @@ #endif #include "nucleo-wb55rg.h" +#include "board_common.h" /**************************************************************************** * Public Functions @@ -113,6 +114,15 @@ void board_late_initialize(void) #endif int ret = OK; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #ifdef HAVE_PROC /* Mount the proc filesystem */ diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c b/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c index 86454d00062..d76dadb4caa 100644 --- a/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c +++ b/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c @@ -53,6 +53,7 @@ #include "arm_internal.h" #include "nucleo-wl55jc.h" +#include "board_common.h" /**************************************************************************** * Pre-processor Definitions @@ -108,6 +109,15 @@ void board_late_initialize(void) { int ret; + /* Initialize the board features common to all STM32 boards */ + + ret = stm32_common_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_common_initialize() failed: %d\n", + ret); + } + #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2S2) stm32_spidev_initialize(); #endif
