You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/10/14 08:21:13 UTC
(nuttx) branch master updated (f04659a4e83 -> 78ebd3b3c92)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from f04659a4e83 libs/libc/stdio: Flush a line buffered stream at a newline in fwrite().
new 16cbe92937a boards/arm/common/stm32: add common board initialization
new 749a1cc2365 boards/arm/common/stm32: support FDCAN in the common CAN setup
new d805ea1b15f boards/arm/common/stm32: make the MFRC522 SPI bus and reset configurable
new e9b6a5bee92 boards/arm/common/stm32: support STM32L4 in the common CAN and BMP280 setup
new 4b371168af1 boards/arm: enable the common board logic on Nucleo boards
new 2887a81ece6 boards/arm: use the common board initialization on Nucleo boards
new 4497bbee885 boards/arm: mount procfs and tmpfs in the common STM32 board init
new c75e12c0d80 boards/arm: register CAN in the common STM32 board init
new 78ebd3b3c92 Documentation/guides: add STM32 Nucleo standard draft
The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../guides/chip-specific/stm32_nucleo.rst | 55 ++++++++++
Documentation/guides/index.rst | 1 +
boards/Kconfig | 48 ++++++++
.../arm/common/stm32/include/board_common.h | 15 ++-
boards/arm/common/stm32/include/stm32_can_setup.h | 4 +-
.../arm/common/stm32/include/stm32_cansock_setup.h | 3 +-
boards/arm/common/stm32/src/CMakeLists.txt | 8 +-
boards/arm/common/stm32/src/Make.defs | 8 +-
.../stm32/src/board_common.c} | 122 ++++++++++++---------
boards/arm/common/stm32/src/stm32_bmp280.c | 6 +-
boards/arm/common/stm32/src/stm32_can_setup.c | 103 ++++++++++-------
boards/arm/common/stm32/src/stm32_cansock_setup.c | 80 +++++++++-----
boards/arm/common/stm32/src/stm32_mfrc522.c | 20 +++-
.../nucleo-c071rb/configs/adcscope/defconfig | 1 +
.../stm32c0/nucleo-c071rb/configs/nsh/defconfig | 1 +
.../nucleo-c071rb/configs/usb-cdc/defconfig | 1 +
.../arm/stm32c0/nucleo-c071rb/src/stm32_bringup.c | 16 +--
.../stm32c0/nucleo-c092rc/configs/can/defconfig | 1 +
.../nucleo-c092rc/configs/cansock/defconfig | 1 +
.../stm32c0/nucleo-c092rc/configs/nsh/defconfig | 1 +
boards/arm/stm32c0/nucleo-c092rc/include/board.h | 5 +
.../arm/stm32c0/nucleo-c092rc/src/CMakeLists.txt | 9 --
boards/arm/stm32c0/nucleo-c092rc/src/Make.defs | 9 --
.../arm/stm32c0/nucleo-c092rc/src/nucleo-c092rc.h | 31 ------
.../arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c | 36 ++----
boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c | 78 -------------
.../arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c | 68 ------------
.../stm32c5/nucleo-c562re/configs/jumbo/defconfig | 1 +
.../stm32c5/nucleo-c562re/configs/nsh/defconfig | 1 +
.../arm/stm32c5/nucleo-c562re/src/stm32_bringup.c | 13 ++-
.../stm32f0/nucleo-f072rb/configs/nsh/defconfig | 1 +
.../nucleo-f072rb/configs/usb-cdc-uart/defconfig | 1 +
.../arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c | 10 +-
.../stm32f0/nucleo-f091rc/configs/nsh/defconfig | 1 +
.../stm32f0/nucleo-f091rc/configs/sx127x/defconfig | 1 +
.../arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c | 10 +-
.../stm32f1/nucleo-f103rb/configs/adc/defconfig | 1 +
.../stm32f1/nucleo-f103rb/configs/nsh/defconfig | 1 +
.../stm32f1/nucleo-f103rb/configs/pwm/defconfig | 1 +
.../arm/stm32f1/nucleo-f103rb/src/stm32_bringup.c | 10 ++
.../stm32f2/nucleo-f207zg/configs/adc/defconfig | 1 +
.../stm32f2/nucleo-f207zg/configs/nsh/defconfig | 1 +
.../stm32f2/nucleo-f207zg/configs/pwm/defconfig | 1 +
.../arm/stm32f2/nucleo-f207zg/src/stm32_bringup.c | 11 ++
.../stm32f3/nucleo-f302r8/configs/can/defconfig | 1 +
.../nucleo-f302r8/configs/cansock/defconfig | 1 +
.../nucleo-f302r8/configs/highpri/defconfig | 1 +
.../stm32f3/nucleo-f302r8/configs/nsh/defconfig | 1 +
.../arm/stm32f3/nucleo-f302r8/src/CMakeLists.txt | 9 --
boards/arm/stm32f3/nucleo-f302r8/src/Make.defs | 9 --
.../arm/stm32f3/nucleo-f302r8/src/nucleo-f302r8.h | 24 ----
.../arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c | 30 ++---
boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c | 73 ------------
.../arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c | 59 ----------
.../stm32f3/nucleo-f303re/configs/adc/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/can/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/hello/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/nsh/defconfig | 1 +
.../nucleo-f303re/configs/nxlines/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/pwm/defconfig | 1 +
.../nucleo-f303re/configs/serialrx/defconfig | 1 +
.../arm/stm32f3/nucleo-f303re/src/CMakeLists.txt | 4 -
boards/arm/stm32f3/nucleo-f303re/src/Make.defs | 4 -
.../arm/stm32f3/nucleo-f303re/src/nucleo-f303re.h | 12 --
boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c | 20 ++--
boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c | 81 --------------
.../stm32f3/nucleo-f303ze/configs/adc/defconfig | 1 +
.../stm32f3/nucleo-f303ze/configs/nsh/defconfig | 1 +
.../arm/stm32f3/nucleo-f303ze/src/stm32_bringup.c | 11 ++
.../stm32f3/nucleo-f334r8/configs/adc/defconfig | 1 +
.../nucleo-f334r8/configs/highpri/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/nsh/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/spwm1/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/spwm2/defconfig | 1 +
boards/arm/stm32f3/nucleo-f334r8/src/stm32_boot.c | 10 ++
.../stm32f4/nucleo-f401re/configs/nsh/defconfig | 1 +
.../arm/stm32f4/nucleo-f401re/src/stm32_bringup.c | 11 ++
.../stm32f4/nucleo-f410rb/configs/nsh/defconfig | 1 +
.../arm/stm32f4/nucleo-f410rb/src/stm32_bringup.c | 10 ++
.../nucleo-f411re/configs/mcp2515-extid/defconfig | 1 +
.../stm32f4/nucleo-f411re/configs/nsh/defconfig | 1 +
.../arm/stm32f4/nucleo-f411re/src/stm32_bringup.c | 11 ++
.../nucleo-f412zg/configs/coremark/defconfig | 1 +
.../stm32f4/nucleo-f412zg/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f412zg/configs/ostest/defconfig | 1 +
.../arm/stm32f4/nucleo-f412zg/src/nucleo-f412zg.h | 10 --
.../arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c | 22 ++--
.../stm32f4/nucleo-f429zi/configs/netnsh/defconfig | 1 +
.../stm32f4/nucleo-f429zi/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f429zi/configs/trace/defconfig | 1 +
boards/arm/stm32f4/nucleo-f429zi/src/nucleo-144.h | 10 --
boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c | 12 +-
.../stm32f4/nucleo-f446re/configs/adc/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/can/defconfig | 1 +
.../nucleo-f446re/configs/cansock/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/dac/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/gpio/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/jumbo/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/lcd/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/pwm/defconfig | 1 +
.../nucleo-f446re/configs/systemview/defconfig | 1 +
.../arm/stm32f4/nucleo-f446re/src/CMakeLists.txt | 9 --
boards/arm/stm32f4/nucleo-f446re/src/Make.defs | 9 --
.../arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h | 34 ------
.../arm/stm32f4/nucleo-f446re/src/stm32_bringup.c | 31 +-----
boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c | 117 --------------------
.../arm/stm32f4/nucleo-f446re/src/stm32_cansock.c | 85 --------------
.../nucleo-f722ze/configs/composite/defconfig | 1 +
.../stm32f7/nucleo-f722ze/configs/nsh/defconfig | 1 +
.../arm/stm32f7/nucleo-f722ze/src/nucleo-f722ze.h | 10 --
.../arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c | 37 +------
.../stm32f7/nucleo-f746zg/configs/evalos/defconfig | 1 +
.../nucleo-f746zg/configs/lorawan_gw/defconfig | 1 +
.../stm32f7/nucleo-f746zg/configs/nsh/defconfig | 1 +
.../arm/stm32f7/nucleo-f746zg/src/nucleo-f746zg.h | 10 --
.../arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c | 37 +------
.../stm32f7/nucleo-f767zi/configs/evalos/defconfig | 1 +
.../stm32f7/nucleo-f767zi/configs/netnsh/defconfig | 1 +
.../stm32f7/nucleo-f767zi/configs/nsh/defconfig | 1 +
.../arm/stm32f7/nucleo-f767zi/src/nucleo-f767zi.h | 10 --
.../arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c | 47 ++------
.../stm32g0/nucleo-g070rb/configs/nsh/defconfig | 1 +
.../arm/stm32g0/nucleo-g070rb/src/stm32_bringup.c | 10 ++
.../stm32g0/nucleo-g071rb/configs/nsh/defconfig | 1 +
.../arm/stm32g0/nucleo-g071rb/src/stm32_bringup.c | 10 ++
.../stm32g0/nucleo-g0b1re/configs/adc/defconfig | 1 +
.../nucleo-g0b1re/configs/adc_dma/defconfig | 1 +
.../stm32g0/nucleo-g0b1re/configs/nsh/defconfig | 1 +
.../nucleo-g0b1re/configs/usb-cdc/defconfig | 1 +
.../nucleo-g0b1re/configs/usb-clocks/defconfig | 1 +
.../arm/stm32g0/nucleo-g0b1re/src/stm32_bringup.c | 10 ++
.../stm32g4/nucleo-g431kb/configs/comp/defconfig | 1 +
.../stm32g4/nucleo-g431kb/configs/nsh/defconfig | 1 +
.../stm32g4/nucleo-g431kb/configs/pwm/defconfig | 1 +
.../arm/stm32g4/nucleo-g431kb/src/stm32_bringup.c | 10 ++
.../stm32g4/nucleo-g431rb/configs/adc/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/can/defconfig | 1 +
.../nucleo-g431rb/configs/cansock/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/cordic/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/nsh/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/pwm/defconfig | 1 +
.../arm/stm32g4/nucleo-g431rb/src/CMakeLists.txt | 9 --
boards/arm/stm32g4/nucleo-g431rb/src/Make.defs | 9 --
.../arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h | 34 ------
.../arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c | 31 +-----
boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c | 91 ---------------
.../arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c | 59 ----------
.../nucleo-g474re/configs/lpuartnsh/defconfig | 1 +
.../stm32g4/nucleo-g474re/configs/nsh/defconfig | 1 +
.../nucleo-g474re/configs/usbserial/defconfig | 1 +
.../arm/stm32g4/nucleo-g474re/src/stm32_bringup.c | 10 ++
.../stm32h5/nucleo-h503rb/configs/nsh/defconfig | 1 +
.../arm/stm32h5/nucleo-h503rb/src/nucleo-h503rb.h | 10 --
.../arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c | 12 +-
.../stm32h5/nucleo-h533re/configs/nsh/defconfig | 1 +
.../arm/stm32h5/nucleo-h533re/src/nucleo-h533re.h | 10 --
.../arm/stm32h5/nucleo-h533re/src/stm32_bringup.c | 12 +-
.../stm32h5/nucleo-h563zi/configs/adc/defconfig | 1 +
.../nucleo-h563zi/configs/adc_watchdog/defconfig | 1 +
.../nucleo-h563zi/configs/buttons/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/dts/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/fdcan1/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/netnsh/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/nsh/defconfig | 1 +
.../nucleo-h563zi/configs/nshusbnet/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/pwm/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/usbmsc/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/usbnsh/defconfig | 1 +
.../arm/stm32h5/nucleo-h563zi/src/CMakeLists.txt | 4 -
boards/arm/stm32h5/nucleo-h563zi/src/Make.defs | 4 -
.../arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h | 22 ----
.../arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c | 39 +------
boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c | 95 ----------------
.../stm32h7/nucleo-h723zg/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h723zg/configs/nsh/defconfig | 1 +
.../stm32h7/nucleo-h723zg/configs/oa_tc6/defconfig | 1 +
.../arm/stm32h7/nucleo-h723zg/src/nucleo-h723zg.h | 11 --
.../arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c | 21 ++--
.../nucleo-h743zi/configs/capture/defconfig | 1 +
.../nucleo-h743zi/configs/composite/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/nsh/defconfig | 1 +
.../nucleo-h743zi/configs/nxlines_oled/defconfig | 1 +
.../nucleo-h743zi/configs/otg_fs_host/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/pwm/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/rndis/defconfig | 1 +
.../arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h | 11 --
.../arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c | 38 ++-----
.../nucleo-h743zi2/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h743zi2/configs/nsh/defconfig | 1 +
.../stm32h7/nucleo-h743zi2/configs/pysim/defconfig | 1 +
.../nucleo-h743zi2/configs/socketcan/defconfig | 1 +
.../arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c | 17 +--
.../nucleo-h745zi/configs/nsh_cm4/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm4_rptun/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm7/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm7_rptun/defconfig | 1 +
.../nucleo-h745zi/configs/pysim_cm7/defconfig | 1 +
.../arm/stm32h7/nucleo-h745zi/src/nucleo-h745zi.h | 11 --
.../arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c | 15 ++-
.../stm32h7/nucleo-h753zi/configs/crypto/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/nsh/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/pysim/defconfig | 1 +
.../nucleo-h753zi/configs/socketcan/defconfig | 1 +
.../arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c | 17 +--
.../nucleo-h7s3l8/configs/boot-xip/defconfig | 1 +
.../nucleo-h7s3l8/configs/jumbo-xip/defconfig | 1 +
.../nucleo-h7s3l8/configs/nsh-xip/defconfig | 1 +
.../stm32h7/nucleo-h7s3l8/configs/nsh/defconfig | 1 +
.../arm/stm32h7/nucleo-h7s3l8/src/nucleo-h7s3l8.h | 8 --
.../arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c | 15 ++-
.../stm32l0/nucleo-l073rz/configs/nsh/defconfig | 1 +
.../stm32l0/nucleo-l073rz/configs/sx127x/defconfig | 1 +
.../nucleo-l073rz/configs/usb-cdc/defconfig | 1 +
boards/arm/stm32l0/nucleo-l073rz/include/board.h | 6 +
.../arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt | 4 -
boards/arm/stm32l0/nucleo-l073rz/src/Make.defs | 4 -
.../arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h | 15 ---
.../arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c | 11 ++
.../arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c | 97 ----------------
.../stm32l1/nucleo-l152re/configs/lcd/defconfig | 1 +
.../stm32l1/nucleo-l152re/configs/nsh/defconfig | 1 +
.../arm/stm32l1/nucleo-l152re/src/nucleo-l152re.h | 9 --
boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c | 21 ++--
.../stm32l4/nucleo-l432kc/configs/nsh/defconfig | 1 +
.../stm32l4/nucleo-l432kc/configs/spwm/defconfig | 1 +
.../stm32l4/nucleo-l432kc/configs/wgen/defconfig | 1 +
.../arm/stm32l4/nucleo-l432kc/src/nucleo-l432kc.h | 10 --
.../arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c | 13 +--
.../stm32l4/nucleo-l452re/configs/nsh/defconfig | 1 +
.../arm/stm32l4/nucleo-l452re/src/nucleo-l452re.h | 10 --
.../arm/stm32l4/nucleo-l452re/src/stm32_bringup.c | 11 +-
.../stm32l4/nucleo-l476rg/configs/nsh/defconfig | 1 +
.../stm32l4/nucleo-l476rg/configs/nxdemo/defconfig | 1 +
.../arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt | 8 --
boards/arm/stm32l4/nucleo-l476rg/src/Make.defs | 7 --
.../arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h | 23 ----
.../arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c | 111 -------------------
.../arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h | 86 ---------------
.../arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 24 +---
boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c | 96 ----------------
.../stm32l4/nucleo-l496zg/configs/nsh/defconfig | 1 +
boards/arm/stm32l4/nucleo-l496zg/src/nucleo-144.h | 10 --
.../arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c | 11 +-
.../stm32l5/nucleo-l552ze/configs/nsh/defconfig | 1 +
.../arm/stm32l5/nucleo-l552ze/src/nucleo-l552ze.h | 10 --
.../arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c | 12 +-
.../stm32n6/nucleo-n657x0-q/configs/leds/defconfig | 1 +
.../stm32n6/nucleo-n657x0-q/configs/nsh/defconfig | 1 +
.../nucleo-n657x0-q/configs/ostest/defconfig | 1 +
.../stm32n6/nucleo-n657x0-q/src/stm32_bringup.c | 13 ++-
.../stm32u0/nucleo-u083rc/configs/nsh/defconfig | 1 +
.../arm/stm32u0/nucleo-u083rc/src/stm32_bringup.c | 16 +--
.../nucleo-u3c5zi-q/configs/jumbo/defconfig | 1 +
.../stm32u3/nucleo-u3c5zi-q/configs/nsh/defconfig | 1 +
.../stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c | 14 ++-
.../stm32u5/nucleo-u5a5zj-q/configs/nsh/defconfig | 1 +
.../stm32u5/nucleo-u5a5zj-q/src/nucleo-u5a5zj-q.h | 10 --
.../stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c | 12 +-
.../stm32wb/nucleo-wb55rg/configs/ble/defconfig | 1 +
.../stm32wb/nucleo-wb55rg/configs/nimble/defconfig | 1 +
.../stm32wb/nucleo-wb55rg/configs/nsh/defconfig | 1 +
.../arm/stm32wb/nucleo-wb55rg/src/nucleo-wb55rg.h | 10 --
boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c | 16 +--
.../stm32wl5/nucleo-wl55jc/configs/demo/defconfig | 1 +
.../stm32wl5/nucleo-wl55jc/configs/nsh/defconfig | 1 +
.../arm/stm32wl5/nucleo-wl55jc/src/nucleo-wl55jc.h | 11 --
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c | 24 ++--
270 files changed, 891 insertions(+), 2296 deletions(-)
create mode 100644 Documentation/guides/chip-specific/stm32_nucleo.rst
copy arch/arm/src/nrf54l/nrf54l_irq.h => boards/arm/common/stm32/include/board_common.h (81%)
copy boards/arm/{qemu/qemu-armv7r/src/qemu_bringup.c => common/stm32/src/board_common.c} (54%)
delete mode 100644 boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c
delete mode 100644 boards/arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c
delete mode 100644 boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c
delete mode 100644 boards/arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c
delete mode 100644 boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c
delete mode 100644 boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c
delete mode 100644 boards/arm/stm32f4/nucleo-f446re/src/stm32_cansock.c
delete mode 100644 boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c
delete mode 100644 boards/arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c
delete mode 100644 boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c
delete mode 100644 boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
delete mode 100644 boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c
delete mode 100644 boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h
delete mode 100644 boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c
(nuttx) 01/09: boards/arm/common/stm32: add common board initialization
Posted by xi...@apache.org.
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 16cbe92937aea7ea398d3b24edee11ed0c0abe64
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 09:34:44 2026 +0200
boards/arm/common/stm32: add common board initialization
Add stm32_common_initialize() for the initialization shared by STM32
boards that use the common board logic (CONFIG_ARCH_BOARD_COMMON). For
now it registers the IWDG as /dev/watchdog0 and the WWDG as
/dev/watchdog1 when they are enabled.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/arm/common/stm32/include/board_common.h | 46 ++++++++++++++++++
boards/arm/common/stm32/src/CMakeLists.txt | 2 +-
boards/arm/common/stm32/src/Make.defs | 2 +
boards/arm/common/stm32/src/board_common.c | 66 ++++++++++++++++++++++++++
4 files changed, 115 insertions(+), 1 deletion(-)
diff --git a/boards/arm/common/stm32/include/board_common.h b/boards/arm/common/stm32/include/board_common.h
new file mode 100644
index 00000000000..34b54fe8da9
--- /dev/null
+++ b/boards/arm/common/stm32/include/board_common.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ * boards/arm/common/stm32/include/board_common.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_COMMON_STM32_INCLUDE_BOARD_COMMON_H
+#define __BOARDS_ARM_COMMON_STM32_INCLUDE_BOARD_COMMON_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_common_initialize
+ *
+ * Description:
+ * Initialize the board features that are common to all STM32 boards.
+ *
+ ****************************************************************************/
+
+int stm32_common_initialize(void);
+
+#endif /* __BOARDS_ARM_COMMON_STM32_INCLUDE_BOARD_COMMON_H */
diff --git a/boards/arm/common/stm32/src/CMakeLists.txt b/boards/arm/common/stm32/src/CMakeLists.txt
index 6175c5a0c30..635c011a731 100644
--- a/boards/arm/common/stm32/src/CMakeLists.txt
+++ b/boards/arm/common/stm32/src/CMakeLists.txt
@@ -20,7 +20,7 @@
#
# ##############################################################################
-set(SRCS)
+set(SRCS board_common.c)
if(CONFIG_SENSORS_BMP180)
list(APPEND SRCS stm32_bmp180.c)
diff --git a/boards/arm/common/stm32/src/Make.defs b/boards/arm/common/stm32/src/Make.defs
index 3d92678a36b..9920ba1d515 100644
--- a/boards/arm/common/stm32/src/Make.defs
+++ b/boards/arm/common/stm32/src/Make.defs
@@ -24,6 +24,8 @@ ifeq ($(CONFIG_ARCH_BOARD_COMMON),y)
STM32_BOARD_COMMON_DIR := $(TOPDIR)$(DELIM)boards$(DELIM)arm$(DELIM)common$(DELIM)stm32
+CSRCS += board_common.c
+
ifeq ($(CONFIG_SENSORS_BMP180),y)
CSRCS += stm32_bmp180.c
endif
diff --git a/boards/arm/common/stm32/src/board_common.c b/boards/arm/common/stm32/src/board_common.c
new file mode 100644
index 00000000000..e31706756a8
--- /dev/null
+++ b/boards/arm/common/stm32/src/board_common.c
@@ -0,0 +1,66 @@
+/****************************************************************************
+ * boards/arm/common/stm32/src/board_common.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+
+#include <arch/board/board.h>
+
+#if defined(CONFIG_STM32_IWDG) || defined(CONFIG_STM32_WWDG)
+# include "stm32_wdg.h"
+#endif
+
+#include "board_common.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_common_initialize
+ *
+ * Description:
+ * Initialize the board features that are common to all STM32 boards.
+ *
+ ****************************************************************************/
+
+int stm32_common_initialize(void)
+{
+#ifdef CONFIG_STM32_IWDG
+ /* Initialize the independent watchdog */
+
+ stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY);
+#endif
+
+#ifdef CONFIG_STM32_WWDG
+ /* Initialize the window watchdog */
+
+ stm32_wwdginitialize("/dev/watchdog1");
+#endif
+
+ return OK;
+}
(nuttx) 09/09: Documentation/guides: add STM32 Nucleo standard draft
Posted by xi...@apache.org.
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 78ebd3b3c92a37c16cfe01367df865b4531b5c12
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 09:20:10 2026 +0200
Documentation/guides: add STM32 Nucleo standard draft
Add the initial STM32 Nucleo standard page. It describes the common board
initialization shared by all Nucleo boards and the rules for using it.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
.../guides/chip-specific/stm32_nucleo.rst | 55 ++++++++++++++++++++++
Documentation/guides/index.rst | 1 +
2 files changed, 56 insertions(+)
diff --git a/Documentation/guides/chip-specific/stm32_nucleo.rst b/Documentation/guides/chip-specific/stm32_nucleo.rst
new file mode 100644
index 00000000000..5d895711bac
--- /dev/null
+++ b/Documentation/guides/chip-specific/stm32_nucleo.rst
@@ -0,0 +1,55 @@
+=====================
+STM32 Nucleo standard
+=====================
+
+Status: draft, see `issue 19296
+<https://github.com/apache/nuttx/issues/19296>`_.
+
+This page collects the rules that all STM32 Nucleo boards in NuttX follow.
+It starts with the common board initialization and grows as more of the
+board logic becomes shared.
+
+Common board initialization
+===========================
+
+Initialization that does not depend on the board lives in
+``boards/arm/common/stm32/src/board_common.c``. It is part of the common
+STM32 board logic (``CONFIG_ARCH_BOARD_COMMON``), which every Nucleo board
+selects, and provides one function:
+
+.. code-block:: c
+
+ #include "board_common.h"
+
+ int stm32_common_initialize(void);
+
+Every Nucleo board calls ``stm32_common_initialize()`` early in its
+bringup, in ``stm32_bringup()`` or, if the board has none, in
+``board_late_initialize()``. A failure is logged and the bringup continues.
+
+The function currently handles:
+
+========= ================================== ================================
+Feature Enabled by Result
+========= ================================== ================================
+procfs ``CONFIG_FS_PROCFS`` mounted at
+ ``CONFIG_NSH_PROC_MOUNTPOINT``
+ or ``/proc``
+tmpfs ``CONFIG_FS_TMPFS`` mounted at
+ ``CONFIG_LIBC_TMPDIR``
+IWDG ``CONFIG_STM32_IWDG`` ``/dev/watchdog0``
+WWDG ``CONFIG_STM32_WWDG`` ``/dev/watchdog1``
+CAN ``CONFIG_STM32_CAN_CHARDRIVER`` ``/dev/can0``, ``/dev/can1``,
+ ``CONFIG_STM32_FDCAN_CHARDRIVER`` ... in instance order
+SocketCAN ``CONFIG_STM32_CAN_SOCKET`` interfaces for all enabled
+ ``CONFIG_STM32_FDCAN_SOCKET`` instances
+========= ================================== ================================
+
+The file systems are not mounted when ``CONFIG_DISABLE_MOUNTPOINT`` is
+set. The IWDG uses ``STM32_LSI_FREQUENCY`` from the board ``board.h``.
+
+Rules for boards:
+
+- Do not repeat any of the features above in the board directory.
+- Board-independent initialization is added to
+ ``stm32_common_initialize()``, not to individual boards.
diff --git a/Documentation/guides/index.rst b/Documentation/guides/index.rst
index 0f52ddac8aa..e8ec1594b5a 100644
--- a/Documentation/guides/index.rst
+++ b/Documentation/guides/index.rst
@@ -108,6 +108,7 @@ Guides
chip-specific/port_drivers_to_stm32f7.rst
chip-specific/semihosting.rst
chip-specific/smaller_vector_tables.rst
+ chip-specific/stm32_nucleo.rst
chip-specific/stm32_ports.rst
chip-specific/stm32ccm.rst
chip-specific/stm32nullpointer.rst
(nuttx) 04/09: boards/arm/common/stm32: support STM32L4 in the common CAN and BMP280 setup
Posted by xi...@apache.org.
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 e9b6a5bee923042e63c87d16377b230741965506
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 09:56:04 2026 +0200
boards/arm/common/stm32: support STM32L4 in the common CAN and BMP280 setup
STM32L4 provides the same CAN and I2C functions as the other families,
but declares them in stm32l4_can.h and stm32l4_i2c.h. Include these
headers on STM32L4, so its boards can use the common CAN and BMP280
setup.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/arm/common/stm32/src/stm32_bmp280.c | 6 +++++-
boards/arm/common/stm32/src/stm32_can_setup.c | 2 ++
boards/arm/common/stm32/src/stm32_cansock_setup.c | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/boards/arm/common/stm32/src/stm32_bmp280.c b/boards/arm/common/stm32/src/stm32_bmp280.c
index 2d748ac1128..d46889db2d0 100644
--- a/boards/arm/common/stm32/src/stm32_bmp280.c
+++ b/boards/arm/common/stm32/src/stm32_bmp280.c
@@ -33,7 +33,11 @@
#include <nuttx/sensors/bmp280.h>
#include <nuttx/i2c/i2c_master.h>
-#include "stm32_i2c.h"
+#ifdef CONFIG_ARCH_CHIP_STM32L4
+# include "stm32l4_i2c.h"
+#else
+# include "stm32_i2c.h"
+#endif
/****************************************************************************
* Pre-processor Definitions
diff --git a/boards/arm/common/stm32/src/stm32_can_setup.c b/boards/arm/common/stm32/src/stm32_can_setup.c
index 446d383c255..a001b444a43 100644
--- a/boards/arm/common/stm32/src/stm32_can_setup.c
+++ b/boards/arm/common/stm32/src/stm32_can_setup.c
@@ -39,6 +39,8 @@
#endif
#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
# include "stm32_fdcan.h"
+#elif defined(CONFIG_ARCH_CHIP_STM32L4)
+# include "stm32l4_can.h"
#else
# include "stm32_can.h"
#endif
diff --git a/boards/arm/common/stm32/src/stm32_cansock_setup.c b/boards/arm/common/stm32/src/stm32_cansock_setup.c
index 0c3dbeb659b..70b2abc128c 100644
--- a/boards/arm/common/stm32/src/stm32_cansock_setup.c
+++ b/boards/arm/common/stm32/src/stm32_cansock_setup.c
@@ -35,6 +35,8 @@
#endif
#ifdef CONFIG_STM32_FDCAN_SOCKET
# include "stm32_fdcan.h"
+#elif defined(CONFIG_ARCH_CHIP_STM32L4)
+# include "stm32l4_can.h"
#else
# include "stm32_can.h"
#endif
(nuttx) 06/09: boards/arm: use the common board initialization on Nucleo boards
Posted by xi...@apache.org.
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 <ra...@railab.me>
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 <ra...@railab.me>
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
(nuttx) 08/09: boards/arm: register CAN in the common STM32 board init
Posted by xi...@apache.org.
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 c75e12c0d806adf110d8e6822c2a6f3c075d1f7b
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 10:02:57 2026 +0200
boards/arm: register CAN in the common STM32 board init
Call stm32_can_setup() and stm32_cansock_setup() from
stm32_common_initialize() when the CAN or FDCAN character driver or
SocketCAN support is enabled, and remove these calls from the Nucleo
boards.
A failed CAN setup is logged and the initialization continues. The
nucleo-f722ze, nucleo-f746zg, nucleo-f767zi and nucleo-l476rg bringup
returned an error in this case.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/arm/common/stm32/src/board_common.c | 41 ++++++++++++++++++++++
.../arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c | 22 ------------
.../arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c | 22 ------------
boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c | 11 ------
.../arm/stm32f4/nucleo-f446re/src/stm32_bringup.c | 22 ------------
.../arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c | 25 -------------
.../arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c | 25 -------------
.../arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c | 25 -------------
.../arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c | 22 ------------
.../arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c | 12 -------
.../arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 10 ------
11 files changed, 41 insertions(+), 196 deletions(-)
diff --git a/boards/arm/common/stm32/src/board_common.c b/boards/arm/common/stm32/src/board_common.c
index b9b7fcd772f..660513ec28b 100644
--- a/boards/arm/common/stm32/src/board_common.c
+++ b/boards/arm/common/stm32/src/board_common.c
@@ -33,10 +33,31 @@
#include <arch/board/board.h>
+/* The STM32H7 FDCAN driver has its own SocketCAN interface */
+
+#if (defined(CONFIG_STM32_CAN_CHARDRIVER) || \
+ defined(CONFIG_STM32_FDCAN_CHARDRIVER)) && \
+ !defined(CONFIG_STM32_HAVE_FDCAN_H7)
+# define HAVE_CAN_SETUP
+#endif
+
+#if (defined(CONFIG_STM32_CAN_SOCKET) || defined(CONFIG_STM32_FDCAN_SOCKET)) && \
+ !defined(CONFIG_STM32_HAVE_FDCAN_H7)
+# define HAVE_CANSOCK_SETUP
+#endif
+
#if defined(CONFIG_STM32_IWDG) || defined(CONFIG_STM32_WWDG)
# include "stm32_wdg.h"
#endif
+#ifdef HAVE_CAN_SETUP
+# include "stm32_can_setup.h"
+#endif
+
+#ifdef HAVE_CANSOCK_SETUP
+# include "stm32_cansock_setup.h"
+#endif
+
#include "board_common.h"
/****************************************************************************
@@ -107,6 +128,26 @@ int stm32_common_initialize(void)
stm32_wwdginitialize("/dev/watchdog1");
#endif
+#ifdef HAVE_CAN_SETUP
+ /* Register the CAN character drivers */
+
+ ret = stm32_can_setup();
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: stm32_can_setup() failed: %d\n", ret);
+ }
+#endif
+
+#ifdef HAVE_CANSOCK_SETUP
+ /* Initialize the SocketCAN interfaces */
+
+ ret = stm32_cansock_setup();
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: stm32_cansock_setup() failed: %d\n", ret);
+ }
+#endif
+
UNUSED(ret);
return OK;
}
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c
index 6c3f4eda847..1a47d5184d5 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c
+++ b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c
@@ -55,8 +55,6 @@
#include "nucleo-c092rc.h"
#include "board_common.h"
-#include "stm32_can_setup.h"
-#include "stm32_cansock_setup.h"
/****************************************************************************
* Pre-processor Definitions
@@ -152,26 +150,6 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
- /* Initialize CAN and register the CAN driver. */
-
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_fdcan_setup failed: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_STM32_FDCAN_SOCKET
- /* Initialize CAN socket interface */
-
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
#ifdef CONFIG_SENSORS_QENCODER
/* Initialize and register the qencoder driver - TIM3 */
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c
index bac0e07171e..0124964659b 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c
+++ b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c
@@ -51,8 +51,6 @@
#include "nucleo-f302r8.h"
#include "board_common.h"
-#include "stm32_can_setup.h"
-#include "stm32_cansock_setup.h"
/****************************************************************************
* Pre-processor Definitions
@@ -175,26 +173,6 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
- /* Initialize CAN and register the CAN driver. */
-
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
- /* Initialize CAN socket interface */
-
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
UNUSED(ret);
return OK;
}
diff --git a/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c b/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c
index b9594df78c4..4d611ae7dc4 100644
--- a/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c
+++ b/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c
@@ -35,7 +35,6 @@
#include "nucleo-f303re.h"
#include "board_common.h"
-#include "stm32_can_setup.h"
/****************************************************************************
* Pre-processor Definitions
@@ -167,16 +166,6 @@ void board_late_initialize(void)
}
#endif
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
- /* Initialize CAN and register the CAN driver. */
-
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret);
- }
-#endif
-
UNUSED(ret);
}
#endif /* CONFIG_BOARD_LATE_INITIALIZE */
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
index cabda7fed9a..0d801644835 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
+++ b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
@@ -69,8 +69,6 @@
#endif
#include "nucleo-f446re.h"
#include "board_common.h"
-#include "stm32_can_setup.h"
-#include "stm32_cansock_setup.h"
/****************************************************************************
* Public Functions
@@ -191,26 +189,6 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
- /* Initialize CAN and register the CAN driver. */
-
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
- /* Initialize CAN socket interface */
-
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
#ifdef CONFIG_VIDEO_FB
/* Initialize and register the framebuffer driver */
diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c
index 4ffd648e7d6..11542dbccea 100644
--- a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c
+++ b/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c
@@ -40,14 +40,6 @@
#include "stm32_i2c.h"
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
-# include "stm32_can_setup.h"
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
-# include "stm32_cansock_setup.h"
-#endif
-
#ifdef CONFIG_STM32_ROMFS
# include "stm32_romfs.h"
#endif
@@ -238,23 +230,6 @@ int stm32_bringup(void)
#endif
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32f7_can_setup failed: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
#if defined(CONFIG_I2C) && defined(CONFIG_STM32_I2C1)
i2c_bus = 1;
i2c = stm32_i2cbus_initialize(i2c_bus);
diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c
index 2028404da7d..1f98b475326 100644
--- a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c
+++ b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c
@@ -40,14 +40,6 @@
#include "stm32_i2c.h"
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
-# include "stm32_can_setup.h"
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
-# include "stm32_cansock_setup.h"
-#endif
-
#ifdef CONFIG_STM32_ROMFS
# include "stm32_romfs.h"
#endif
@@ -242,23 +234,6 @@ int stm32_bringup(void)
#endif
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32f7_can_setup failed: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
#if defined(CONFIG_I2C) && defined(CONFIG_STM32_I2C1)
i2c_bus = 1;
i2c = stm32_i2cbus_initialize(i2c_bus);
diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c
index 3d666441cb9..32a4a90558c 100644
--- a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c
+++ b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c
@@ -40,14 +40,6 @@
#include "stm32_i2c.h"
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
-# include "stm32_can_setup.h"
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
-# include "stm32_cansock_setup.h"
-#endif
-
#ifdef CONFIG_STM32_ROMFS
# include "stm32_romfs.h"
#endif
@@ -253,23 +245,6 @@ int stm32_bringup(void)
#endif
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32f7_can_setup failed: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef CONFIG_STM32_CAN_SOCKET
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
#if defined(CONFIG_I2C) && defined(CONFIG_STM32_I2C1)
i2c_bus = 1;
i2c = stm32_i2cbus_initialize(i2c_bus);
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
index dbbcf6dc97e..4137154a4c9 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
@@ -46,8 +46,6 @@
#include "nucleo-g431rb.h"
#include "board_common.h"
-#include "stm32_can_setup.h"
-#include "stm32_cansock_setup.h"
/****************************************************************************
* Pre-processor Definitions
@@ -161,26 +159,6 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
- /* Initialize CAN and register the CAN driver. */
-
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_fdcan_setup failed: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_STM32_FDCAN_SOCKET
- /* Initialize CAN socket interface */
-
- ret = stm32_cansock_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_cansock_setup failed: %d\n", ret);
- }
-#endif
-
UNUSED(ret);
return OK;
}
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
index 7bfe6d24ad6..f903ea339fc 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
@@ -39,8 +39,6 @@
#include "board_common.h"
-#include "stm32_can_setup.h"
-
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -119,16 +117,6 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
- /* Initialize CAN and register the CAN driver. */
-
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret);
- }
-#endif
-
#ifdef CONFIG_STM32_SPI
/* Cannot call at board init because irq_attach would be called before
* before irq_initialize is called.
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
index e3e8fcee608..faa66fd46d6 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
@@ -66,7 +66,6 @@
#endif
#include "board_common.h"
-#include "stm32_can_setup.h"
/****************************************************************************
* Private Data
@@ -276,15 +275,6 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_CAN
- ret = stm32_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret);
- return ret;
- }
-#endif
-
/* Initialize MMC and register the MMC driver. */
#ifdef HAVE_MMCSD_SPI
(nuttx) 03/09: boards/arm/common/stm32: make the MFRC522 SPI bus and reset configurable
Posted by xi...@apache.org.
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 d805ea1b15fbc2c387226881331b7be10f39bb9c
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 09:51:21 2026 +0200
boards/arm/common/stm32: make the MFRC522 SPI bus and reset configurable
A board can select the MFRC522 SPI bus with BOARD_MFRC522_SPI (SPI1 by
default) and a reset pin with BOARD_MFRC522_GPIO_RESET in board.h, so
boards with a different wiring can use the common driver setup.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/arm/common/stm32/src/stm32_mfrc522.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/boards/arm/common/stm32/src/stm32_mfrc522.c b/boards/arm/common/stm32/src/stm32_mfrc522.c
index 0da85237c69..9ab46e04809 100644
--- a/boards/arm/common/stm32/src/stm32_mfrc522.c
+++ b/boards/arm/common/stm32/src/stm32_mfrc522.c
@@ -33,16 +33,24 @@
#include <nuttx/spi/spi.h>
#include <nuttx/contactless/mfrc522.h>
+#include <arch/board/board.h>
+
#include "stm32.h"
#include "stm32_spi.h"
-#if defined(CONFIG_SPI) && defined(CONFIG_STM32_SPI1) && defined(CONFIG_CL_MFRC522)
+#if defined(CONFIG_SPI) && defined(CONFIG_CL_MFRC522)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-#define MFRC522_SPI_PORTNO 1 /* On SPI1 */
+/* The board can select the SPI bus with BOARD_MFRC522_SPI, SPI1 by default */
+
+#ifdef BOARD_MFRC522_SPI
+# define MFRC522_SPI_PORTNO BOARD_MFRC522_SPI
+#else
+# define MFRC522_SPI_PORTNO 1
+#endif
/****************************************************************************
* Public Functions
@@ -66,6 +74,14 @@ int stm32_mfrc522initialize(const char *devpath)
{
struct spi_dev_s *spi;
int ret;
+
+#ifdef BOARD_MFRC522_GPIO_RESET
+ /* MFRC522 hardware reset on rising edge */
+
+ stm32_configgpio(BOARD_MFRC522_GPIO_RESET);
+ stm32_gpiowrite(BOARD_MFRC522_GPIO_RESET, true);
+#endif
+
spi = stm32_spibus_initialize(MFRC522_SPI_PORTNO);
if (!spi)
{
(nuttx) 05/09: boards/arm: enable the common board logic on Nucleo boards
Posted by xi...@apache.org.
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 4b371168af1a208d337d48022756ad95a911f62b
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 09:53:08 2026 +0200
boards/arm: enable the common board logic on Nucleo boards
Select ARCH_BOARD_COMMON on all STM32 Nucleo boards, so they can use the
common STM32 board code, and add CONFIG_ARCH_BOARD_COMMON=y to their
defconfigs, which savedefconfig keeps.
Remove the board copies that the common code replaces, so the same
function is not built twice:
- CAN and SocketCAN setup on nucleo-c092rc, nucleo-f302r8,
nucleo-f303re, nucleo-f446re, nucleo-g431rb, nucleo-h563zi and
nucleo-l476rg. nucleo-h563zi now registers all enabled FDCAN
instances with one stm32_can_setup() call. The nucleo-c092rc CAN
transceiver standby pin moves to BOARD_CAN_GPIO_STBY in board.h.
- BMP280 setup on nucleo-l476rg.
- MFRC522 setup on nucleo-l073rz, with its SPI2 bus and reset pin
given by BOARD_MFRC522_SPI and BOARD_MFRC522_GPIO_RESET in board.h.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/Kconfig | 48 +++++++++
.../nucleo-c071rb/configs/adcscope/defconfig | 1 +
.../stm32c0/nucleo-c071rb/configs/nsh/defconfig | 1 +
.../nucleo-c071rb/configs/usb-cdc/defconfig | 1 +
.../stm32c0/nucleo-c092rc/configs/can/defconfig | 1 +
.../nucleo-c092rc/configs/cansock/defconfig | 1 +
.../stm32c0/nucleo-c092rc/configs/nsh/defconfig | 1 +
boards/arm/stm32c0/nucleo-c092rc/include/board.h | 5 +
.../arm/stm32c0/nucleo-c092rc/src/CMakeLists.txt | 9 --
boards/arm/stm32c0/nucleo-c092rc/src/Make.defs | 9 --
.../arm/stm32c0/nucleo-c092rc/src/nucleo-c092rc.h | 31 ------
.../arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c | 2 +
boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c | 78 --------------
.../arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c | 68 ------------
.../stm32c5/nucleo-c562re/configs/jumbo/defconfig | 1 +
.../stm32c5/nucleo-c562re/configs/nsh/defconfig | 1 +
.../stm32f0/nucleo-f072rb/configs/nsh/defconfig | 1 +
.../nucleo-f072rb/configs/usb-cdc-uart/defconfig | 1 +
.../stm32f0/nucleo-f091rc/configs/nsh/defconfig | 1 +
.../stm32f0/nucleo-f091rc/configs/sx127x/defconfig | 1 +
.../stm32f1/nucleo-f103rb/configs/adc/defconfig | 1 +
.../stm32f1/nucleo-f103rb/configs/nsh/defconfig | 1 +
.../stm32f1/nucleo-f103rb/configs/pwm/defconfig | 1 +
.../stm32f2/nucleo-f207zg/configs/adc/defconfig | 1 +
.../stm32f2/nucleo-f207zg/configs/nsh/defconfig | 1 +
.../stm32f2/nucleo-f207zg/configs/pwm/defconfig | 1 +
.../stm32f3/nucleo-f302r8/configs/can/defconfig | 1 +
.../nucleo-f302r8/configs/cansock/defconfig | 1 +
.../nucleo-f302r8/configs/highpri/defconfig | 1 +
.../stm32f3/nucleo-f302r8/configs/nsh/defconfig | 1 +
.../arm/stm32f3/nucleo-f302r8/src/CMakeLists.txt | 9 --
boards/arm/stm32f3/nucleo-f302r8/src/Make.defs | 9 --
.../arm/stm32f3/nucleo-f302r8/src/nucleo-f302r8.h | 24 -----
.../arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c | 2 +
boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c | 73 -------------
.../arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c | 59 -----------
.../stm32f3/nucleo-f303re/configs/adc/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/can/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/hello/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/nsh/defconfig | 1 +
.../nucleo-f303re/configs/nxlines/defconfig | 1 +
.../stm32f3/nucleo-f303re/configs/pwm/defconfig | 1 +
.../nucleo-f303re/configs/serialrx/defconfig | 1 +
.../arm/stm32f3/nucleo-f303re/src/CMakeLists.txt | 4 -
boards/arm/stm32f3/nucleo-f303re/src/Make.defs | 4 -
.../arm/stm32f3/nucleo-f303re/src/nucleo-f303re.h | 12 ---
boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c | 1 +
boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c | 81 --------------
.../stm32f3/nucleo-f303ze/configs/adc/defconfig | 1 +
.../stm32f3/nucleo-f303ze/configs/nsh/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/adc/defconfig | 1 +
.../nucleo-f334r8/configs/highpri/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/nsh/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/spwm1/defconfig | 1 +
.../stm32f3/nucleo-f334r8/configs/spwm2/defconfig | 1 +
.../stm32f4/nucleo-f401re/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f410rb/configs/nsh/defconfig | 1 +
.../nucleo-f411re/configs/mcp2515-extid/defconfig | 1 +
.../stm32f4/nucleo-f411re/configs/nsh/defconfig | 1 +
.../nucleo-f412zg/configs/coremark/defconfig | 1 +
.../stm32f4/nucleo-f412zg/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f412zg/configs/ostest/defconfig | 1 +
.../stm32f4/nucleo-f429zi/configs/netnsh/defconfig | 1 +
.../stm32f4/nucleo-f429zi/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f429zi/configs/trace/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/adc/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/can/defconfig | 1 +
.../nucleo-f446re/configs/cansock/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/dac/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/gpio/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/jumbo/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/lcd/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/nsh/defconfig | 1 +
.../stm32f4/nucleo-f446re/configs/pwm/defconfig | 1 +
.../nucleo-f446re/configs/systemview/defconfig | 1 +
.../arm/stm32f4/nucleo-f446re/src/CMakeLists.txt | 9 --
boards/arm/stm32f4/nucleo-f446re/src/Make.defs | 9 --
.../arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h | 24 -----
.../arm/stm32f4/nucleo-f446re/src/stm32_bringup.c | 2 +
boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c | 117 ---------------------
.../arm/stm32f4/nucleo-f446re/src/stm32_cansock.c | 85 ---------------
.../nucleo-f722ze/configs/composite/defconfig | 1 +
.../stm32f7/nucleo-f722ze/configs/nsh/defconfig | 1 +
.../stm32f7/nucleo-f746zg/configs/evalos/defconfig | 1 +
.../nucleo-f746zg/configs/lorawan_gw/defconfig | 1 +
.../stm32f7/nucleo-f746zg/configs/nsh/defconfig | 1 +
.../stm32f7/nucleo-f767zi/configs/evalos/defconfig | 1 +
.../stm32f7/nucleo-f767zi/configs/netnsh/defconfig | 1 +
.../stm32f7/nucleo-f767zi/configs/nsh/defconfig | 1 +
.../stm32g0/nucleo-g070rb/configs/nsh/defconfig | 1 +
.../stm32g0/nucleo-g071rb/configs/nsh/defconfig | 1 +
.../stm32g0/nucleo-g0b1re/configs/adc/defconfig | 1 +
.../nucleo-g0b1re/configs/adc_dma/defconfig | 1 +
.../stm32g0/nucleo-g0b1re/configs/nsh/defconfig | 1 +
.../nucleo-g0b1re/configs/usb-cdc/defconfig | 1 +
.../nucleo-g0b1re/configs/usb-clocks/defconfig | 1 +
.../stm32g4/nucleo-g431kb/configs/comp/defconfig | 1 +
.../stm32g4/nucleo-g431kb/configs/nsh/defconfig | 1 +
.../stm32g4/nucleo-g431kb/configs/pwm/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/adc/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/can/defconfig | 1 +
.../nucleo-g431rb/configs/cansock/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/cordic/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/nsh/defconfig | 1 +
.../stm32g4/nucleo-g431rb/configs/pwm/defconfig | 1 +
.../arm/stm32g4/nucleo-g431rb/src/CMakeLists.txt | 9 --
boards/arm/stm32g4/nucleo-g431rb/src/Make.defs | 9 --
.../arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h | 24 -----
.../arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c | 2 +
boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c | 91 ----------------
.../arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c | 59 -----------
.../nucleo-g474re/configs/lpuartnsh/defconfig | 1 +
.../stm32g4/nucleo-g474re/configs/nsh/defconfig | 1 +
.../nucleo-g474re/configs/usbserial/defconfig | 1 +
.../stm32h5/nucleo-h503rb/configs/nsh/defconfig | 1 +
.../stm32h5/nucleo-h533re/configs/nsh/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/adc/defconfig | 1 +
.../nucleo-h563zi/configs/adc_watchdog/defconfig | 1 +
.../nucleo-h563zi/configs/buttons/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/dts/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/fdcan1/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/netnsh/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/nsh/defconfig | 1 +
.../nucleo-h563zi/configs/nshusbnet/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/pwm/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/usbmsc/defconfig | 1 +
.../stm32h5/nucleo-h563zi/configs/usbnsh/defconfig | 1 +
.../arm/stm32h5/nucleo-h563zi/src/CMakeLists.txt | 4 -
boards/arm/stm32h5/nucleo-h563zi/src/Make.defs | 4 -
.../arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h | 12 ---
.../arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c | 15 +--
boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c | 95 -----------------
.../stm32h7/nucleo-h723zg/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h723zg/configs/nsh/defconfig | 1 +
.../stm32h7/nucleo-h723zg/configs/oa_tc6/defconfig | 1 +
.../nucleo-h743zi/configs/capture/defconfig | 1 +
.../nucleo-h743zi/configs/composite/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/nsh/defconfig | 1 +
.../nucleo-h743zi/configs/nxlines_oled/defconfig | 1 +
.../nucleo-h743zi/configs/otg_fs_host/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/pwm/defconfig | 1 +
.../stm32h7/nucleo-h743zi/configs/rndis/defconfig | 1 +
.../nucleo-h743zi2/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h743zi2/configs/nsh/defconfig | 1 +
.../stm32h7/nucleo-h743zi2/configs/pysim/defconfig | 1 +
.../nucleo-h743zi2/configs/socketcan/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm4/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm4_rptun/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm7/defconfig | 1 +
.../nucleo-h745zi/configs/nsh_cm7_rptun/defconfig | 1 +
.../nucleo-h745zi/configs/pysim_cm7/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/crypto/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/netnsh/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/nsh/defconfig | 1 +
.../stm32h7/nucleo-h753zi/configs/pysim/defconfig | 1 +
.../nucleo-h753zi/configs/socketcan/defconfig | 1 +
.../nucleo-h7s3l8/configs/boot-xip/defconfig | 1 +
.../nucleo-h7s3l8/configs/jumbo-xip/defconfig | 1 +
.../nucleo-h7s3l8/configs/nsh-xip/defconfig | 1 +
.../stm32h7/nucleo-h7s3l8/configs/nsh/defconfig | 1 +
.../stm32l0/nucleo-l073rz/configs/nsh/defconfig | 1 +
.../stm32l0/nucleo-l073rz/configs/sx127x/defconfig | 1 +
.../nucleo-l073rz/configs/usb-cdc/defconfig | 1 +
boards/arm/stm32l0/nucleo-l073rz/include/board.h | 6 ++
.../arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt | 4 -
boards/arm/stm32l0/nucleo-l073rz/src/Make.defs | 4 -
.../arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h | 15 ---
.../arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c | 1 +
.../arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c | 97 -----------------
.../stm32l1/nucleo-l152re/configs/lcd/defconfig | 1 +
.../stm32l1/nucleo-l152re/configs/nsh/defconfig | 1 +
.../stm32l4/nucleo-l432kc/configs/nsh/defconfig | 1 +
.../stm32l4/nucleo-l432kc/configs/spwm/defconfig | 1 +
.../stm32l4/nucleo-l432kc/configs/wgen/defconfig | 1 +
.../stm32l4/nucleo-l452re/configs/nsh/defconfig | 1 +
.../stm32l4/nucleo-l476rg/configs/nsh/defconfig | 1 +
.../stm32l4/nucleo-l476rg/configs/nxdemo/defconfig | 1 +
.../arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt | 8 --
boards/arm/stm32l4/nucleo-l476rg/src/Make.defs | 7 --
.../arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h | 13 ---
.../arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c | 111 -------------------
.../arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h | 86 ---------------
.../arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 2 +
boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c | 96 -----------------
.../stm32l4/nucleo-l496zg/configs/nsh/defconfig | 1 +
.../stm32l5/nucleo-l552ze/configs/nsh/defconfig | 1 +
.../stm32n6/nucleo-n657x0-q/configs/leds/defconfig | 1 +
.../stm32n6/nucleo-n657x0-q/configs/nsh/defconfig | 1 +
.../nucleo-n657x0-q/configs/ostest/defconfig | 1 +
.../stm32u0/nucleo-u083rc/configs/nsh/defconfig | 1 +
.../nucleo-u3c5zi-q/configs/jumbo/defconfig | 1 +
.../stm32u3/nucleo-u3c5zi-q/configs/nsh/defconfig | 1 +
.../stm32u5/nucleo-u5a5zj-q/configs/nsh/defconfig | 1 +
.../stm32wb/nucleo-wb55rg/configs/ble/defconfig | 1 +
.../stm32wb/nucleo-wb55rg/configs/nimble/defconfig | 1 +
.../stm32wb/nucleo-wb55rg/configs/nsh/defconfig | 1 +
.../stm32wl5/nucleo-wl55jc/configs/demo/defconfig | 1 +
.../stm32wl5/nucleo-wl55jc/configs/nsh/defconfig | 1 +
199 files changed, 225 insertions(+), 1473 deletions(-)
diff --git a/boards/Kconfig b/boards/Kconfig
index 48038f28f05..045d03e09ee 100644
--- a/boards/Kconfig
+++ b/boards/Kconfig
@@ -1863,6 +1863,7 @@ config ARCH_BOARD_NUCLEO_F429ZI
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-F429zi board based on the STMicro STM32F429ZIT6 MCU.
@@ -1872,6 +1873,7 @@ config ARCH_BOARD_NUCLEO_F722ZE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F722ZE board based on STM32F722ZET6,
a 216MHz Cortex-M7, w/FPU, 512KiB Flash memory and 256KiB SRAM.
@@ -1882,6 +1884,7 @@ config ARCH_BOARD_NUCLEO_F746ZG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F746ZG board based on STM32F746ZGT6
a 216MHz Cortex-M7, w/FPU, 1024KiB Flash memory and 320KiB SRAM.
@@ -1892,6 +1895,7 @@ config ARCH_BOARD_NUCLEO_F767ZI
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F767ZI board based on STM32F767ZIT6,
a 216MHz Cortex-M7, w/DPFPU 2048KiB Flash memory and 512KiB SRAM.
@@ -1902,6 +1906,7 @@ config ARCH_BOARD_NUCLEO_L073RZ
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo L073RZ board based on the STMicro STM32L073RZU6 MCU.
@@ -1911,6 +1916,7 @@ config ARCH_BOARD_NUCLEO_L496ZG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-144 development board featuring STMicroelectronics
F2, F3, F4, F7 and L4 MCU families. The board is a "Hardware pattern"
@@ -1937,6 +1943,7 @@ config ARCH_BOARD_NUCLEO_F072RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F072RB board based on the STMicro STM32F072RBT6 MCU.
@@ -1946,6 +1953,7 @@ config ARCH_BOARD_NUCLEO_F091RC
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F091RC board based on the STMicro STM32F091RCT6 MCU.
@@ -1955,6 +1963,7 @@ config ARCH_BOARD_NUCLEO_F103RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F103RB board based on the STMicro STM32F103RBT6 MCU.
@@ -1964,6 +1973,7 @@ config ARCH_BOARD_NUCLEO_F207ZG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F207ZG board based on the STMicro STM32F207ZGT6 MCU.
@@ -1973,6 +1983,7 @@ config ARCH_BOARD_NUCLEO_F302R8
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F302R8 board based on the STMicro STM32F302R8T6 MCU.
@@ -1982,6 +1993,7 @@ config ARCH_BOARD_NUCLEO_F303RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F303RE board based on the STMicro STM32F303RET6 MCU.
@@ -1991,6 +2003,7 @@ config ARCH_BOARD_NUCLEO_F303ZE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F303ZE board based on the STMicro STM32F303ZET6 MCU.
@@ -2000,6 +2013,7 @@ config ARCH_BOARD_NUCLEO_F334R8
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo F334R8 board based on the STMicro STM32F334R8 MCU.
@@ -2009,6 +2023,7 @@ config ARCH_BOARD_NUCLEO_F401RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo F401RE in the NuttX source tree.
@@ -2029,6 +2044,7 @@ config ARCH_BOARD_NUCLEO_F410RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo F410RB in the NuttX source tree.
@@ -2039,6 +2055,7 @@ config ARCH_BOARD_NUCLEO_F411RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo F411RE in the NuttX source tree.
@@ -2047,6 +2064,7 @@ config ARCH_BOARD_NUCLEO_F412ZG
bool "STM32F412 Nucleo F412ZG"
depends on ARCH_CHIP_STM32F412ZG
select ARCH_HAVE_LEDS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo F412ZG in the NuttX source tree.
@@ -2057,6 +2075,7 @@ config ARCH_BOARD_NUCLEO_F446RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo F446RE in the NuttX source tree.
@@ -2075,6 +2094,7 @@ config ARCH_BOARD_NUCLEO_G070RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo G070RB in the NuttX source tree.
@@ -2085,6 +2105,7 @@ config ARCH_BOARD_NUCLEO_G071RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo G071RB in the NuttX source tree.
@@ -2095,6 +2116,7 @@ config ARCH_BOARD_NUCLEO_G0B1RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
This is a minimal configuration that supports low-level test of the
Nucleo G0B1RE in the NuttX source tree.
@@ -2132,6 +2154,7 @@ config ARCH_BOARD_NUCLEO_H723ZG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo H723ZG board based on the STMicro STM32H723ZG MCU.
@@ -2140,6 +2163,7 @@ config ARCH_BOARD_NUCLEO_H743ZI
depends on ARCH_CHIP_STM32H743ZI
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
+ select ARCH_BOARD_COMMON
# TODO: select ARCH_HAVE_IRQBUTTONS
---help---
STMicro Nucleo H743ZI board based on the STMicro STM32H743ZI MCU.
@@ -2150,6 +2174,7 @@ config ARCH_BOARD_NUCLEO_H743ZI2
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo H743ZI2 board based on the STMicro STM32H743ZI MCU.
@@ -2159,6 +2184,7 @@ config ARCH_BOARD_NUCLEO_H745ZI
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select STM32H7_HAVE_PWR_DIRECT_SMPS_SUPPLY
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo H745ZI board based on the STMicro STM32H745ZI MCU.
@@ -2200,6 +2226,7 @@ config ARCH_BOARD_NUCLEO_H753ZI
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo H753ZI board based on the STMicro STM32H753ZI MCU.
@@ -2209,6 +2236,7 @@ config ARCH_BOARD_NUCLEO_H7S3L8
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo H7S3L8 board based on the STM32H7S3L8 MCU.
@@ -2241,6 +2269,7 @@ config ARCH_BOARD_NUCLEO_L152RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo L152RE board based on the STMicro STM32L152REU6 MCU.
@@ -2250,6 +2279,7 @@ config ARCH_BOARD_NUCLEO_L432KC
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-32 L432KC board based on the STMicro STM32L432KCU6 MCU.
@@ -2259,6 +2289,7 @@ config ARCH_BOARD_NUCLEO_L452RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo L452RE board based on the STMicro STM32L452RET6 MCU.
@@ -2268,6 +2299,7 @@ config ARCH_BOARD_NUCLEO_L476RG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo L476RG board based on the STMicro STM32L476RGT6 MCU.
@@ -2284,6 +2316,7 @@ config ARCH_BOARD_NUCLEO_L552ZE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo STM32L552 board based on the STMicro STM32L552ZET6 MCU.
@@ -2302,6 +2335,7 @@ config ARCH_BOARD_NUCLEO_WB55RG
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo WB55RG board based on the STMicro STM32WB55RGV6 MCU.
@@ -2311,6 +2345,7 @@ config ARCH_BOARD_NUCLEO_WL55JC
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo STM32WL55 board based on the STMicro STM32WL55JC MCU.
@@ -3222,6 +3257,7 @@ config ARCH_BOARD_NUCLEO_C071RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro NUCLEO C071RB board based on the STMicro STM32C071RB MCU.
@@ -3231,6 +3267,7 @@ config ARCH_BOARD_NUCLEO_C092RC
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro NUCLEO C092RC board based on the STMicro STM32C092RC MCU.
@@ -3240,6 +3277,7 @@ config ARCH_BOARD_NUCLEO_U083RC
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro NUCLEO U083RC board based on the STMicro STM32U083RC MCU.
@@ -3389,6 +3427,7 @@ config ARCH_BOARD_NUCLEO_G431KB
bool "STM32G431KB Nucleo G431KB"
depends on ARCH_CHIP_STM32G431K
select ARCH_HAVE_LEDS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-G431KB board based on the STMicro STM32G431KB MCU.
@@ -3398,6 +3437,7 @@ config ARCH_BOARD_NUCLEO_G431RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-G431RB board based on the STMicro STM32G431RB MCU.
@@ -3406,6 +3446,7 @@ config ARCH_BOARD_NUCLEO_G474RE
depends on ARCH_CHIP_STM32G474R
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-G474RE board based on the STMicro STM32G474RET6
MCU, a Cortex-M4 with FPU, 170 MHz, 128 KB SRAM, 512 KB code.
@@ -3439,6 +3480,7 @@ config ARCH_BOARD_B_U585I_IOT02A
config ARCH_BOARD_NUCLEO_U5A5ZJ_Q
bool "STMicro NUCLEO-U5A5ZJ-Q board"
depends on ARCH_CHIP_STM32U5A5ZJT
+ select ARCH_BOARD_COMMON
---help---
STMicro development board featuring the STM32U5A5
MCU. The STM32U5A5 is a Cortex-M33 optimised for low-power operation
@@ -3447,6 +3489,7 @@ config ARCH_BOARD_NUCLEO_U5A5ZJ_Q
config ARCH_BOARD_NUCLEO_U3C5ZI_Q
bool "STMicro NUCLEO-U3C5ZI-Q board"
depends on ARCH_CHIP_STM32U3C5ZI
+ select ARCH_BOARD_COMMON
---help---
STMicro NUCLEO-U3C5ZI-Q development board featuring the STM32U3C5ZI,
a Cortex-M33 MCU running at up to 96 MHz with 2 MiB Flash and
@@ -3458,6 +3501,7 @@ config ARCH_BOARD_NUCLEO_C562RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro NUCLEO-C562RE development board featuring the STM32C562RE,
a Cortex-M33 MCU running at up to 144 MHz with 512 KiB Flash and
@@ -3502,6 +3546,7 @@ config ARCH_BOARD_NUCLEO_H503RB
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-H503RB board based on the STMicro STM32H503RB MCU.
@@ -3511,6 +3556,7 @@ config ARCH_BOARD_NUCLEO_H533RE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-H533RE board based on the STMicro STM32H533RE MCU.
@@ -3520,6 +3566,7 @@ config ARCH_BOARD_NUCLEO_H563ZI
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-H563ZI board based on the STMicro STM32H563ZI MCU.
@@ -3536,6 +3583,7 @@ config ARCH_BOARD_NUCLEO_N657X0_Q
bool "NUCLEO_N657X0_Q"
depends on ARCH_CHIP_STM32N657X0
select ARCH_HAVE_LEDS
+ select ARCH_BOARD_COMMON
---help---
STMicro Nucleo-N657X0-Q development board based on the STMicro
STM32N657X0 MCU (Cortex-M55). Boots in DEV mode by loading
diff --git a/boards/arm/stm32c0/nucleo-c071rb/configs/adcscope/defconfig b/boards/arm/stm32c0/nucleo-c071rb/configs/adcscope/defconfig
index c203fd3be4d..47aa7f454aa 100644
--- a/boards/arm/stm32c0/nucleo-c071rb/configs/adcscope/defconfig
+++ b/boards/arm/stm32c0/nucleo-c071rb/configs/adcscope/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c071rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C071RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c0"
diff --git a/boards/arm/stm32c0/nucleo-c071rb/configs/nsh/defconfig b/boards/arm/stm32c0/nucleo-c071rb/configs/nsh/defconfig
index 5849d3ab45d..f7cbd69c975 100644
--- a/boards/arm/stm32c0/nucleo-c071rb/configs/nsh/defconfig
+++ b/boards/arm/stm32c0/nucleo-c071rb/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c071rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C071RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c0"
diff --git a/boards/arm/stm32c0/nucleo-c071rb/configs/usb-cdc/defconfig b/boards/arm/stm32c0/nucleo-c071rb/configs/usb-cdc/defconfig
index 8dbf7c629fc..7c6a5c87b6e 100644
--- a/boards/arm/stm32c0/nucleo-c071rb/configs/usb-cdc/defconfig
+++ b/boards/arm/stm32c0/nucleo-c071rb/configs/usb-cdc/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c071rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C071RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c0"
diff --git a/boards/arm/stm32c0/nucleo-c092rc/configs/can/defconfig b/boards/arm/stm32c0/nucleo-c092rc/configs/can/defconfig
index 1a2ebdb4185..923d636df2e 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/configs/can/defconfig
+++ b/boards/arm/stm32c0/nucleo-c092rc/configs/can/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c092rc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C092RC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c0"
diff --git a/boards/arm/stm32c0/nucleo-c092rc/configs/cansock/defconfig b/boards/arm/stm32c0/nucleo-c092rc/configs/cansock/defconfig
index 57d858f02bd..f8d6ce2466b 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/configs/cansock/defconfig
+++ b/boards/arm/stm32c0/nucleo-c092rc/configs/cansock/defconfig
@@ -10,6 +10,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c092rc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C092RC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c0"
diff --git a/boards/arm/stm32c0/nucleo-c092rc/configs/nsh/defconfig b/boards/arm/stm32c0/nucleo-c092rc/configs/nsh/defconfig
index 718871956d3..0f901185aa4 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/configs/nsh/defconfig
+++ b/boards/arm/stm32c0/nucleo-c092rc/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c092rc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C092RC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c0"
diff --git a/boards/arm/stm32c0/nucleo-c092rc/include/board.h b/boards/arm/stm32c0/nucleo-c092rc/include/board.h
index 3ba92033529..a0173d4f006 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/include/board.h
+++ b/boards/arm/stm32c0/nucleo-c092rc/include/board.h
@@ -173,6 +173,11 @@
#define GPIO_FDCAN1_RX (GPIO_FDCAN1_RX_8|GPIO_SPEED_HIGH) /* PD0 */
#define GPIO_FDCAN1_TX (GPIO_FDCAN1_TX_9|GPIO_SPEED_HIGH) /* PD1 */
+/* MCP2562FDT transceiver STBY - PD2 */
+
+#define BOARD_CAN_GPIO_STBY (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_MEDIUM | \
+ GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN2)
+
/* Qencoder on TIM3:
* TIM3_CH1IN - PB4 (D5)
* TIM3_CH2IN - PC7 (D3)
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/CMakeLists.txt b/boards/arm/stm32c0/nucleo-c092rc/src/CMakeLists.txt
index 0ab1b18faa2..4703d30555d 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/src/CMakeLists.txt
+++ b/boards/arm/stm32c0/nucleo-c092rc/src/CMakeLists.txt
@@ -36,15 +36,6 @@ if(CONFIG_ADC)
list(APPEND SRCS stm32_adc.c)
endif()
-if(CONFIG_STM32_FDCAN)
- if(CONFIG_STM32_FDCAN_CHARDRIVER)
- list(APPEND SRCS stm32_can.c)
- endif()
- if(CONFIG_STM32_FDCAN_SOCKET)
- list(APPEND SRCS stm32_cansock.c)
- endif()
-endif()
-
target_sources(board PRIVATE ${SRCS})
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/flash.ld")
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/Make.defs b/boards/arm/stm32c0/nucleo-c092rc/src/Make.defs
index 74c27aa25f7..14d66be13d5 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/src/Make.defs
+++ b/boards/arm/stm32c0/nucleo-c092rc/src/Make.defs
@@ -38,15 +38,6 @@ ifeq ($(CONFIG_ADC),y)
CSRCS += stm32_adc.c
endif
-ifeq ($(CONFIG_STM32_FDCAN),y)
-ifeq ($(CONFIG_STM32_FDCAN_CHARDRIVER),y)
-CSRCS += stm32_can.c
-endif
-ifeq ($(CONFIG_STM32_FDCAN_SOCKET),y)
-CSRCS += stm32_cansock.c
-endif
-endif
-
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/nucleo-c092rc.h b/boards/arm/stm32c0/nucleo-c092rc/src/nucleo-c092rc.h
index 85f594562c7..2170ed0d050 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/src/nucleo-c092rc.h
+++ b/boards/arm/stm32c0/nucleo-c092rc/src/nucleo-c092rc.h
@@ -62,13 +62,6 @@
#define GPIO_BTN_USER (GPIO_INPUT | GPIO_PULLUP | GPIO_EXTI | \
GPIO_PORTC | GPIO_PIN13)
-/* FDCAN:
- * MCP2562FDT STBY - PD2
- */
-
-#define GPIO_FDCAN_STBY (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_MEDIUM | \
- GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN2)
-
/****************************************************************************
* Public Types
****************************************************************************/
@@ -108,29 +101,5 @@ int stm32_bringup(void);
int stm32_adc_setup(void);
#endif
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
-int stm32_can_setup(void);
-#endif
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_FDCAN_SOCKET
-int stm32_cansock_setup(void);
-#endif
-
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_STM32F0L0G0_NUCLEO_C092RC_SRC_NUCLEO_C092RC_H */
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c
index 8f631a46a2c..90a04f6850f 100644
--- a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c
+++ b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_bringup.c
@@ -58,6 +58,8 @@
#include <arch/board/board.h>
#include "nucleo-c092rc.h"
+#include "stm32_can_setup.h"
+#include "stm32_cansock_setup.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c
deleted file mode 100644
index d2ba35278e0..00000000000
--- a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32c0/nucleo-c092rc/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <nuttx/debug.h>
-
-#include "stm32_fdcan.h"
-#include "nucleo-c092rc.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(void)
-{
- struct can_dev_s *can;
- int ret;
-
- /* Configure STBY pin for output */
-
- stm32_configgpio(GPIO_FDCAN_STBY);
-
- /* Set STBY pin low */
-
- stm32_gpiowrite(GPIO_FDCAN_STBY, false);
-
- /* Call stm32_fdcaninitialize() to get an instance of the CAN interface */
-
- can = stm32_fdcaninitialize(1);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can0" */
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
- return OK;
-}
diff --git a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c b/boards/arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c
deleted file mode 100644
index 8a24931b13d..00000000000
--- a/boards/arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32c0/nucleo-c092rc/src/stm32_cansock.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <nuttx/debug.h>
-
-#include "stm32_fdcan.h"
-#include "nucleo-c092rc.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-int stm32_cansock_setup(void)
-{
- int ret;
-
- /* Configure STBY pin for output */
-
- stm32_configgpio(GPIO_FDCAN_STBY);
-
- /* Set STBY pin low */
-
- stm32_gpiowrite(GPIO_FDCAN_STBY, false);
-
- /* Call stm32_fdcaninitialize() to get an instance of the FDCAN interface */
-
- ret = stm32_fdcansockinitialize(1);
- if (ret < 0)
- {
- canerr("ERROR: Failed to get FDCAN interface %d\n", ret);
- return ret;
- }
-
- return OK;
-}
diff --git a/boards/arm/stm32c5/nucleo-c562re/configs/jumbo/defconfig b/boards/arm/stm32c5/nucleo-c562re/configs/jumbo/defconfig
index 2577054322e..9df6faad3a3 100644
--- a/boards/arm/stm32c5/nucleo-c562re/configs/jumbo/defconfig
+++ b/boards/arm/stm32c5/nucleo-c562re/configs/jumbo/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c562re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C562RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c5"
diff --git a/boards/arm/stm32c5/nucleo-c562re/configs/nsh/defconfig b/boards/arm/stm32c5/nucleo-c562re/configs/nsh/defconfig
index 8e7003e2fa8..cb7e5395007 100644
--- a/boards/arm/stm32c5/nucleo-c562re/configs/nsh/defconfig
+++ b/boards/arm/stm32c5/nucleo-c562re/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-c562re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_C562RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32c5"
diff --git a/boards/arm/stm32f0/nucleo-f072rb/configs/nsh/defconfig b/boards/arm/stm32f0/nucleo-f072rb/configs/nsh/defconfig
index f1fd3ab108a..671bbe67cf9 100644
--- a/boards/arm/stm32f0/nucleo-f072rb/configs/nsh/defconfig
+++ b/boards/arm/stm32f0/nucleo-f072rb/configs/nsh/defconfig
@@ -22,6 +22,7 @@
# CONFIG_NSH_DISABLE_XD is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f072rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F072RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f0"
diff --git a/boards/arm/stm32f0/nucleo-f072rb/configs/usb-cdc-uart/defconfig b/boards/arm/stm32f0/nucleo-f072rb/configs/usb-cdc-uart/defconfig
index 7e5d3b70c24..b09dcdb3a29 100644
--- a/boards/arm/stm32f0/nucleo-f072rb/configs/usb-cdc-uart/defconfig
+++ b/boards/arm/stm32f0/nucleo-f072rb/configs/usb-cdc-uart/defconfig
@@ -19,6 +19,7 @@
# CONFIG_NSH_DISABLE_XD is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f072rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F072RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f0"
diff --git a/boards/arm/stm32f0/nucleo-f091rc/configs/nsh/defconfig b/boards/arm/stm32f0/nucleo-f091rc/configs/nsh/defconfig
index 1cd0f3abf39..e8e4949bd37 100644
--- a/boards/arm/stm32f0/nucleo-f091rc/configs/nsh/defconfig
+++ b/boards/arm/stm32f0/nucleo-f091rc/configs/nsh/defconfig
@@ -22,6 +22,7 @@
# CONFIG_NSH_DISABLE_XD is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f091rc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F091RC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f0"
diff --git a/boards/arm/stm32f0/nucleo-f091rc/configs/sx127x/defconfig b/boards/arm/stm32f0/nucleo-f091rc/configs/sx127x/defconfig
index 0298afca179..724fdb3eaea 100644
--- a/boards/arm/stm32f0/nucleo-f091rc/configs/sx127x/defconfig
+++ b/boards/arm/stm32f0/nucleo-f091rc/configs/sx127x/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f091rc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F091RC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f0"
diff --git a/boards/arm/stm32f1/nucleo-f103rb/configs/adc/defconfig b/boards/arm/stm32f1/nucleo-f103rb/configs/adc/defconfig
index 03b0dc7c459..a1d6667e821 100644
--- a/boards/arm/stm32f1/nucleo-f103rb/configs/adc/defconfig
+++ b/boards/arm/stm32f1/nucleo-f103rb/configs/adc/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC_FIFOSIZE=4
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f103rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F103RB=y
CONFIG_ARCH_CHIP="stm32f1"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f1/nucleo-f103rb/configs/nsh/defconfig b/boards/arm/stm32f1/nucleo-f103rb/configs/nsh/defconfig
index c3f979d2d13..ed098c41314 100644
--- a/boards/arm/stm32f1/nucleo-f103rb/configs/nsh/defconfig
+++ b/boards/arm/stm32f1/nucleo-f103rb/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f103rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F103RB=y
CONFIG_ARCH_CHIP="stm32f1"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f1/nucleo-f103rb/configs/pwm/defconfig b/boards/arm/stm32f1/nucleo-f103rb/configs/pwm/defconfig
index f581b347f76..c0e25f873b2 100644
--- a/boards/arm/stm32f1/nucleo-f103rb/configs/pwm/defconfig
+++ b/boards/arm/stm32f1/nucleo-f103rb/configs/pwm/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f103rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F103RB=y
CONFIG_ARCH_CHIP="stm32f1"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f2/nucleo-f207zg/configs/adc/defconfig b/boards/arm/stm32f2/nucleo-f207zg/configs/adc/defconfig
index 53b10cb1c26..8e7d97e07e7 100644
--- a/boards/arm/stm32f2/nucleo-f207zg/configs/adc/defconfig
+++ b/boards/arm/stm32f2/nucleo-f207zg/configs/adc/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC_FIFOSIZE=4
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f207zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F207ZG=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f2"
diff --git a/boards/arm/stm32f2/nucleo-f207zg/configs/nsh/defconfig b/boards/arm/stm32f2/nucleo-f207zg/configs/nsh/defconfig
index 2679b5c5e8b..5c003691554 100644
--- a/boards/arm/stm32f2/nucleo-f207zg/configs/nsh/defconfig
+++ b/boards/arm/stm32f2/nucleo-f207zg/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f207zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F207ZG=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f2"
diff --git a/boards/arm/stm32f2/nucleo-f207zg/configs/pwm/defconfig b/boards/arm/stm32f2/nucleo-f207zg/configs/pwm/defconfig
index 04c5b15c502..cd0a406ab48 100644
--- a/boards/arm/stm32f2/nucleo-f207zg/configs/pwm/defconfig
+++ b/boards/arm/stm32f2/nucleo-f207zg/configs/pwm/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f207zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F207ZG=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f2"
diff --git a/boards/arm/stm32f3/nucleo-f302r8/configs/can/defconfig b/boards/arm/stm32f3/nucleo-f302r8/configs/can/defconfig
index 5e2a50cea1a..5cdace069d7 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/configs/can/defconfig
+++ b/boards/arm/stm32f3/nucleo-f302r8/configs/can/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f302r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F302R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f302r8/configs/cansock/defconfig b/boards/arm/stm32f3/nucleo-f302r8/configs/cansock/defconfig
index de7101c186d..6146f56df2e 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/configs/cansock/defconfig
+++ b/boards/arm/stm32f3/nucleo-f302r8/configs/cansock/defconfig
@@ -11,6 +11,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f302r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F302R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f302r8/configs/highpri/defconfig b/boards/arm/stm32f3/nucleo-f302r8/configs/highpri/defconfig
index f415d6e0fc5..e18e11d7704 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/configs/highpri/defconfig
+++ b/boards/arm/stm32f3/nucleo-f302r8/configs/highpri/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f302r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F302R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f302r8/configs/nsh/defconfig b/boards/arm/stm32f3/nucleo-f302r8/configs/nsh/defconfig
index 7363a11f42d..6289fadbe86 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/configs/nsh/defconfig
+++ b/boards/arm/stm32f3/nucleo-f302r8/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_SYSTEM_DD is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f302r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F302R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/CMakeLists.txt b/boards/arm/stm32f3/nucleo-f302r8/src/CMakeLists.txt
index d2e1166c77e..9bbb82be039 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/src/CMakeLists.txt
+++ b/boards/arm/stm32f3/nucleo-f302r8/src/CMakeLists.txt
@@ -48,15 +48,6 @@ else()
endif()
endif()
-if(CONFIG_STM32_CAN)
- if(CONFIG_STM32_CAN_CHARDRIVER)
- list(APPEND SRCS stm32_can.c)
- endif()
- if(CONFIG_STM32_CAN_SOCKET)
- list(APPEND SRCS stm32_cansock.c)
- endif()
-endif()
-
target_sources(board PRIVATE ${SRCS})
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/Make.defs b/boards/arm/stm32f3/nucleo-f302r8/src/Make.defs
index 4b4fc883e98..a7e891e9206 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/src/Make.defs
+++ b/boards/arm/stm32f3/nucleo-f302r8/src/Make.defs
@@ -50,15 +50,6 @@ CSRCS += stm32_adc.c
endif
endif
-ifeq ($(CONFIG_STM32_CAN),y)
-ifeq ($(CONFIG_STM32_CAN_CHARDRIVER),y)
-CSRCS += stm32_can.c
-endif
-ifeq ($(CONFIG_STM32_CAN_SOCKET),y)
-CSRCS += stm32_cansock.c
-endif
-endif
-
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/nucleo-f302r8.h b/boards/arm/stm32f3/nucleo-f302r8/src/nucleo-f302r8.h
index f38dbe2ed28..4b92ea34a06 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/src/nucleo-f302r8.h
+++ b/boards/arm/stm32f3/nucleo-f302r8/src/nucleo-f302r8.h
@@ -149,28 +149,4 @@ int stm32_foc_setup(void);
int stm32_adc_setup(void);
#endif
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
-int stm32_can_setup(void);
-#endif
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_CAN_SOCKET
-int stm32_cansock_setup(void);
-#endif
-
#endif /* __BOARDS_ARM_STM32_NUCLEO_F302R8_SRC_NUCLEO_F302R8_H */
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c
index ddf259cacf7..b0c19bfe349 100644
--- a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c
+++ b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_bringup.c
@@ -50,6 +50,8 @@
#endif
#include "nucleo-f302r8.h"
+#include "stm32_can_setup.h"
+#include "stm32_cansock_setup.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c
deleted file mode 100644
index c75d14627c2..00000000000
--- a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f3/nucleo-f302r8/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdbool.h>
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/can/can.h>
-
-#include "stm32.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(void)
-{
- struct can_dev_s *can;
- int ret;
-
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- can = stm32_caninitialize(1);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can0" */
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
- return OK;
-}
diff --git a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c b/boards/arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c
deleted file mode 100644
index 6a7ed672f30..00000000000
--- a/boards/arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f3/nucleo-f302r8/src/stm32_cansock.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <nuttx/debug.h>
-
-#include "stm32_can.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-int stm32_cansock_setup(void)
-{
- int ret;
-
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- ret = stm32_cansockinitialize(1);
- if (ret < 0)
- {
- canerr("ERROR: Failed to get CAN interface %d\n", ret);
- return ret;
- }
-
- return OK;
-}
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/adc/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/adc/defconfig
index 800369214a2..36b1455b26c 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/adc/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/adc/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/can/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/can/defconfig
index 464b73deff7..78948a5a907 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/can/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/can/defconfig
@@ -10,6 +10,7 @@
# CONFIG_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/hello/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/hello/defconfig
index e8470d5fdbd..eedd53fed30 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/hello/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/hello/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/nsh/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/nsh/defconfig
index 4b5ead9b89f..fca91f9464f 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/nsh/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/nxlines/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/nxlines/defconfig
index 6c5fbbe4e1c..57ac03eea2f 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/nxlines/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/nxlines/defconfig
@@ -12,6 +12,7 @@
# CONFIG_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/pwm/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/pwm/defconfig
index e6ef3644349..c47e6cc6da2 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/pwm/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/pwm/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/configs/serialrx/defconfig b/boards/arm/stm32f3/nucleo-f303re/configs/serialrx/defconfig
index cdfbb2e02b0..d5ec58448c4 100644
--- a/boards/arm/stm32f3/nucleo-f303re/configs/serialrx/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303re/configs/serialrx/defconfig
@@ -10,6 +10,7 @@
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303re/src/CMakeLists.txt b/boards/arm/stm32f3/nucleo-f303re/src/CMakeLists.txt
index 1388c1f7d1e..ae5f0158b3b 100644
--- a/boards/arm/stm32f3/nucleo-f303re/src/CMakeLists.txt
+++ b/boards/arm/stm32f3/nucleo-f303re/src/CMakeLists.txt
@@ -36,10 +36,6 @@ if(CONFIG_ADC)
list(APPEND SRCS stm32_adc.c)
endif()
-if(CONFIG_STM32_CAN_CHARDRIVER)
- list(APPEND SRCS stm32_can.c)
-endif()
-
if(CONFIG_DAC)
list(APPEND SRCS stm32_dac.c)
endif()
diff --git a/boards/arm/stm32f3/nucleo-f303re/src/Make.defs b/boards/arm/stm32f3/nucleo-f303re/src/Make.defs
index d65a5d39ac5..48e6c9747b4 100644
--- a/boards/arm/stm32f3/nucleo-f303re/src/Make.defs
+++ b/boards/arm/stm32f3/nucleo-f303re/src/Make.defs
@@ -38,10 +38,6 @@ ifeq ($(CONFIG_ADC),y)
CSRCS += stm32_adc.c
endif
-ifeq ($(CONFIG_STM32_CAN_CHARDRIVER),y)
-CSRCS += stm32_can.c
-endif
-
ifeq ($(CONFIG_DAC),y)
CSRCS += stm32_dac.c
endif
diff --git a/boards/arm/stm32f3/nucleo-f303re/src/nucleo-f303re.h b/boards/arm/stm32f3/nucleo-f303re/src/nucleo-f303re.h
index 01ce746a805..4c6a771b7c5 100644
--- a/boards/arm/stm32f3/nucleo-f303re/src/nucleo-f303re.h
+++ b/boards/arm/stm32f3/nucleo-f303re/src/nucleo-f303re.h
@@ -182,16 +182,4 @@ int stm32_pwm_setup(void);
int stm32_adc_setup(void);
#endif
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
-int stm32_can_setup(void);
-#endif
-
#endif /* __BOARDS_ARM_STM32_NUCLEO_F303RE_SRC_NUCLEO_F303RE_H */
diff --git a/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c b/boards/arm/stm32f3/nucleo-f303re/src/stm32_boot.c
index 8ff26cda3c5..73c767c5131 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 "stm32_can_setup.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c b/boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c
deleted file mode 100644
index 5aad2992848..00000000000
--- a/boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f3/nucleo-f303re/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdbool.h>
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/can/can.h>
-
-#include "stm32.h"
-
-#ifdef CONFIG_CAN
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(void)
-{
-#ifdef CONFIG_STM32_CAN1
- struct can_dev_s *can;
- int ret;
-
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- can = stm32_caninitialize(1);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can0" */
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
- return OK;
-#else
- return -ENODEV;
-#endif
-}
-
-#endif /* CONFIG_CAN */
diff --git a/boards/arm/stm32f3/nucleo-f303ze/configs/adc/defconfig b/boards/arm/stm32f3/nucleo-f303ze/configs/adc/defconfig
index f9450ed1b9f..2d0d5fc6afe 100644
--- a/boards/arm/stm32f3/nucleo-f303ze/configs/adc/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303ze/configs/adc/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303ze"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303ZE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f303ze/configs/nsh/defconfig b/boards/arm/stm32f3/nucleo-f303ze/configs/nsh/defconfig
index c6f9fe743d0..c4176807b1d 100644
--- a/boards/arm/stm32f3/nucleo-f303ze/configs/nsh/defconfig
+++ b/boards/arm/stm32f3/nucleo-f303ze/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f303ze"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F303ZE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f334r8/configs/adc/defconfig b/boards/arm/stm32f3/nucleo-f334r8/configs/adc/defconfig
index c5b882ea444..d08b7f37ca8 100644
--- a/boards/arm/stm32f3/nucleo-f334r8/configs/adc/defconfig
+++ b/boards/arm/stm32f3/nucleo-f334r8/configs/adc/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f334r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F334R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f334r8/configs/highpri/defconfig b/boards/arm/stm32f3/nucleo-f334r8/configs/highpri/defconfig
index 1c1da0ff5ee..ea71d1ceec5 100644
--- a/boards/arm/stm32f3/nucleo-f334r8/configs/highpri/defconfig
+++ b/boards/arm/stm32f3/nucleo-f334r8/configs/highpri/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f334r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F334R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f334r8/configs/nsh/defconfig b/boards/arm/stm32f3/nucleo-f334r8/configs/nsh/defconfig
index 7a8a8baf3f1..831e5022dad 100644
--- a/boards/arm/stm32f3/nucleo-f334r8/configs/nsh/defconfig
+++ b/boards/arm/stm32f3/nucleo-f334r8/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_SYSTEM_DD is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f334r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F334R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f334r8/configs/spwm1/defconfig b/boards/arm/stm32f3/nucleo-f334r8/configs/spwm1/defconfig
index 351e8d90ad4..b0678dfab92 100644
--- a/boards/arm/stm32f3/nucleo-f334r8/configs/spwm1/defconfig
+++ b/boards/arm/stm32f3/nucleo-f334r8/configs/spwm1/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f334r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F334R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f3/nucleo-f334r8/configs/spwm2/defconfig b/boards/arm/stm32f3/nucleo-f334r8/configs/spwm2/defconfig
index 2427abbae0b..a8a86ae9dc4 100644
--- a/boards/arm/stm32f3/nucleo-f334r8/configs/spwm2/defconfig
+++ b/boards/arm/stm32f3/nucleo-f334r8/configs/spwm2/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f334r8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F334R8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f3"
diff --git a/boards/arm/stm32f4/nucleo-f401re/configs/nsh/defconfig b/boards/arm/stm32f4/nucleo-f401re/configs/nsh/defconfig
index 691067a8b3a..6155c0147ee 100644
--- a/boards/arm/stm32f4/nucleo-f401re/configs/nsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f401re/configs/nsh/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f401re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F401RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f410rb/configs/nsh/defconfig b/boards/arm/stm32f4/nucleo-f410rb/configs/nsh/defconfig
index 2f7c904678d..574f8360e20 100644
--- a/boards/arm/stm32f4/nucleo-f410rb/configs/nsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f410rb/configs/nsh/defconfig
@@ -13,6 +13,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f410rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F410RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f411re/configs/mcp2515-extid/defconfig b/boards/arm/stm32f4/nucleo-f411re/configs/mcp2515-extid/defconfig
index a15efeda085..27c8254c834 100644
--- a/boards/arm/stm32f4/nucleo-f411re/configs/mcp2515-extid/defconfig
+++ b/boards/arm/stm32f4/nucleo-f411re/configs/mcp2515-extid/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f411re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F411RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f411re/configs/nsh/defconfig b/boards/arm/stm32f4/nucleo-f411re/configs/nsh/defconfig
index 97a77721430..7924d52a211 100644
--- a/boards/arm/stm32f4/nucleo-f411re/configs/nsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f411re/configs/nsh/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f411re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F411RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f412zg/configs/coremark/defconfig b/boards/arm/stm32f4/nucleo-f412zg/configs/coremark/defconfig
index 4f4f921618c..f1b7d5c0cc5 100644
--- a/boards/arm/stm32f4/nucleo-f412zg/configs/coremark/defconfig
+++ b/boards/arm/stm32f4/nucleo-f412zg/configs/coremark/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STM32_SYSCFG is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f412zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F412ZG=y
CONFIG_ARCH_CHIP="stm32f4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f4/nucleo-f412zg/configs/nsh/defconfig b/boards/arm/stm32f4/nucleo-f412zg/configs/nsh/defconfig
index ece24fb0b1a..61ae2939c87 100644
--- a/boards/arm/stm32f4/nucleo-f412zg/configs/nsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f412zg/configs/nsh/defconfig
@@ -16,6 +16,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f412zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F412ZG=y
CONFIG_ARCH_CHIP="stm32f4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f4/nucleo-f412zg/configs/ostest/defconfig b/boards/arm/stm32f4/nucleo-f412zg/configs/ostest/defconfig
index e6c03ecfce8..6b7a4ef0b8d 100644
--- a/boards/arm/stm32f4/nucleo-f412zg/configs/ostest/defconfig
+++ b/boards/arm/stm32f4/nucleo-f412zg/configs/ostest/defconfig
@@ -16,6 +16,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f412zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F412ZG=y
CONFIG_ARCH_CHIP="stm32f4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f4/nucleo-f429zi/configs/netnsh/defconfig b/boards/arm/stm32f4/nucleo-f429zi/configs/netnsh/defconfig
index d6a052fbd2a..2832169e69c 100644
--- a/boards/arm/stm32f4/nucleo-f429zi/configs/netnsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f429zi/configs/netnsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f429zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F429ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f429zi/configs/nsh/defconfig b/boards/arm/stm32f4/nucleo-f429zi/configs/nsh/defconfig
index 262b4becc71..fe9b8d93a56 100644
--- a/boards/arm/stm32f4/nucleo-f429zi/configs/nsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f429zi/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f429zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F429ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f429zi/configs/trace/defconfig b/boards/arm/stm32f4/nucleo-f429zi/configs/trace/defconfig
index a03f1d5e458..f2f91adebdb 100644
--- a/boards/arm/stm32f4/nucleo-f429zi/configs/trace/defconfig
+++ b/boards/arm/stm32f4/nucleo-f429zi/configs/trace/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f429zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F429ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/adc/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/adc/defconfig
index 5b5f4de0bc0..e7cea53d6df 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/adc/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/adc/defconfig
@@ -15,6 +15,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/can/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/can/defconfig
index bf16478bf0f..eaff7949363 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/can/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/can/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/cansock/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/cansock/defconfig
index e549ee92ce9..f7a7c2c0665 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/cansock/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/cansock/defconfig
@@ -14,6 +14,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/dac/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/dac/defconfig
index 12275ba08bf..333a7039846 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/dac/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/dac/defconfig
@@ -14,6 +14,7 @@
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/gpio/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/gpio/defconfig
index 9367b5a74c2..045b0bc4db9 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/gpio/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/gpio/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/jumbo/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/jumbo/defconfig
index aa93ca052f8..4252046de81 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/jumbo/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/jumbo/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/lcd/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/lcd/defconfig
index db27a7127b8..792d8688066 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/lcd/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/lcd/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/nsh/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/nsh/defconfig
index a4266c978ab..1587228b0d1 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/nsh/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/nsh/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/pwm/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/pwm/defconfig
index d56c5382c30..a2c7c62ded5 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/pwm/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/pwm/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/configs/systemview/defconfig b/boards/arm/stm32f4/nucleo-f446re/configs/systemview/defconfig
index 891ed15e150..7386aeb5411 100644
--- a/boards/arm/stm32f4/nucleo-f446re/configs/systemview/defconfig
+++ b/boards/arm/stm32f4/nucleo-f446re/configs/systemview/defconfig
@@ -14,6 +14,7 @@
# CONFIG_STM32_FLASH_PREFETCH is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f446re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F446RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f4"
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt b/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt
index 610cad1a6c0..333ce974d58 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt
+++ b/boards/arm/stm32f4/nucleo-f446re/src/CMakeLists.txt
@@ -45,15 +45,6 @@ if(NOT CONFIG_STM32_FOC)
endif()
endif()
-if(CONFIG_STM32_CAN)
- if(CONFIG_STM32_CAN_CHARDRIVER)
- list(APPEND SRCS stm32_can.c)
- endif()
- if(CONFIG_STM32_CAN_SOCKET)
- list(APPEND SRCS stm32_cansock.c)
- endif()
-endif()
-
if(CONFIG_STM32_PWM)
list(APPEND SRCS stm32_pwm.c)
endif()
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/Make.defs b/boards/arm/stm32f4/nucleo-f446re/src/Make.defs
index f4f9c4ec5ce..4696914ea30 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/Make.defs
+++ b/boards/arm/stm32f4/nucleo-f446re/src/Make.defs
@@ -47,15 +47,6 @@ endif
endif
endif
-ifeq ($(CONFIG_STM32_CAN),y)
-ifeq ($(CONFIG_STM32_CAN_CHARDRIVER),y)
-CSRCS += stm32_can.c
-endif
-ifeq ($(CONFIG_STM32_CAN_SOCKET),y)
-CSRCS += stm32_cansock.c
-endif
-endif
-
ifeq ($(CONFIG_STM32_PWM),y)
CSRCS += stm32_pwm.c
endif
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h b/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h
index d3e51ce12cc..223adba0ba7 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h
+++ b/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h
@@ -311,30 +311,6 @@ void stm32_usbinitialize(void);
int stm32_adc_setup(void);
#endif
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
-int stm32_can_setup(void);
-#endif
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_CAN_SOCKET
-int stm32_cansock_setup(void);
-#endif
-
/****************************************************************************
* Name: board_ajoy_initialize
*
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
index 13cf8656c7c..eec5ccad89e 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
+++ b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
@@ -68,6 +68,8 @@
# include "stm32_romfs.h"
#endif
#include "nucleo-f446re.h"
+#include "stm32_can_setup.h"
+#include "stm32_cansock_setup.h"
/****************************************************************************
* Public Functions
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c
deleted file mode 100644
index bb052a7c124..00000000000
--- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f4/nucleo-f446re/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/can/can.h>
-#include <arch/board/board.h>
-
-#include "chip.h"
-#include "arm_internal.h"
-#include "stm32.h"
-#include "stm32_can.h"
-#include "nucleo-f446re.h"
-
-#ifdef CONFIG_CAN
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Configuration ************************************************************/
-
-#if !defined(CONFIG_STM32_CAN1) && !defined(CONFIG_STM32_CAN2)
-# error "No CAN is enable. Please enable at least one CAN device"
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(void)
-{
- struct can_dev_s *can;
- int ret;
-
-#ifdef CONFIG_STM32_CAN1
-
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- can = stm32_caninitialize(1);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can0" */
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
-#endif
-#ifdef CONFIG_STM32_CAN2
-
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- can = stm32_caninitialize(2);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can1" */
-
- ret = can_register("/dev/can1", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
-#endif
- UNUSED(ret);
- UNUSED(can);
- return OK;
-}
-
-#endif /* CONFIG_CAN */
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_cansock.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_cansock.c
deleted file mode 100644
index a41b61f2307..00000000000
--- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_cansock.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f4/nucleo-f446re/src/stm32_cansock.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <nuttx/debug.h>
-
-#include "stm32_can.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Configuration ************************************************************/
-
-#if !defined(CONFIG_STM32_CAN1) && !defined(CONFIG_STM32_CAN2)
-# error "No CAN is enable. Please enable at least one CAN device"
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-int stm32_cansock_setup(void)
-{
- int ret = OK;
-
- UNUSED(ret);
-
-#ifdef CONFIG_STM32_CAN1
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- ret = stm32_cansockinitialize(1);
- if (ret < 0)
- {
- canerr("ERROR: Failed to get CAN interface %d\n", ret);
- goto errout;
- }
-#endif
-
-#ifdef CONFIG_STM32_CAN2
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- ret = stm32_cansockinitialize(2);
- if (ret < 0)
- {
- canerr("ERROR: Failed to get CAN interface %d\n", ret);
- goto errout;
- }
-#endif
-
-errout:
- return ret;
-}
diff --git a/boards/arm/stm32f7/nucleo-f722ze/configs/composite/defconfig b/boards/arm/stm32f7/nucleo-f722ze/configs/composite/defconfig
index c5ade09840d..afbe1d4ab96 100644
--- a/boards/arm/stm32f7/nucleo-f722ze/configs/composite/defconfig
+++ b/boards/arm/stm32f7/nucleo-f722ze/configs/composite/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f722ze"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F722ZE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32f7/nucleo-f722ze/configs/nsh/defconfig b/boards/arm/stm32f7/nucleo-f722ze/configs/nsh/defconfig
index d1dd0b02677..e58237f0ec4 100644
--- a/boards/arm/stm32f7/nucleo-f722ze/configs/nsh/defconfig
+++ b/boards/arm/stm32f7/nucleo-f722ze/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f722ze"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F722ZE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32f7/nucleo-f746zg/configs/evalos/defconfig b/boards/arm/stm32f7/nucleo-f746zg/configs/evalos/defconfig
index 95125cef760..77ac80ec8b4 100644
--- a/boards/arm/stm32f7/nucleo-f746zg/configs/evalos/defconfig
+++ b/boards/arm/stm32f7/nucleo-f746zg/configs/evalos/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f746zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F746ZG=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32f7/nucleo-f746zg/configs/lorawan_gw/defconfig b/boards/arm/stm32f7/nucleo-f746zg/configs/lorawan_gw/defconfig
index d3b4d844ff0..de6018fa2b9 100644
--- a/boards/arm/stm32f7/nucleo-f746zg/configs/lorawan_gw/defconfig
+++ b/boards/arm/stm32f7/nucleo-f746zg/configs/lorawan_gw/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f746zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F746ZG=y
CONFIG_ARCH_CHIP="stm32f7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32f7/nucleo-f746zg/configs/nsh/defconfig b/boards/arm/stm32f7/nucleo-f746zg/configs/nsh/defconfig
index c1b3531bf8a..9d0df1404d6 100644
--- a/boards/arm/stm32f7/nucleo-f746zg/configs/nsh/defconfig
+++ b/boards/arm/stm32f7/nucleo-f746zg/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f746zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F746ZG=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32f7/nucleo-f767zi/configs/evalos/defconfig b/boards/arm/stm32f7/nucleo-f767zi/configs/evalos/defconfig
index 93030ce7258..f3247873145 100644
--- a/boards/arm/stm32f7/nucleo-f767zi/configs/evalos/defconfig
+++ b/boards/arm/stm32f7/nucleo-f767zi/configs/evalos/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f767zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F767ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32f7/nucleo-f767zi/configs/netnsh/defconfig b/boards/arm/stm32f7/nucleo-f767zi/configs/netnsh/defconfig
index 240cfc4a2e9..86b0928034f 100644
--- a/boards/arm/stm32f7/nucleo-f767zi/configs/netnsh/defconfig
+++ b/boards/arm/stm32f7/nucleo-f767zi/configs/netnsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f767zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F767ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32f7/nucleo-f767zi/configs/nsh/defconfig b/boards/arm/stm32f7/nucleo-f767zi/configs/nsh/defconfig
index c78a21c59fa..0416cf11f7f 100644
--- a/boards/arm/stm32f7/nucleo-f767zi/configs/nsh/defconfig
+++ b/boards/arm/stm32f7/nucleo-f767zi/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-f767zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_F767ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32f7"
diff --git a/boards/arm/stm32g0/nucleo-g070rb/configs/nsh/defconfig b/boards/arm/stm32g0/nucleo-g070rb/configs/nsh/defconfig
index f78e5a4b951..42f97cfc62a 100644
--- a/boards/arm/stm32g0/nucleo-g070rb/configs/nsh/defconfig
+++ b/boards/arm/stm32g0/nucleo-g070rb/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g070rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G070RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g0"
diff --git a/boards/arm/stm32g0/nucleo-g071rb/configs/nsh/defconfig b/boards/arm/stm32g0/nucleo-g071rb/configs/nsh/defconfig
index fd83983a8e0..cd1f2901ef7 100644
--- a/boards/arm/stm32g0/nucleo-g071rb/configs/nsh/defconfig
+++ b/boards/arm/stm32g0/nucleo-g071rb/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g071rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G071RB=y
CONFIG_ARCH_CHIP="stm32g0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g0/nucleo-g0b1re/configs/adc/defconfig b/boards/arm/stm32g0/nucleo-g0b1re/configs/adc/defconfig
index c72cc65d0a7..66231ca3d7f 100644
--- a/boards/arm/stm32g0/nucleo-g0b1re/configs/adc/defconfig
+++ b/boards/arm/stm32g0/nucleo-g0b1re/configs/adc/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g0b1re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G0B1RE=y
CONFIG_ARCH_CHIP="stm32g0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g0/nucleo-g0b1re/configs/adc_dma/defconfig b/boards/arm/stm32g0/nucleo-g0b1re/configs/adc_dma/defconfig
index 6b0f6cd7c32..67dbc009d32 100644
--- a/boards/arm/stm32g0/nucleo-g0b1re/configs/adc_dma/defconfig
+++ b/boards/arm/stm32g0/nucleo-g0b1re/configs/adc_dma/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC_FIFOSIZE=64
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g0b1re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G0B1RE=y
CONFIG_ARCH_CHIP="stm32g0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g0/nucleo-g0b1re/configs/nsh/defconfig b/boards/arm/stm32g0/nucleo-g0b1re/configs/nsh/defconfig
index 05e08970e6c..ed710fcef4c 100644
--- a/boards/arm/stm32g0/nucleo-g0b1re/configs/nsh/defconfig
+++ b/boards/arm/stm32g0/nucleo-g0b1re/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g0b1re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G0B1RE=y
CONFIG_ARCH_CHIP="stm32g0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-cdc/defconfig b/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-cdc/defconfig
index 6db323eac14..f3faebb0a1c 100644
--- a/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-cdc/defconfig
+++ b/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-cdc/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g0b1re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G0B1RE=y
CONFIG_ARCH_CHIP="stm32g0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-clocks/defconfig b/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-clocks/defconfig
index 992ffd6962a..f11e63409d9 100644
--- a/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-clocks/defconfig
+++ b/boards/arm/stm32g0/nucleo-g0b1re/configs/usb-clocks/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g0b1re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G0B1RE=y
CONFIG_ARCH_CHIP="stm32g0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g4/nucleo-g431kb/configs/comp/defconfig b/boards/arm/stm32g4/nucleo-g431kb/configs/comp/defconfig
index b93181d5c22..34f7c053056 100644
--- a/boards/arm/stm32g4/nucleo-g431kb/configs/comp/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431kb/configs/comp/defconfig
@@ -8,6 +8,7 @@
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431kb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
CONFIG_ARCH_CHIP="stm32g4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g4/nucleo-g431kb/configs/nsh/defconfig b/boards/arm/stm32g4/nucleo-g431kb/configs/nsh/defconfig
index e848946ed7e..12da7adf1b0 100644
--- a/boards/arm/stm32g4/nucleo-g431kb/configs/nsh/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431kb/configs/nsh/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431kb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
CONFIG_ARCH_CHIP="stm32g4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g4/nucleo-g431kb/configs/pwm/defconfig b/boards/arm/stm32g4/nucleo-g431kb/configs/pwm/defconfig
index 8fbb0dc6b87..64280d1248f 100644
--- a/boards/arm/stm32g4/nucleo-g431kb/configs/pwm/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431kb/configs/pwm/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431kb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431KB=y
CONFIG_ARCH_CHIP="stm32g4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/adc/defconfig b/boards/arm/stm32g4/nucleo-g431rb/configs/adc/defconfig
index 2154e927ac4..ec09cafd745 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/adc/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/adc/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/can/defconfig b/boards/arm/stm32g4/nucleo-g431rb/configs/can/defconfig
index 2aa1ede955e..dfe2705eb1f 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/can/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/can/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig b/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig
index 1f375627d49..f00171423e3 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/cansock/defconfig
@@ -11,6 +11,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/cordic/defconfig b/boards/arm/stm32g4/nucleo-g431rb/configs/cordic/defconfig
index 1490159995b..3a5413770f2 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/cordic/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/cordic/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/nsh/defconfig b/boards/arm/stm32g4/nucleo-g431rb/configs/nsh/defconfig
index 2741f79a4ff..ca9e6e3e4d7 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/nsh/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/nsh/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g431rb/configs/pwm/defconfig b/boards/arm/stm32g4/nucleo-g431rb/configs/pwm/defconfig
index 7bb17b75b5b..113da5e91bd 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/configs/pwm/defconfig
+++ b/boards/arm/stm32g4/nucleo-g431rb/configs/pwm/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g431rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y
CONFIG_ARCH_CHIP="stm32g4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/CMakeLists.txt b/boards/arm/stm32g4/nucleo-g431rb/src/CMakeLists.txt
index 21262028d44..ac8cf4134b1 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/CMakeLists.txt
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/CMakeLists.txt
@@ -50,15 +50,6 @@ if(CONFIG_MATH_CORDIC)
list(APPEND SRCS stm32_cordic.c)
endif()
-if(CONFIG_STM32_FDCAN)
- if(CONFIG_STM32_FDCAN_CHARDRIVER)
- list(APPEND SRCS stm32_can.c)
- endif()
- if(CONFIG_STM32_FDCAN_SOCKET)
- list(APPEND SRCS stm32_cansock.c)
- endif()
-endif()
-
target_sources(board PRIVATE ${SRCS})
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/Make.defs b/boards/arm/stm32g4/nucleo-g431rb/src/Make.defs
index 17328e8d989..081d7a17f83 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/Make.defs
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/Make.defs
@@ -53,15 +53,6 @@ ifeq ($(CONFIG_MATH_CORDIC),y)
CSRCS += stm32_cordic.c
endif
-ifeq ($(CONFIG_STM32_FDCAN),y)
-ifeq ($(CONFIG_STM32_FDCAN_CHARDRIVER),y)
-CSRCS += stm32_can.c
-endif
-ifeq ($(CONFIG_STM32_FDCAN_SOCKET),y)
-CSRCS += stm32_cansock.c
-endif
-endif
-
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h b/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h
index c1aab3f25c2..917c3909fa2 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h
@@ -162,28 +162,4 @@ int stm32_foc_setup(void);
int stm32_cordic_setup(void);
#endif
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
-int stm32_can_setup(void);
-#endif
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_FDCAN_SOCKET
-int stm32_cansock_setup(void);
-#endif
-
#endif /* __BOARDS_ARM_STM32_NUCLEO_G431RB_SRC_NUCLEO_G431RB_H */
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
index 82b3a8be71f..32568131db3 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
@@ -45,6 +45,8 @@
#endif
#include "nucleo-g431rb.h"
+#include "stm32_can_setup.h"
+#include "stm32_cansock_setup.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c
deleted file mode 100644
index 5a91c6e2fe0..00000000000
--- a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32g4/nucleo-g431rb/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/can/can.h>
-#include <arch/board/board.h>
-
-#include "chip.h"
-#include "arm_internal.h"
-#include "stm32.h"
-#include "stm32_fdcan.h"
-#include "nucleo-g431rb.h"
-
-#ifdef CONFIG_CAN
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Configuration ************************************************************/
-
-#if !defined(CONFIG_STM32_FDCAN1)
-# error "No CAN is enable. Please enable at least one CAN device"
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(void)
-{
- struct can_dev_s *can;
- int ret;
-
- /* Call stm32_fdcaninitialize() to get an instance of the CAN interface */
-
- can = stm32_fdcaninitialize(1);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can0" */
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
- return OK;
-}
-
-#endif /* CONFIG_CAN */
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c
deleted file mode 100644
index c76c3ce5b2a..00000000000
--- a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32g4/nucleo-g431rb/src/stm32_cansock.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <nuttx/debug.h>
-
-#include "stm32_fdcan.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_cansock_setup
- *
- * Description:
- * Initialize CAN socket interface
- *
- ****************************************************************************/
-
-int stm32_cansock_setup(void)
-{
- int ret;
-
- /* Call stm32_fdcaninitialize() to get an instance of the FDCAN interface */
-
- ret = stm32_fdcansockinitialize(1);
- if (ret < 0)
- {
- canerr("ERROR: Failed to get FDCAN interface %d\n", ret);
- return ret;
- }
-
- return OK;
-}
diff --git a/boards/arm/stm32g4/nucleo-g474re/configs/lpuartnsh/defconfig b/boards/arm/stm32g4/nucleo-g474re/configs/lpuartnsh/defconfig
index ee2a8c2db94..b36f58733b0 100644
--- a/boards/arm/stm32g4/nucleo-g474re/configs/lpuartnsh/defconfig
+++ b/boards/arm/stm32g4/nucleo-g474re/configs/lpuartnsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_DISABLE_OS_API is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g474re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G474RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g474re/configs/nsh/defconfig b/boards/arm/stm32g4/nucleo-g474re/configs/nsh/defconfig
index 6a8c6317f57..6f6a0cc64d8 100644
--- a/boards/arm/stm32g4/nucleo-g474re/configs/nsh/defconfig
+++ b/boards/arm/stm32g4/nucleo-g474re/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_DISABLE_OS_API is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g474re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G474RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32g4/nucleo-g474re/configs/usbserial/defconfig b/boards/arm/stm32g4/nucleo-g474re/configs/usbserial/defconfig
index 405eabc8cdb..d26f370aadc 100644
--- a/boards/arm/stm32g4/nucleo-g474re/configs/usbserial/defconfig
+++ b/boards/arm/stm32g4/nucleo-g474re/configs/usbserial/defconfig
@@ -9,6 +9,7 @@
# CONFIG_DISABLE_OS_API is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-g474re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_G474RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32g4"
diff --git a/boards/arm/stm32h5/nucleo-h503rb/configs/nsh/defconfig b/boards/arm/stm32h5/nucleo-h503rb/configs/nsh/defconfig
index 86b22632e8f..e5fe0fcf311 100644
--- a/boards/arm/stm32h5/nucleo-h503rb/configs/nsh/defconfig
+++ b/boards/arm/stm32h5/nucleo-h503rb/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h503rb"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H503RB=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h533re/configs/nsh/defconfig b/boards/arm/stm32h5/nucleo-h533re/configs/nsh/defconfig
index 59f57d3a24c..a3bfce97e19 100644
--- a/boards/arm/stm32h5/nucleo-h533re/configs/nsh/defconfig
+++ b/boards/arm/stm32h5/nucleo-h533re/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h533re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H533RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/adc/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/adc/defconfig
index 0b0e405f950..bfbf53028a1 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/adc/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/adc/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/adc_watchdog/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/adc_watchdog/defconfig
index 748044ad5fc..3df5945ec22 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/adc_watchdog/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/adc_watchdog/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/buttons/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/buttons/defconfig
index 88ef9553b8e..9b19575cb47 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/buttons/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/buttons/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/dts/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/dts/defconfig
index 343a7808946..0653fa0da37 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/dts/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/dts/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/fdcan1/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/fdcan1/defconfig
index dbd9341b0a6..e5d379ab1bb 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/fdcan1/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/fdcan1/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/netnsh/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/netnsh/defconfig
index c7e63a2d3fb..d9d3426784b 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/netnsh/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/netnsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/nsh/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/nsh/defconfig
index 70c92e44278..e4574e975d8 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/nsh/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/nshusbnet/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/nshusbnet/defconfig
index e4316e5ec38..e3d95ce1193 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/nshusbnet/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/nshusbnet/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/pwm/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/pwm/defconfig
index 7b29390dc44..b62590f373f 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/pwm/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/pwm/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/usbmsc/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/usbmsc/defconfig
index 0e375794ff1..d75adbc42b3 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/usbmsc/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/usbmsc/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/configs/usbnsh/defconfig b/boards/arm/stm32h5/nucleo-h563zi/configs/usbnsh/defconfig
index 7d01dc6fdee..79b396adbc3 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/configs/usbnsh/defconfig
+++ b/boards/arm/stm32h5/nucleo-h563zi/configs/usbnsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h563zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H563ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h5"
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/CMakeLists.txt b/boards/arm/stm32h5/nucleo-h563zi/src/CMakeLists.txt
index 75c0d6d997b..65614b78d27 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/CMakeLists.txt
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/CMakeLists.txt
@@ -44,10 +44,6 @@ if(CONFIG_STM32_DTS)
list(APPEND SRCS stm32_dts.c)
endif()
-if(CONFIG_STM32_FDCAN)
- list(APPEND SRCS stm32_can.c)
-endif()
-
if(CONFIG_STM32_USBFS_HOST)
list(APPEND SRCS stm32_usb.c)
endif()
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/Make.defs b/boards/arm/stm32h5/nucleo-h563zi/src/Make.defs
index 828ce6c96c1..2dffe88823a 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/Make.defs
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/Make.defs
@@ -46,10 +46,6 @@ ifeq ($(CONFIG_STM32_DTS),y)
CSRCS += stm32_dts.c
endif
-ifeq ($(CONFIG_STM32_FDCAN),y)
-CSRCS += stm32_can.c
-endif
-
ifeq ($(CONFIG_STM32_PWM),y)
CSRCS += stm32_pwm.c
endif
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h b/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h
index 7bbc2507f82..10c8a5061f5 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h
@@ -155,18 +155,6 @@ int stm32_adc_setup(void);
int stm32_dts_setup(int devno);
#endif
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
-int stm32_can_setup(uint8_t port);
-#endif
-
/****************************************************************************
* Name: stm32_pwm_setup
*
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
index 2cfb9622260..9ad3289aaf8 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
@@ -42,6 +42,8 @@
# include "stm32_wdg.h"
#endif
+#include "stm32_can_setup.h"
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -129,21 +131,12 @@ int stm32_bringup(void)
#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
/* Initialize CAN and register the CAN driver. */
-# ifdef CONFIG_STM32_FDCAN1
- ret = stm32_can_setup(1);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: FDCAN1 stm32_fdcan_setup failed: %d\n", ret);
- }
-# endif
-# ifdef CONFIG_STM32_FDCAN2
- ret = stm32_can_setup(2);
+ ret = stm32_can_setup();
if (ret < 0)
{
- syslog(LOG_ERR, "ERROR: FDCAN2 stm32_fdcan_setup failed: %d\n", ret);
+ syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret);
}
-# endif
#endif
#ifdef CONFIG_STM32_SPI
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c
deleted file mode 100644
index d33b11c390b..00000000000
--- a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32h5/nucleo-h563zi/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/can/can.h>
-#include <arch/board/board.h>
-
-#include "chip.h"
-#include "arm_internal.h"
-#include "stm32.h"
-#include "stm32_fdcan.h"
-#include "nucleo-h563zi.h"
-
-#ifdef CONFIG_CAN
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Configuration ************************************************************/
-
-#if !defined(CONFIG_STM32_FDCAN1) && !defined(CONFIG_STM32_FDCAN2)
-# error "No CAN device is enabled. Please enable at least one CAN device"
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(uint8_t port)
-{
- struct can_dev_s *can;
- int ret;
-
- /* Call stm32_fdcaninitialize() to get an instance of the CAN interface */
-
- can = stm32_fdcaninitialize(port);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- if (port == 1)
- {
- ret = can_register("/dev/can0", can);
- }
- else if (port == 2)
- {
- ret = can_register("/dev/can1", can);
- }
- else
- {
- ret = -ENODEV;
- }
-
- return ret;
-}
-
-#endif /* CONFIG_CAN */
diff --git a/boards/arm/stm32h7/nucleo-h723zg/configs/netnsh/defconfig b/boards/arm/stm32h7/nucleo-h723zg/configs/netnsh/defconfig
index e73fc9f8fa8..1bf01b795a5 100644
--- a/boards/arm/stm32h7/nucleo-h723zg/configs/netnsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h723zg/configs/netnsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h723zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H723ZG=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h723zg/configs/nsh/defconfig b/boards/arm/stm32h7/nucleo-h723zg/configs/nsh/defconfig
index 11f85e483ed..c5b07a64255 100644
--- a/boards/arm/stm32h7/nucleo-h723zg/configs/nsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h723zg/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h723zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H723ZG=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h723zg/configs/oa_tc6/defconfig b/boards/arm/stm32h7/nucleo-h723zg/configs/oa_tc6/defconfig
index 715f1f0df18..6353f7ec7e1 100644
--- a/boards/arm/stm32h7/nucleo-h723zg/configs/oa_tc6/defconfig
+++ b/boards/arm/stm32h7/nucleo-h723zg/configs/oa_tc6/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h723zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H723ZG=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/capture/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/capture/defconfig
index 2ffafc58713..3e0745c273d 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/capture/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/capture/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h7"
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/composite/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/composite/defconfig
index b36d0f21e25..6fa69332af2 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/composite/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/composite/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/netnsh/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/netnsh/defconfig
index ec57eb558ba..6335e8f5248 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/netnsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/netnsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/nsh/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/nsh/defconfig
index 788de2f32ef..e94a4ae9811 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/nsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/nxlines_oled/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/nxlines_oled/defconfig
index 86c0aa28e5d..8c54567296c 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/nxlines_oled/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/nxlines_oled/defconfig
@@ -13,6 +13,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/otg_fs_host/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/otg_fs_host/defconfig
index 5977b0463ba..9888963059d 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/otg_fs_host/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/otg_fs_host/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/pwm/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/pwm/defconfig
index e43edd2ca1d..8baa5354cd3 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/pwm/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/pwm/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi/configs/rndis/defconfig b/boards/arm/stm32h7/nucleo-h743zi/configs/rndis/defconfig
index 914de95443f..90b62d01d32 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/configs/rndis/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi/configs/rndis/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/configs/netnsh/defconfig b/boards/arm/stm32h7/nucleo-h743zi2/configs/netnsh/defconfig
index c5bbd8b5b27..1b2718c83eb 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/configs/netnsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi2/configs/netnsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi2"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI2=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/configs/nsh/defconfig b/boards/arm/stm32h7/nucleo-h743zi2/configs/nsh/defconfig
index 66ec35fe74b..e536340f6f0 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/configs/nsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi2/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi2"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI2=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/configs/pysim/defconfig b/boards/arm/stm32h7/nucleo-h743zi2/configs/pysim/defconfig
index 2f4276ac9c9..0f0f1a41a94 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/configs/pysim/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi2/configs/pysim/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi2"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI2=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig b/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig
index 66d1e74be66..a2326c1f7d3 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig
@@ -11,6 +11,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h743zi2"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H743ZI2=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4/defconfig b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4/defconfig
index 66d8897395c..7f6e8eb70dd 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4/defconfig
+++ b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4/defconfig
@@ -10,6 +10,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h745zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H745ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4_rptun/defconfig b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4_rptun/defconfig
index f339a51f052..a97e00d6b93 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4_rptun/defconfig
+++ b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm4_rptun/defconfig
@@ -10,6 +10,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h745zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H745ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7/defconfig b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7/defconfig
index 5aed1797432..c732917b91d 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7/defconfig
+++ b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h745zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H745ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7_rptun/defconfig b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7_rptun/defconfig
index b64fcb0e0aa..0dc7b799e3e 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7_rptun/defconfig
+++ b/boards/arm/stm32h7/nucleo-h745zi/configs/nsh_cm7_rptun/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h745zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H745ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h745zi/configs/pysim_cm7/defconfig b/boards/arm/stm32h7/nucleo-h745zi/configs/pysim_cm7/defconfig
index 2d7fa0de5d0..4be11d77014 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/configs/pysim_cm7/defconfig
+++ b/boards/arm/stm32h7/nucleo-h745zi/configs/pysim_cm7/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h745zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H745ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h753zi/configs/crypto/defconfig b/boards/arm/stm32h7/nucleo-h753zi/configs/crypto/defconfig
index b931a0cc571..0437d5fda26 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/configs/crypto/defconfig
+++ b/boards/arm/stm32h7/nucleo-h753zi/configs/crypto/defconfig
@@ -13,6 +13,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h753zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H753ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h753zi/configs/netnsh/defconfig b/boards/arm/stm32h7/nucleo-h753zi/configs/netnsh/defconfig
index 690987ab92f..95f21d7760a 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/configs/netnsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h753zi/configs/netnsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h753zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H753ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h753zi/configs/nsh/defconfig b/boards/arm/stm32h7/nucleo-h753zi/configs/nsh/defconfig
index d4005fc697a..cb2eaad9bc1 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/configs/nsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h753zi/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h753zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H753ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h753zi/configs/pysim/defconfig b/boards/arm/stm32h7/nucleo-h753zi/configs/pysim/defconfig
index d6e87352352..cfa5840a649 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/configs/pysim/defconfig
+++ b/boards/arm/stm32h7/nucleo-h753zi/configs/pysim/defconfig
@@ -10,6 +10,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h753zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H753ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig b/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig
index 61cc0fe7c17..85a3f02dde4 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig
+++ b/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig
@@ -11,6 +11,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h753zi"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H753ZI=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/configs/boot-xip/defconfig b/boards/arm/stm32h7/nucleo-h7s3l8/configs/boot-xip/defconfig
index 27c7d1f6245..def95a3ec61 100644
--- a/boards/arm/stm32h7/nucleo-h7s3l8/configs/boot-xip/defconfig
+++ b/boards/arm/stm32h7/nucleo-h7s3l8/configs/boot-xip/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h7s3l8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H7S3L8=y
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/configs/jumbo-xip/defconfig b/boards/arm/stm32h7/nucleo-h7s3l8/configs/jumbo-xip/defconfig
index c9961f7f212..641713c7b61 100644
--- a/boards/arm/stm32h7/nucleo-h7s3l8/configs/jumbo-xip/defconfig
+++ b/boards/arm/stm32h7/nucleo-h7s3l8/configs/jumbo-xip/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h7s3l8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H7S3L8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h7"
diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh-xip/defconfig b/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh-xip/defconfig
index ea41889067d..c42b8da2e20 100644
--- a/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh-xip/defconfig
+++ b/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh-xip/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h7s3l8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H7S3L8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h7"
diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh/defconfig b/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh/defconfig
index c29c0a43647..38cdd18755c 100644
--- a/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh/defconfig
+++ b/boards/arm/stm32h7/nucleo-h7s3l8/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_NSH_DISABLE_ECHO is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-h7s3l8"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_H7S3L8=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32h7"
diff --git a/boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig b/boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig
index d4ddb1d55dd..8a98409c382 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig
+++ b/boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l073rz"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L073RZ=y
CONFIG_ARCH_CHIP="stm32l0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig b/boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig
index 32220b19127..81af0e77997 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig
+++ b/boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l073rz"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L073RZ=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32l0"
diff --git a/boards/arm/stm32l0/nucleo-l073rz/configs/usb-cdc/defconfig b/boards/arm/stm32l0/nucleo-l073rz/configs/usb-cdc/defconfig
index aa84ab42669..0edea1a3eb0 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/configs/usb-cdc/defconfig
+++ b/boards/arm/stm32l0/nucleo-l073rz/configs/usb-cdc/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l073rz"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L073RZ=y
CONFIG_ARCH_CHIP="stm32l0"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l0/nucleo-l073rz/include/board.h b/boards/arm/stm32l0/nucleo-l073rz/include/board.h
index 1cecadcde3d..d7a3b028283 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/include/board.h
+++ b/boards/arm/stm32l0/nucleo-l073rz/include/board.h
@@ -196,6 +196,12 @@ bool stm32_usb_pullup_enabled(void);
#define GPIO_SPI2_MOSI (GPIO_SPI2_MOSI_1|GPIO_SPEED_MEDIUM) /* PB15 */
#define GPIO_SPI2_SCK (GPIO_SPI2_SCK_1|GPIO_SPEED_MEDIUM) /* PB10 */
+/* MFRC522 on SPI2, RESET - PB11 */
+
+#define BOARD_MFRC522_SPI 2
+#define BOARD_MFRC522_GPIO_RESET (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_HIGH| \
+ GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11)
+
/* USART */
/* By default the USART2 is connected to STLINK Virtual COM Port:
diff --git a/boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt b/boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
index b70c2615c82..c5ea67350c5 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
@@ -44,10 +44,6 @@ if(CONFIG_LPWAN_SX127X)
list(APPEND SRCS stm32_sx127x.c)
endif()
-if(CONFIG_CL_MFRC522)
- list(APPEND SRCS stm32_mfrc522.c)
-endif()
-
target_sources(board PRIVATE ${SRCS})
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/boards/arm/stm32l0/nucleo-l073rz/src/Make.defs b/boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
index f2967390346..fb578f67c4d 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
@@ -46,10 +46,6 @@ ifeq ($(CONFIG_LPWAN_SX127X),y)
CSRCS += stm32_sx127x.c
endif
-ifeq ($(CONFIG_CL_MFRC522),y)
-CSRCS += stm32_mfrc522.c
-endif
-
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
diff --git a/boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h b/boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
index f72a20312f5..2d65edd49a6 100644
--- a/boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
@@ -102,13 +102,10 @@
/* MFRC522
* CS - PB4
- * RESET - PB11
*/
#define GPIO_MFRC522_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_HIGH| \
GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
-#define GPIO_MFRC522_RESET (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_HIGH| \
- GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11)
/****************************************************************************
* Public Data
@@ -168,16 +165,4 @@ int stm32_wlinitialize(void);
int stm32_lpwaninitialize(void);
#endif
-/****************************************************************************
- * Name: stm32_mfrc522initialize
- *
- * Description:
- * Function used to initialize the MFRC522 RFID Transceiver
- *
- ****************************************************************************/
-
-#ifdef CONFIG_CL_MFRC522
-int stm32_mfrc522initialize(const char *devpath);
-#endif
-
#endif /* __BOARDS_ARM_STM32F0L0G0_NUCLEO_L073RZ_SRC_NUCLEO_L073RZ_H */
diff --git a/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c
index 99c2cfb8f9b..19eb7ca4858 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 "stm32_mfrc522.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
deleted file mode 100644
index 4cbc3ee003c..00000000000
--- a/boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/spi/spi.h>
-#include <nuttx/contactless/mfrc522.h>
-
-#include "stm32.h"
-#include "stm32_spi.h"
-#include "nucleo-l073rz.h"
-
-#if defined(CONFIG_SPI) && defined(CONFIG_STM32_SPI2) && defined(CONFIG_CL_MFRC522)
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define MFRC522_SPI_PORTNO 2 /* On SPI2 */
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_mfrc522initialize
- *
- * Description:
- * Initialize and register the MFRC522 RFID driver.
- *
- * Input Parameters:
- * devpath - The full path to the driver to register. E.g., "/dev/rfid0"
- *
- * Returned Value:
- * Zero (OK) on success; a negated errno value on failure.
- *
- ****************************************************************************/
-
-int stm32_mfrc522initialize(const char *devpath)
-{
- struct spi_dev_s *spi;
- int ret;
-
- /* Configure MFRC522 reset */
-
- stm32_configgpio(GPIO_MFRC522_RESET);
-
- /* MFRC522 hardware reset on rising edge */
-
- stm32_gpiowrite(GPIO_MFRC522_RESET, true);
-
- /* Initialize SPI */
-
- spi = stm32_spibus_initialize(MFRC522_SPI_PORTNO);
- if (!spi)
- {
- return -ENODEV;
- }
-
- /* Then register the MFRC522 */
-
- ret = mfrc522_register(devpath, spi);
- if (ret < 0)
- {
- snerr("ERROR: Error registering MFRC522\n");
- }
-
- return ret;
-}
-
-#endif /* CONFIG_SPI && CONFIG_MFRC522 */
diff --git a/boards/arm/stm32l1/nucleo-l152re/configs/lcd/defconfig b/boards/arm/stm32l1/nucleo-l152re/configs/lcd/defconfig
index 73ee4c8eb4e..d41251bdc21 100644
--- a/boards/arm/stm32l1/nucleo-l152re/configs/lcd/defconfig
+++ b/boards/arm/stm32l1/nucleo-l152re/configs/lcd/defconfig
@@ -9,6 +9,7 @@
# CONFIG_NX_DISABLE_16BPP is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l152re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L152RE=y
CONFIG_ARCH_CHIP="stm32l1"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l1/nucleo-l152re/configs/nsh/defconfig b/boards/arm/stm32l1/nucleo-l152re/configs/nsh/defconfig
index 3b73a53c8df..b33889f1990 100644
--- a/boards/arm/stm32l1/nucleo-l152re/configs/nsh/defconfig
+++ b/boards/arm/stm32l1/nucleo-l152re/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_NSH_ARGCAT is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l152re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L152RE=y
CONFIG_ARCH_CHIP="stm32l1"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l4/nucleo-l432kc/configs/nsh/defconfig b/boards/arm/stm32l4/nucleo-l432kc/configs/nsh/defconfig
index dbc3a0ea493..d74ba23b5f5 100644
--- a/boards/arm/stm32l4/nucleo-l432kc/configs/nsh/defconfig
+++ b/boards/arm/stm32l4/nucleo-l432kc/configs/nsh/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l432kc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L432KC=y
CONFIG_ARCH_CHIP="stm32l4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l4/nucleo-l432kc/configs/spwm/defconfig b/boards/arm/stm32l4/nucleo-l432kc/configs/spwm/defconfig
index 19d272a0fd5..89d96fbd3e6 100644
--- a/boards/arm/stm32l4/nucleo-l432kc/configs/spwm/defconfig
+++ b/boards/arm/stm32l4/nucleo-l432kc/configs/spwm/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STM32_SYSCFG is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l432kc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L432KC=y
CONFIG_ARCH_CHIP="stm32l4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l4/nucleo-l432kc/configs/wgen/defconfig b/boards/arm/stm32l4/nucleo-l432kc/configs/wgen/defconfig
index 49803835477..182919157e5 100644
--- a/boards/arm/stm32l4/nucleo-l432kc/configs/wgen/defconfig
+++ b/boards/arm/stm32l4/nucleo-l432kc/configs/wgen/defconfig
@@ -13,6 +13,7 @@
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l432kc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L432KC=y
CONFIG_ARCH_CHIP="stm32l4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l4/nucleo-l452re/configs/nsh/defconfig b/boards/arm/stm32l4/nucleo-l452re/configs/nsh/defconfig
index 096df367817..3207fd25a75 100644
--- a/boards/arm/stm32l4/nucleo-l452re/configs/nsh/defconfig
+++ b/boards/arm/stm32l4/nucleo-l452re/configs/nsh/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l452re"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L452RE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32l4"
diff --git a/boards/arm/stm32l4/nucleo-l476rg/configs/nsh/defconfig b/boards/arm/stm32l4/nucleo-l476rg/configs/nsh/defconfig
index 09c040793ff..4b2c9ea748e 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/configs/nsh/defconfig
+++ b/boards/arm/stm32l4/nucleo-l476rg/configs/nsh/defconfig
@@ -12,6 +12,7 @@
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l476rg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L476RG=y
CONFIG_ARCH_CHIP="stm32l4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l4/nucleo-l476rg/configs/nxdemo/defconfig b/boards/arm/stm32l4/nucleo-l476rg/configs/nxdemo/defconfig
index f71159d49eb..134810566b3 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/configs/nxdemo/defconfig
+++ b/boards/arm/stm32l4/nucleo-l476rg/configs/nxdemo/defconfig
@@ -13,6 +13,7 @@
# CONFIG_NX_DISABLE_1BPP is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l476rg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L476RG=y
CONFIG_ARCH_CHIP="stm32l4"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt b/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt
index caeda607c1d..9be3e4b7a87 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt
@@ -47,10 +47,6 @@ if(CONFIG_DEV_GPIO)
list(APPEND SRCS stm32_gpio.c)
endif()
-if(CONFIG_CAN)
- list(APPEND SRCS stm32_can.c)
-endif()
-
if(CONFIG_MMCSD_SPI)
list(APPEND SRCS stm32_spimmcsd.c)
endif()
@@ -83,10 +79,6 @@ if(CONFIG_SENSORS_BMP180)
list(APPEND SRCS stm32_bmp180.c)
endif()
-if(CONFIG_SENSORS_BMP280)
- list(APPEND SRCS stm32_bmp280.c)
-endif()
-
if(CONFIG_SENSORS_MPU9250)
list(APPEND SRCS stm32_mpu9250.c)
endif()
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs b/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs
index c2041c94b3b..9ce1c41de9c 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs
@@ -51,9 +51,6 @@ CSRCS += stm32_gpio.c
endif
# Ben vd Veen (DisruptiveNL) -- 31-03-2018
-ifeq ($(CONFIG_CAN),y)
-CSRCS += stm32_can.c
-endif
ifeq ($(CONFIG_MMCSD_SPI),y)
CSRCS += stm32_spimmcsd.c
@@ -87,10 +84,6 @@ ifeq ($(CONFIG_SENSORS_BMP180),y)
CSRCS += stm32_bmp180.c
endif
-ifeq ($(CONFIG_SENSORS_BMP280),y)
- CSRCS += stm32_bmp280.c
-endif
-
ifeq ($(CONFIG_SENSORS_MPU9250),y)
CSRCS += stm32_mpu9250.c
endif
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h b/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h
index 664d7c2da77..1a566a24ea1 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h
@@ -325,19 +325,6 @@ void stm32_usbinitialize(void);
int stm32_gpio_initialize(void);
#endif
-/****************************************************************************
- * Name: stm32_can_setup -- DisruptiveNL
- *
- * Description:
- * Initialize CAN and register the CAN device.
- * Added by: Ben vd Veen (DisruptiveNL) -- www.nuttx.nl
- *
- ****************************************************************************/
-
-#ifdef CONFIG_CAN
-int stm32_can_setup(void);
-#endif
-
/****************************************************************************
* Name: stm32_pwm_setup
*
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c
deleted file mode 100644
index 55b74b50d38..00000000000
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdio.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/arch.h>
-#include <nuttx/sensors/bmp280.h>
-#include <nuttx/i2c/i2c_master.h>
-
-#include "stm32.h"
-#include "stm32l4_i2c.h"
-#include "stm32_bmp280.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_bmp280_initialize
- *
- * Description:
- * Initialize and register the BMP280 Pressure Sensor driver.
- *
- * Input Parameters:
- * devno - The device number, used to build the device path as /dev/pressN
- * busno - The I2C bus number
- *
- * Returned Value:
- * Zero (OK) on success; a negated errno value on failure.
- *
- ****************************************************************************/
-
-int board_bmp280_initialize(int devno, int busno)
-{
- struct i2c_master_s *i2c;
- int ret;
-
- sninfo("Initializing BMP280!\n");
-
- /* Initialize BMP280 */
-
- i2c = stm32_i2cbus_initialize(busno);
-
- if (i2c)
- {
- /* Then try to register the barometer sensor in I2Cx */
-
- ret = bmp280_register(devno, i2c);
- if (ret < 0)
- {
- snerr("ERROR: Error registering BMP280 in I2C%d\n", busno);
- }
- }
- else
- {
- ret = -ENODEV;
- }
-
- return ret;
-}
-
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h
deleted file mode 100644
index 72b1aa089f8..00000000000
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32l4/nucleo-l476rg/src/stm32_bmp280.h
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-#ifndef __BOARDS_ARM_STM32L4_NUCLEO_L476RG_INCLUDE_NUCLEO_L476RG_BMP280_H
-#define __BOARDS_ARM_STM32L4_NUCLEO_L476RG_INCLUDE_NUCLEO_L476RG_BMP280_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Type Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-/****************************************************************************
- * Inline Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_bmp280_initialize
- *
- * Description:
- * Initialize and register the BMP280 Pressure Sensor driver.
- *
- * Input Parameters:
- * devno - The device number, used to build the device path as /dev/pressN
- * busno - The I2C bus number
- *
- * Returned Value:
- * Zero (OK) on success; a negated errno value on failure.
- *
- ****************************************************************************/
-
-int board_bmp280_initialize(int devno, int busno);
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __BOARDS_ARM_STM32L4_NUCLEO_L476RG_INCLUDE_NUCLEO_L476RG_BMP280_H */
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
index 4b229423773..0355fb9b0f5 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
@@ -65,6 +65,8 @@
#include "stm32_mpu9250.h"
#endif
+#include "stm32_can_setup.h"
+
/****************************************************************************
* Private Data
****************************************************************************/
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c
deleted file mode 100644
index 117aa61f8f7..00000000000
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32l4/nucleo-l476rg/src/stm32_can.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/* Added by: Ben vd Veen (DisruptiveNL) -- www.nuttx.nl */
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdbool.h>
-#include <errno.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/can/can.h>
-
-#include "stm32l4_can.h"
-#include "nucleo-l476rg.h"
-
-#ifdef CONFIG_CAN
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#if defined(CONFIG_STM32_CAN1)
-# warning "Both CAN1 and CAN2 are enabled. Only CAN1 is connected."
-#endif
-
-#ifdef CONFIG_STM32_CAN1
-# define CAN_PORT 1
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_can_setup
- *
- * Description:
- * Initialize CAN and register the CAN device
- *
- ****************************************************************************/
-
-int stm32_can_setup(void)
-{
-#ifdef CONFIG_STM32_CAN1
- struct can_dev_s *can;
- int ret;
-
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- can = stm32_caninitialize(CAN_PORT);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- /* Register the CAN driver at "/dev/can0" */
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
- return OK;
-#else
- return -ENODEV;
-#endif
-}
-
-#endif /* CONFIG_CAN */
diff --git a/boards/arm/stm32l4/nucleo-l496zg/configs/nsh/defconfig b/boards/arm/stm32l4/nucleo-l496zg/configs/nsh/defconfig
index 71cee2c8a19..ab3a443e07c 100644
--- a/boards/arm/stm32l4/nucleo-l496zg/configs/nsh/defconfig
+++ b/boards/arm/stm32l4/nucleo-l496zg/configs/nsh/defconfig
@@ -11,6 +11,7 @@ CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l496zg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L496ZG=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32l4"
diff --git a/boards/arm/stm32l5/nucleo-l552ze/configs/nsh/defconfig b/boards/arm/stm32l5/nucleo-l552ze/configs/nsh/defconfig
index f92e3c47ba9..6471eb437d6 100644
--- a/boards/arm/stm32l5/nucleo-l552ze/configs/nsh/defconfig
+++ b/boards/arm/stm32l5/nucleo-l552ze/configs/nsh/defconfig
@@ -9,6 +9,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-l552ze"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_L552ZE=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32l5"
diff --git a/boards/arm/stm32n6/nucleo-n657x0-q/configs/leds/defconfig b/boards/arm/stm32n6/nucleo-n657x0-q/configs/leds/defconfig
index 91975793f41..1bd3e4f4ff1 100644
--- a/boards/arm/stm32n6/nucleo-n657x0-q/configs/leds/defconfig
+++ b/boards/arm/stm32n6/nucleo-n657x0-q/configs/leds/defconfig
@@ -8,6 +8,7 @@
# CONFIG_ARCH_LEDS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-n657x0-q"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_N657X0_Q=y
CONFIG_ARCH_CHIP="stm32n6"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32n6/nucleo-n657x0-q/configs/nsh/defconfig b/boards/arm/stm32n6/nucleo-n657x0-q/configs/nsh/defconfig
index 0f35eb8c024..4078a55a5fd 100644
--- a/boards/arm/stm32n6/nucleo-n657x0-q/configs/nsh/defconfig
+++ b/boards/arm/stm32n6/nucleo-n657x0-q/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-n657x0-q"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_N657X0_Q=y
CONFIG_ARCH_CHIP="stm32n6"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32n6/nucleo-n657x0-q/configs/ostest/defconfig b/boards/arm/stm32n6/nucleo-n657x0-q/configs/ostest/defconfig
index 772fa00937f..f8a2e03eb23 100644
--- a/boards/arm/stm32n6/nucleo-n657x0-q/configs/ostest/defconfig
+++ b/boards/arm/stm32n6/nucleo-n657x0-q/configs/ostest/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-n657x0-q"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_N657X0_Q=y
CONFIG_ARCH_CHIP="stm32n6"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32u0/nucleo-u083rc/configs/nsh/defconfig b/boards/arm/stm32u0/nucleo-u083rc/configs/nsh/defconfig
index 5f6c73b7ac2..16f38337580 100644
--- a/boards/arm/stm32u0/nucleo-u083rc/configs/nsh/defconfig
+++ b/boards/arm/stm32u0/nucleo-u083rc/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-u083rc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_U083RC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32u0"
diff --git a/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/jumbo/defconfig b/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/jumbo/defconfig
index 95322dd4b9f..238d30f4048 100644
--- a/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/jumbo/defconfig
+++ b/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/jumbo/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-u3c5zi-q"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_U3C5ZI_Q=y
CONFIG_ARCH_CHIP="stm32u3"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/nsh/defconfig b/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/nsh/defconfig
index 704c372558d..7bce1dea7e1 100644
--- a/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/nsh/defconfig
+++ b/boards/arm/stm32u3/nucleo-u3c5zi-q/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-u3c5zi-q"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_U3C5ZI_Q=y
CONFIG_ARCH_CHIP="stm32u3"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32u5/nucleo-u5a5zj-q/configs/nsh/defconfig b/boards/arm/stm32u5/nucleo-u5a5zj-q/configs/nsh/defconfig
index 62d5aa14537..874ea873b6c 100644
--- a/boards/arm/stm32u5/nucleo-u5a5zj-q/configs/nsh/defconfig
+++ b/boards/arm/stm32u5/nucleo-u5a5zj-q/configs/nsh/defconfig
@@ -10,6 +10,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-u5a5zj-q"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_U5A5ZJ_Q=y
CONFIG_ARCH_CHIP="stm32u5"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/configs/ble/defconfig b/boards/arm/stm32wb/nucleo-wb55rg/configs/ble/defconfig
index cb0bc5bb913..36a19d69569 100644
--- a/boards/arm/stm32wb/nucleo-wb55rg/configs/ble/defconfig
+++ b/boards/arm/stm32wb/nucleo-wb55rg/configs/ble/defconfig
@@ -9,6 +9,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-wb55rg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_WB55RG=y
CONFIG_ARCH_CHIP="stm32wb"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig b/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig
index 73b3510b415..1646f1f2223 100644
--- a/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig
+++ b/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig
@@ -11,6 +11,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-wb55rg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_WB55RG=y
CONFIG_ARCH_CHIP="stm32wb"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/configs/nsh/defconfig b/boards/arm/stm32wb/nucleo-wb55rg/configs/nsh/defconfig
index cdd024ed73b..12c5f0f056e 100644
--- a/boards/arm/stm32wb/nucleo-wb55rg/configs/nsh/defconfig
+++ b/boards/arm/stm32wb/nucleo-wb55rg/configs/nsh/defconfig
@@ -7,6 +7,7 @@
#
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-wb55rg"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_WB55RG=y
CONFIG_ARCH_CHIP="stm32wb"
CONFIG_ARCH_CHIP_STM32=y
diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/configs/demo/defconfig b/boards/arm/stm32wl5/nucleo-wl55jc/configs/demo/defconfig
index 7a097b223f4..13542c05e21 100644
--- a/boards/arm/stm32wl5/nucleo-wl55jc/configs/demo/defconfig
+++ b/boards/arm/stm32wl5/nucleo-wl55jc/configs/demo/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-wl55jc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE=116
CONFIG_ARCH_BOARD_FLASH_MOUNT=y
CONFIG_ARCH_BOARD_FLASH_PART1_MNT=""
diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/configs/nsh/defconfig b/boards/arm/stm32wl5/nucleo-wl55jc/configs/nsh/defconfig
index 7a7e9b2a68b..4b3f9efbc34 100644
--- a/boards/arm/stm32wl5/nucleo-wl55jc/configs/nsh/defconfig
+++ b/boards/arm/stm32wl5/nucleo-wl55jc/configs/nsh/defconfig
@@ -8,6 +8,7 @@
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="nucleo-wl55jc"
+CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_NUCLEO_WL55JC=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32wl5"
(nuttx) 07/09: boards/arm: mount procfs and tmpfs in the common STM32 board init
Posted by xi...@apache.org.
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 4497bbee8850f0b373f6f66bbc03c3a045e70453
Author: raiden00pl <ra...@railab.me>
AuthorDate: Sun Oct 11 19:11:58 2026 +0200
boards/arm: mount procfs and tmpfs in the common STM32 board init
Mount procfs at CONFIG_NSH_PROC_MOUNTPOINT (or /proc) and tmpfs at
CONFIG_LIBC_TMPDIR in stm32_common_initialize() and remove the copies
from the Nucleo boards, together with their now unused HAVE_PROC and
STM32_PROCFS_MOUNTPOINT definitions and <sys/mount.h> includes.
A failed mount is logged and the initialization continues. Some boards
returned an error from the bringup in this case.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/arm/common/stm32/src/board_common.c | 46 ++++++++++++++++++++++
.../arm/stm32c5/nucleo-c562re/src/stm32_bringup.c | 10 -----
.../arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c | 10 -----
.../arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c | 10 -----
.../arm/stm32f4/nucleo-f412zg/src/nucleo-f412zg.h | 10 -----
.../arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c | 11 ------
boards/arm/stm32f4/nucleo-f429zi/src/nucleo-144.h | 10 -----
boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c | 11 ------
.../arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h | 10 -----
.../arm/stm32f4/nucleo-f446re/src/stm32_bringup.c | 11 ------
.../arm/stm32f7/nucleo-f722ze/src/nucleo-f722ze.h | 10 -----
.../arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c | 11 ------
.../arm/stm32f7/nucleo-f746zg/src/nucleo-f746zg.h | 10 -----
.../arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c | 11 ------
.../arm/stm32f7/nucleo-f767zi/src/nucleo-f767zi.h | 10 -----
.../arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c | 11 ------
.../arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h | 10 -----
.../arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c | 11 ------
.../arm/stm32h5/nucleo-h503rb/src/nucleo-h503rb.h | 10 -----
.../arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c | 11 ------
.../arm/stm32h5/nucleo-h533re/src/nucleo-h533re.h | 10 -----
.../arm/stm32h5/nucleo-h533re/src/stm32_bringup.c | 11 ------
.../arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h | 10 -----
.../arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c | 11 ------
.../arm/stm32h7/nucleo-h723zg/src/nucleo-h723zg.h | 11 ------
.../arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c | 11 ------
.../arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h | 11 ------
.../arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c | 22 -----------
.../arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c | 11 ------
.../arm/stm32h7/nucleo-h745zi/src/nucleo-h745zi.h | 11 ------
.../arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c | 11 ------
.../arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c | 11 ------
.../arm/stm32h7/nucleo-h7s3l8/src/nucleo-h7s3l8.h | 8 ----
.../arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c | 11 ------
.../arm/stm32l1/nucleo-l152re/src/nucleo-l152re.h | 9 -----
boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c | 11 ------
.../arm/stm32l4/nucleo-l432kc/src/nucleo-l432kc.h | 10 -----
.../arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c | 14 -------
.../arm/stm32l4/nucleo-l452re/src/nucleo-l452re.h | 10 -----
.../arm/stm32l4/nucleo-l452re/src/stm32_bringup.c | 10 -----
.../arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h | 10 -----
.../arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 14 -------
boards/arm/stm32l4/nucleo-l496zg/src/nucleo-144.h | 10 -----
.../arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c | 11 ------
.../arm/stm32l5/nucleo-l552ze/src/nucleo-l552ze.h | 10 -----
.../arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c | 11 ------
.../stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c | 11 +-----
.../stm32u5/nucleo-u5a5zj-q/src/nucleo-u5a5zj-q.h | 10 -----
.../stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c | 11 ------
.../arm/stm32wb/nucleo-wb55rg/src/nucleo-wb55rg.h | 10 -----
boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c | 16 --------
.../arm/stm32wl5/nucleo-wl55jc/src/nucleo-wl55jc.h | 11 ------
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c | 14 -------
53 files changed, 47 insertions(+), 570 deletions(-)
diff --git a/boards/arm/common/stm32/src/board_common.c b/boards/arm/common/stm32/src/board_common.c
index e31706756a8..b9b7fcd772f 100644
--- a/boards/arm/common/stm32/src/board_common.c
+++ b/boards/arm/common/stm32/src/board_common.c
@@ -27,6 +27,9 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <syslog.h>
+
+#include <nuttx/fs/fs.h>
#include <arch/board/board.h>
@@ -36,6 +39,24 @@
#include "board_common.h"
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_DISABLE_MOUNTPOINT)
+# define HAVE_PROCFS
+#endif
+
+#if defined(CONFIG_FS_TMPFS) && !defined(CONFIG_DISABLE_MOUNTPOINT)
+# define HAVE_TMPFS
+#endif
+
+#ifdef CONFIG_NSH_PROC_MOUNTPOINT
+# define PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
+#else
+# define PROCFS_MOUNTPOINT "/proc"
+#endif
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -50,6 +71,30 @@
int stm32_common_initialize(void)
{
+ int ret;
+
+#ifdef HAVE_PROCFS
+ /* Mount the procfs file system */
+
+ ret = nx_mount(NULL, PROCFS_MOUNTPOINT, "procfs", 0, NULL);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
+ PROCFS_MOUNTPOINT, ret);
+ }
+#endif
+
+#ifdef HAVE_TMPFS
+ /* Mount the tmpfs file system */
+
+ ret = nx_mount(NULL, CONFIG_LIBC_TMPDIR, "tmpfs", 0, NULL);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to mount tmpfs at %s: %d\n",
+ CONFIG_LIBC_TMPDIR, ret);
+ }
+#endif
+
#ifdef CONFIG_STM32_IWDG
/* Initialize the independent watchdog */
@@ -62,5 +107,6 @@ int stm32_common_initialize(void)
stm32_wwdginitialize("/dev/watchdog1");
#endif
+ UNUSED(ret);
return OK;
}
diff --git a/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c b/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c
index d84c84abdfc..8c73d8f51d9 100644
--- a/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c
+++ b/boards/arm/stm32c5/nucleo-c562re/src/stm32_bringup.c
@@ -26,8 +26,6 @@
#include <nuttx/config.h>
-#include <sys/mount.h>
-
#include <nuttx/debug.h>
#include <nuttx/board.h>
#include <nuttx/input/buttons.h>
@@ -51,14 +49,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- return ret;
- }
-#endif
-
#ifdef CONFIG_INPUT_BUTTONS
/* Register the BUTTON lower-half driver. */
diff --git a/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c b/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c
index ce06f09b1cc..09e6d99ed58 100644
--- a/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c
+++ b/boards/arm/stm32f0/nucleo-f072rb/src/stm32_bringup.c
@@ -81,16 +81,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#ifdef HAVE_I2C_DRIVER
/* Get the I2C lower half instance */
diff --git a/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c b/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c
index 874918c193b..8fb4f5faa66 100644
--- a/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c
+++ b/boards/arm/stm32f0/nucleo-f091rc/src/stm32_bringup.c
@@ -62,16 +62,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#ifdef CONFIG_LPWAN_SX127X
ret = stm32_lpwaninitialize();
if (ret < 0)
diff --git a/boards/arm/stm32f4/nucleo-f412zg/src/nucleo-f412zg.h b/boards/arm/stm32f4/nucleo-f412zg/src/nucleo-f412zg.h
index 203f5ce9273..b5f2cbbdba1 100644
--- a/boards/arm/stm32f4/nucleo-f412zg/src/nucleo-f412zg.h
+++ b/boards/arm/stm32f4/nucleo-f412zg/src/nucleo-f412zg.h
@@ -87,16 +87,6 @@
GPIO_PUSHPULL|GPIO_PORTD|GPIO_PIN5)
#endif
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/****************************************************************************
* Public Data
****************************************************************************/
diff --git a/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c
index 310a5c88794..33563d20e12 100644
--- a/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c
+++ b/boards/arm/stm32f4/nucleo-f412zg/src/stm32_bringup.c
@@ -80,16 +80,5 @@ int stm32_bringup(void)
}
#endif
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
return ret;
}
diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/nucleo-144.h b/boards/arm/stm32f4/nucleo-f429zi/src/nucleo-144.h
index 60e0078b43c..df0e096e83b 100644
--- a/boards/arm/stm32f4/nucleo-f429zi/src/nucleo-144.h
+++ b/boards/arm/stm32f4/nucleo-f429zi/src/nucleo-144.h
@@ -37,16 +37,6 @@
/* Configuration ************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* Nucleo-144 GPIO Pin Definitions ******************************************/
/* LED
diff --git a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c b/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c
index 13b1853844a..fcfbe649548 100644
--- a/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c
+++ b/boards/arm/stm32f4/nucleo-f429zi/src/stm32_boot.c
@@ -151,17 +151,6 @@ void board_late_initialize(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
#ifdef CONFIG_STM32_ROMFS
/* Mount the romfs partition */
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h b/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h
index 223adba0ba7..67730ffe488 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h
+++ b/boards/arm/stm32f4/nucleo-f446re/src/nucleo-f446re.h
@@ -40,16 +40,6 @@
/* Configuration ************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
#define HAVE_MMCSD 1
#if !defined(CONFIG_STM32_SDIO) || !defined(CONFIG_MMCSD) || \
!defined(CONFIG_MMCSD_SDIO)
diff --git a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
index 6875792c45a..cabda7fed9a 100644
--- a/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
+++ b/boards/arm/stm32f4/nucleo-f446re/src/stm32_bringup.c
@@ -103,17 +103,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#ifdef CONFIG_STM32_ROMFS
ret = stm32_romfs_initialize();
if (ret < 0)
diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/nucleo-f722ze.h b/boards/arm/stm32f7/nucleo-f722ze/src/nucleo-f722ze.h
index 4b4039a3e9b..e119f98e0b9 100644
--- a/boards/arm/stm32f7/nucleo-f722ze/src/nucleo-f722ze.h
+++ b/boards/arm/stm32f7/nucleo-f722ze/src/nucleo-f722ze.h
@@ -37,16 +37,6 @@
/* Configuration ************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* nucleo-f722ze GPIO Pin Definitions ***************************************/
/* LED
diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c
index f9ef15cbfd0..4ffd648e7d6 100644
--- a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c
+++ b/boards/arm/stm32f7/nucleo-f722ze/src/stm32_bringup.c
@@ -97,17 +97,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
#ifdef CONFIG_STM32_ROMFS
/* Mount the romfs partition */
diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/nucleo-f746zg.h b/boards/arm/stm32f7/nucleo-f746zg/src/nucleo-f746zg.h
index 5b53859c280..21796b786ec 100644
--- a/boards/arm/stm32f7/nucleo-f746zg/src/nucleo-f746zg.h
+++ b/boards/arm/stm32f7/nucleo-f746zg/src/nucleo-f746zg.h
@@ -37,16 +37,6 @@
/* Configuration ************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* nucleo-f746zg GPIO Pin Definitions ***************************************/
/* LED
diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c
index f1dca28d61a..2028404da7d 100644
--- a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c
+++ b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_bringup.c
@@ -101,17 +101,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
#ifdef CONFIG_STM32_ROMFS
/* Mount the romfs partition */
diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/nucleo-f767zi.h b/boards/arm/stm32f7/nucleo-f767zi/src/nucleo-f767zi.h
index 2816cc143d2..54bf05c6f33 100644
--- a/boards/arm/stm32f7/nucleo-f767zi/src/nucleo-f767zi.h
+++ b/boards/arm/stm32f7/nucleo-f767zi/src/nucleo-f767zi.h
@@ -37,16 +37,6 @@
/* Configuration ************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* nucleo-f767zi GPIO Pin Definitions ***************************************/
/* LED
diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c
index cf1e12f6592..3d666441cb9 100644
--- a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c
+++ b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_bringup.c
@@ -112,17 +112,6 @@ int stm32_bringup(void)
#endif
#endif
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
#ifdef CONFIG_STM32_ROMFS
/* Mount the romfs partition */
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h b/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h
index 917c3909fa2..44f8beda171 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/nucleo-g431rb.h
@@ -33,16 +33,6 @@
* Pre-processor Definitions
****************************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* LED definitions **********************************************************/
/* LED definitions **********************************************************/
diff --git a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
index a1d9321114d..dbbcf6dc97e 100644
--- a/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
+++ b/boards/arm/stm32g4/nucleo-g431rb/src/stm32_bringup.c
@@ -87,17 +87,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#ifdef CONFIG_INPUT_BUTTONS
/* Register the BUTTON driver */
diff --git a/boards/arm/stm32h5/nucleo-h503rb/src/nucleo-h503rb.h b/boards/arm/stm32h5/nucleo-h503rb/src/nucleo-h503rb.h
index 00bdb2595bb..a30506260d9 100644
--- a/boards/arm/stm32h5/nucleo-h503rb/src/nucleo-h503rb.h
+++ b/boards/arm/stm32h5/nucleo-h503rb/src/nucleo-h503rb.h
@@ -39,18 +39,8 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c
index 22c3de49afd..5f76478b48d 100644
--- a/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c
+++ b/boards/arm/stm32h5/nucleo-h503rb/src/stm32_bringup.c
@@ -26,7 +26,6 @@
#include <nuttx/config.h>
-#include <sys/mount.h>
#include <sys/types.h>
#include <nuttx/debug.h>
@@ -68,16 +67,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32h5/nucleo-h533re/src/nucleo-h533re.h b/boards/arm/stm32h5/nucleo-h533re/src/nucleo-h533re.h
index 8a73d03b8cc..c264ee79502 100644
--- a/boards/arm/stm32h5/nucleo-h533re/src/nucleo-h533re.h
+++ b/boards/arm/stm32h5/nucleo-h533re/src/nucleo-h533re.h
@@ -39,18 +39,8 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c
index f6207256b0e..c214e234d60 100644
--- a/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c
+++ b/boards/arm/stm32h5/nucleo-h533re/src/stm32_bringup.c
@@ -26,7 +26,6 @@
#include <nuttx/config.h>
-#include <sys/mount.h>
#include <sys/types.h>
#include <nuttx/debug.h>
@@ -68,16 +67,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h b/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h
index 10c8a5061f5..96866ab06f3 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/nucleo-h563zi.h
@@ -39,18 +39,8 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
index 398526a4a48..7bfe6d24ad6 100644
--- a/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
+++ b/boards/arm/stm32h5/nucleo-h563zi/src/stm32_bringup.c
@@ -26,7 +26,6 @@
#include <nuttx/config.h>
-#include <sys/mount.h>
#include <sys/types.h>
#include <nuttx/debug.h>
@@ -74,16 +73,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32h7/nucleo-h723zg/src/nucleo-h723zg.h b/boards/arm/stm32h7/nucleo-h723zg/src/nucleo-h723zg.h
index 4302c7eec2e..12150f10779 100644
--- a/boards/arm/stm32h7/nucleo-h723zg/src/nucleo-h723zg.h
+++ b/boards/arm/stm32h7/nucleo-h723zg/src/nucleo-h723zg.h
@@ -38,7 +38,6 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_USBDEV 1
#define HAVE_USBMONITOR 1
#define HAVE_MTDCONFIG 1
@@ -87,16 +86,6 @@
# define FLASH_BASED_PARAMS
#endif
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* Check if we can support the RTC driver */
#define HAVE_RTC_DRIVER 1
diff --git a/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c
index 03d5b7dbfb9..428304e6cf6 100644
--- a/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c
+++ b/boards/arm/stm32h7/nucleo-h723zg/src/stm32_bringup.c
@@ -147,17 +147,6 @@ int stm32_bringup(void)
stm32_i2ctool();
#endif
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#ifdef CONFIG_INPUT_BUTTONS
/* Register the BUTTON driver */
diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h b/boards/arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h
index 2523adbe4a9..f4d9678ae05 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h
+++ b/boards/arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h
@@ -38,7 +38,6 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_USBDEV 1
#define HAVE_USBHOST 1
#define HAVE_USBMONITOR 1
@@ -95,16 +94,6 @@
# define FLASH_BASED_PARAMS
#endif
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* Check if we can support the RTC driver */
#define HAVE_RTC_DRIVER 1
diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c
index 392b1427b18..913ab2abe50 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c
+++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c
@@ -270,28 +270,6 @@ int stm32_bringup(void)
stm32_i2ctool();
#endif
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
-#ifdef CONFIG_FS_TMPFS
- /* Mount the tmpfs file system */
-
- ret = nx_mount(NULL, CONFIG_LIBC_TMPDIR, "tmpfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount tmpfs at %s: %d\n",
- CONFIG_LIBC_TMPDIR, ret);
- }
-#endif
-
#ifdef CONFIG_STM32_ROMFS
/* Mount the romfs partition */
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c
index f39257d5a93..b2027f9005f 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c
+++ b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c
@@ -99,17 +99,6 @@ int stm32_bringup(void)
UNUSED(ret);
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32h7/nucleo-h745zi/src/nucleo-h745zi.h b/boards/arm/stm32h7/nucleo-h745zi/src/nucleo-h745zi.h
index fa2747b2f48..d6aecdbab69 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/src/nucleo-h745zi.h
+++ b/boards/arm/stm32h7/nucleo-h745zi/src/nucleo-h745zi.h
@@ -38,7 +38,6 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_USBDEV 1
#define HAVE_USBHOST 1
#define HAVE_USBMONITOR 1
@@ -95,16 +94,6 @@
# define FLASH_BASED_PARAMS
#endif
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* Check if we can support the RTC driver */
#define HAVE_RTC_DRIVER 1
diff --git a/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c
index d94cc6ffeba..b55fd75ebd5 100644
--- a/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c
+++ b/boards/arm/stm32h7/nucleo-h745zi/src/stm32_bringup.c
@@ -103,17 +103,6 @@ int stm32_bringup(void)
UNUSED(ret);
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#ifdef CONFIG_RPTUN
# ifdef CONFIG_ARCH_CHIP_STM32H7_CORTEXM7
stm32_rptun_init("cm4");
diff --git a/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c
index 04a9a3dffc7..c4cc607a87c 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c
+++ b/boards/arm/stm32h7/nucleo-h753zi/src/stm32_bringup.c
@@ -93,17 +93,6 @@ int stm32_bringup(void)
UNUSED(ret);
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/src/nucleo-h7s3l8.h b/boards/arm/stm32h7/nucleo-h7s3l8/src/nucleo-h7s3l8.h
index de83d353fc0..d24d8e9cce5 100644
--- a/boards/arm/stm32h7/nucleo-h7s3l8/src/nucleo-h7s3l8.h
+++ b/boards/arm/stm32h7/nucleo-h7s3l8/src/nucleo-h7s3l8.h
@@ -64,14 +64,6 @@
/* procfs file system */
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
diff --git a/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c b/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c
index 1def13e400f..b41f253ace3 100644
--- a/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c
+++ b/boards/arm/stm32h7/nucleo-h7s3l8/src/stm32_bringup.c
@@ -71,17 +71,6 @@ int stm32_bringup(void)
UNUSED(ret);
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- }
-#endif /* CONFIG_FS_PROCFS */
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32l1/nucleo-l152re/src/nucleo-l152re.h b/boards/arm/stm32l1/nucleo-l152re/src/nucleo-l152re.h
index 7533f5860f9..2a27333cc1f 100644
--- a/boards/arm/stm32l1/nucleo-l152re/src/nucleo-l152re.h
+++ b/boards/arm/stm32l1/nucleo-l152re/src/nucleo-l152re.h
@@ -110,15 +110,6 @@ struct lcd_dev_s *stm32_ili93418b_initialize(void);
int stm32_spisd_initialize(int port, int minor);
#endif
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
- #ifdef CONFIG_NSH_PROC_MOUNTPOINT
- #define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
- #else
- #define STM32_PROCFS_MOUNTPOINT "/proc"
- #endif
-#endif /* CONFIG_FS_PROCFS */
#endif /* __BOARDS_ARM_STM32_NUCLEO_L152RE_SRC_NUCLEO_L152RE_H */
/****************************************************************************
diff --git a/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c b/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c
index 80892d840ed..ef9740ea9c4 100644
--- a/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c
+++ b/boards/arm/stm32l1/nucleo-l152re/src/stm32_boot.c
@@ -179,17 +179,6 @@ void board_late_initialize(void)
}
#endif
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(0, STM32_PROCFS_MOUNTPOINT, "procfs", 0, 0);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
#ifdef CONFIG_MMCSD_SPI
/* Initialize the MMC/SD SPI driver (SPI1 is used) */
diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/nucleo-l432kc.h b/boards/arm/stm32l4/nucleo-l432kc/src/nucleo-l432kc.h
index d9165452be7..8158cf82fb1 100644
--- a/boards/arm/stm32l4/nucleo-l432kc/src/nucleo-l432kc.h
+++ b/boards/arm/stm32l4/nucleo-l432kc/src/nucleo-l432kc.h
@@ -40,19 +40,9 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
#define HAVE_AT45DB 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c
index bb23cc493ee..dd99dab8afd 100644
--- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c
+++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_bringup.c
@@ -105,20 +105,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef HAVE_PROC
- /* Mount the proc filesystem */
-
- syslog(LOG_INFO, "Mounting procfs to /proc\n");
-
- ret = nx_mount(NULL, CONFIG_NSH_PROC_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount the PROC filesystem: %d\n",
- ret);
- return ret;
- }
-#endif
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32l4/nucleo-l452re/src/nucleo-l452re.h b/boards/arm/stm32l4/nucleo-l452re/src/nucleo-l452re.h
index 50a629b7677..ec7a0f798c1 100644
--- a/boards/arm/stm32l4/nucleo-l452re/src/nucleo-l452re.h
+++ b/boards/arm/stm32l4/nucleo-l452re/src/nucleo-l452re.h
@@ -39,19 +39,9 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
#define HAVE_MMCSD 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c
index 8616fe51e62..01d59511480 100644
--- a/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c
+++ b/boards/arm/stm32l4/nucleo-l452re/src/stm32_bringup.c
@@ -82,16 +82,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#ifdef CONFIG_INPUT_BUTTONS
#ifdef CONFIG_INPUT_BUTTONS_LOWER
iinfo("Initializing button driver\n");
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h b/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h
index 1a566a24ea1..902e07de319 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h
@@ -40,21 +40,11 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
#define HAVE_MMCSD_SPI 1
#define HAVE_MMCSD_SDIO 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
index a05231db885..e3e8fcee608 100644
--- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
+++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c
@@ -173,20 +173,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef HAVE_PROC
- /* Mount the proc filesystem */
-
- syslog(LOG_INFO, "Mounting procfs to /proc\n");
-
- ret = nx_mount(NULL, CONFIG_NSH_PROC_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
- return ret;
- }
-#endif
-
#ifdef HAVE_RTC_DRIVER
/* Instantiate the STM32L4 lower-half RTC driver */
diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/nucleo-144.h b/boards/arm/stm32l4/nucleo-l496zg/src/nucleo-144.h
index f13694a49e5..4d90765abf9 100644
--- a/boards/arm/stm32l4/nucleo-l496zg/src/nucleo-144.h
+++ b/boards/arm/stm32l4/nucleo-l496zg/src/nucleo-144.h
@@ -40,16 +40,6 @@
/* Configuration ************************************************************/
-/* procfs File System */
-
-#ifdef CONFIG_FS_PROCFS
-# ifdef CONFIG_NSH_PROC_MOUNTPOINT
-# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
-# else
-# define STM32_PROCFS_MOUNTPOINT "/proc"
-# endif
-#endif
-
/* Nucleo-144 GPIO Pin Definitions ******************************************/
/* LED
diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c
index 05bd260b69a..e513261b52a 100644
--- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c
+++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_bringup.c
@@ -82,17 +82,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
- STM32_PROCFS_MOUNTPOINT, ret);
- }
-#endif
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
diff --git a/boards/arm/stm32l5/nucleo-l552ze/src/nucleo-l552ze.h b/boards/arm/stm32l5/nucleo-l552ze/src/nucleo-l552ze.h
index ac322b4f505..3114ad96e44 100644
--- a/boards/arm/stm32l5/nucleo-l552ze/src/nucleo-l552ze.h
+++ b/boards/arm/stm32l5/nucleo-l552ze/src/nucleo-l552ze.h
@@ -39,18 +39,8 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c b/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c
index 40333ead5e4..b9066cc586b 100644
--- a/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c
+++ b/boards/arm/stm32l5/nucleo-l552ze/src/stm32_bringup.c
@@ -26,7 +26,6 @@
#include <nuttx/config.h>
-#include <sys/mount.h>
#include <sys/types.h>
#include <nuttx/debug.h>
@@ -72,16 +71,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
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 3058defac4b..f5166e166d8 100644
--- a/boards/arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c
+++ b/boards/arm/stm32u3/nucleo-u3c5zi-q/src/stm32_bringup.c
@@ -26,10 +26,9 @@
#include <nuttx/config.h>
+#include <sys/types.h>
#include <syslog.h>
-#include <sys/mount.h>
-
#include <nuttx/board.h>
#include "board_common.h"
@@ -51,13 +50,5 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- return ret;
- }
-#endif
-
return OK;
}
diff --git a/boards/arm/stm32u5/nucleo-u5a5zj-q/src/nucleo-u5a5zj-q.h b/boards/arm/stm32u5/nucleo-u5a5zj-q/src/nucleo-u5a5zj-q.h
index 2fa799df2c3..45538ae3cf1 100644
--- a/boards/arm/stm32u5/nucleo-u5a5zj-q/src/nucleo-u5a5zj-q.h
+++ b/boards/arm/stm32u5/nucleo-u5a5zj-q/src/nucleo-u5a5zj-q.h
@@ -39,18 +39,8 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
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 038a58b5460..6cb3990df16 100644
--- a/boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c
+++ b/boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c
@@ -26,7 +26,6 @@
#include <nuttx/config.h>
-#include <sys/mount.h>
#include <sys/types.h>
#include <nuttx/debug.h>
@@ -102,16 +101,6 @@ int stm32_bringup(void)
ret);
}
-#ifdef CONFIG_FS_PROCFS
- /* Mount the procfs file system */
-
- ret = mount(NULL, "/proc", "procfs", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount procfs at /proc: %d\n", ret);
- }
-#endif
-
#if defined(CONFIG_I2C)
i2c1_m = stm32_i2cbus_initialize(1);
if (i2c1_m == NULL)
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/src/nucleo-wb55rg.h b/boards/arm/stm32wb/nucleo-wb55rg/src/nucleo-wb55rg.h
index 3a3dc06255c..8ce3c9b7e1b 100644
--- a/boards/arm/stm32wb/nucleo-wb55rg/src/nucleo-wb55rg.h
+++ b/boards/arm/stm32wb/nucleo-wb55rg/src/nucleo-wb55rg.h
@@ -39,18 +39,8 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
#define HAVE_RTC_DRIVER 1
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c b/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c
index 5bf0f180286..187732b357a 100644
--- a/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c
+++ b/boards/arm/stm32wb/nucleo-wb55rg/src/stm32_boot.c
@@ -29,7 +29,6 @@
#include <nuttx/debug.h>
#include <sys/types.h>
-#include <sys/mount.h>
#include <stdio.h>
#include <syslog.h>
#include <errno.h>
@@ -123,21 +122,6 @@ void board_late_initialize(void)
ret);
}
-#ifdef HAVE_PROC
- /* Mount the proc filesystem */
-
- syslog(LOG_INFO, "Mounting procfs to /proc\n");
-
- ret = nx_mount(NULL, CONFIG_NSH_PROC_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount the PROC filesystem: %d (%d)\n",
- ret, errno);
- return;
- }
-#endif
-
#ifdef CONFIG_RTC_DRIVER
/* Instantiate the STM32WB lower-half RTC driver */
diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/src/nucleo-wl55jc.h b/boards/arm/stm32wl5/nucleo-wl55jc/src/nucleo-wl55jc.h
index 391e3847af7..15a361c683f 100644
--- a/boards/arm/stm32wl5/nucleo-wl55jc/src/nucleo-wl55jc.h
+++ b/boards/arm/stm32wl5/nucleo-wl55jc/src/nucleo-wl55jc.h
@@ -39,17 +39,6 @@
/* Configuration ************************************************************/
-#define HAVE_PROC 1
-
-#if !defined(CONFIG_FS_PROCFS)
-# undef HAVE_PROC
-#endif
-
-#if defined(HAVE_PROC) && defined(CONFIG_DISABLE_MOUNTPOINT)
-# warning Mountpoints disabled. No procfs support
-# undef HAVE_PROC
-#endif
-
#if defined(CONFIG_LCD_SSD1680)
/* There is no E-ink display on a board.
diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c b/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c
index d76dadb4caa..84075f8f711 100644
--- a/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c
+++ b/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_boot.c
@@ -134,20 +134,6 @@ void board_late_initialize(void)
}
#endif
-#ifdef HAVE_PROC
- /* Mount the proc filesystem */
-
- syslog(LOG_INFO, "Mounting procfs to /proc\n");
-
- ret = nx_mount(NULL, CONFIG_NSH_PROC_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: Failed to mount the PROC filesystem: %d\n",
- ret);
- return;
- }
-#endif
-
#if defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
(nuttx) 02/09: boards/arm/common/stm32: support FDCAN in the common CAN setup
Posted by xi...@apache.org.
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 749a1cc23653cf09983d82094c58bb268aa0262d
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Oct 12 09:50:44 2026 +0200
boards/arm/common/stm32: support FDCAN in the common CAN setup
stm32_can_setup() and stm32_cansock_setup() now also work with FDCAN, so
boards with bxCAN and FDCAN use the same API. Every enabled CAN or FDCAN
instance is registered in order as /dev/can0, /dev/can1, ..., as before
for bxCAN, and CAN3/FDCAN3 are supported too.
A board can define BOARD_CAN_GPIO_STBY in board.h to enable the CAN
transceiver before the interfaces are initialized.
The STM32H7 FDCAN driver has its own SocketCAN interface, so H7 boards
keep their own FDCAN setup.
Signed-off-by: raiden00pl <ra...@railab.me>
Assisted-by: Claude Code
---
boards/arm/common/stm32/include/stm32_can_setup.h | 4 +-
.../arm/common/stm32/include/stm32_cansock_setup.h | 3 +-
boards/arm/common/stm32/src/CMakeLists.txt | 6 +-
boards/arm/common/stm32/src/Make.defs | 6 +-
boards/arm/common/stm32/src/stm32_can_setup.c | 101 +++++++++++++--------
boards/arm/common/stm32/src/stm32_cansock_setup.c | 78 +++++++++++-----
6 files changed, 126 insertions(+), 72 deletions(-)
diff --git a/boards/arm/common/stm32/include/stm32_can_setup.h b/boards/arm/common/stm32/include/stm32_can_setup.h
index 9cd211d05b9..6924313f876 100644
--- a/boards/arm/common/stm32/include/stm32_can_setup.h
+++ b/boards/arm/common/stm32/include/stm32_can_setup.h
@@ -61,7 +61,9 @@ extern "C"
* Name: stm32_can_setup
****************************************************************************/
-#ifdef CONFIG_STM32_CAN_CHARDRIVER
+#if (defined(CONFIG_STM32_CAN_CHARDRIVER) || \
+ defined(CONFIG_STM32_FDCAN_CHARDRIVER)) && \
+ !defined(CONFIG_STM32_HAVE_FDCAN_H7)
int stm32_can_setup(void);
#endif
diff --git a/boards/arm/common/stm32/include/stm32_cansock_setup.h b/boards/arm/common/stm32/include/stm32_cansock_setup.h
index 77a41b66574..a55216ff378 100644
--- a/boards/arm/common/stm32/include/stm32_cansock_setup.h
+++ b/boards/arm/common/stm32/include/stm32_cansock_setup.h
@@ -61,7 +61,8 @@ extern "C"
* Name: stm32_cansock_setup
****************************************************************************/
-#ifdef CONFIG_STM32_CAN_SOCKET
+#if (defined(CONFIG_STM32_CAN_SOCKET) || defined(CONFIG_STM32_FDCAN_SOCKET)) && \
+ !defined(CONFIG_STM32_HAVE_FDCAN_H7)
int stm32_cansock_setup(void);
#endif
diff --git a/boards/arm/common/stm32/src/CMakeLists.txt b/boards/arm/common/stm32/src/CMakeLists.txt
index 635c011a731..f54a7c0a5b2 100644
--- a/boards/arm/common/stm32/src/CMakeLists.txt
+++ b/boards/arm/common/stm32/src/CMakeLists.txt
@@ -192,11 +192,11 @@ if(CONFIG_AUDIO_CS4344)
list(APPEND SRCS stm32_cs4344.c)
endif()
-if(CONFIG_STM32_CAN)
- if(CONFIG_STM32_CAN_CHARDRIVER)
+if(NOT CONFIG_STM32_HAVE_FDCAN_H7)
+ if(CONFIG_STM32_CAN_CHARDRIVER OR CONFIG_STM32_FDCAN_CHARDRIVER)
list(APPEND SRCS stm32_can_setup.c)
endif()
- if(CONFIG_STM32_CAN_SOCKET)
+ if(CONFIG_STM32_CAN_SOCKET OR CONFIG_STM32_FDCAN_SOCKET)
list(APPEND SRCS stm32_cansock_setup.c)
endif()
endif()
diff --git a/boards/arm/common/stm32/src/Make.defs b/boards/arm/common/stm32/src/Make.defs
index 9920ba1d515..68505219878 100644
--- a/boards/arm/common/stm32/src/Make.defs
+++ b/boards/arm/common/stm32/src/Make.defs
@@ -206,11 +206,11 @@ ifeq ($(CONFIG_AUDIO_CS4344),y)
CSRCS += stm32_cs4344.c
endif
-ifeq ($(CONFIG_STM32_CAN),y)
- ifeq ($(CONFIG_STM32_CAN_CHARDRIVER),y)
+ifneq ($(CONFIG_STM32_HAVE_FDCAN_H7),y)
+ ifneq ($(CONFIG_STM32_CAN_CHARDRIVER)$(CONFIG_STM32_FDCAN_CHARDRIVER),)
CSRCS += stm32_can_setup.c
endif
- ifeq ($(CONFIG_STM32_CAN_SOCKET),y)
+ ifneq ($(CONFIG_STM32_CAN_SOCKET)$(CONFIG_STM32_FDCAN_SOCKET),)
CSRCS += stm32_cansock_setup.c
endif
endif
diff --git a/boards/arm/common/stm32/src/stm32_can_setup.c b/boards/arm/common/stm32/src/stm32_can_setup.c
index 2b3e3c476ee..446d383c255 100644
--- a/boards/arm/common/stm32/src/stm32_can_setup.c
+++ b/boards/arm/common/stm32/src/stm32_can_setup.c
@@ -26,25 +26,57 @@
#include <nuttx/config.h>
-#include <stdbool.h>
+#include <stdio.h>
#include <errno.h>
-#include <nuttx/debug.h>
+#include <nuttx/debug.h>
#include <nuttx/can/can.h>
-#include "stm32_can.h"
+#include <arch/board/board.h>
-#ifdef CONFIG_CAN
+#ifdef BOARD_CAN_GPIO_STBY
+# include "stm32_gpio.h"
+#endif
+#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
+# include "stm32_fdcan.h"
+#else
+# include "stm32_can.h"
+#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-#ifdef CONFIG_STM32_CAN1
-# define CAN_PORT 1
+#ifdef CONFIG_STM32_FDCAN_CHARDRIVER
+# define CAN_INITIALIZE(port) stm32_fdcaninitialize(port)
#else
-# define CAN_PORT 2
+# define CAN_INITIALIZE(port) stm32_caninitialize(port)
+#endif
+
+#if !defined(CONFIG_STM32_CAN1) && !defined(CONFIG_STM32_CAN2) && \
+ !defined(CONFIG_STM32_CAN3) && !defined(CONFIG_STM32_FDCAN1) && \
+ !defined(CONFIG_STM32_FDCAN2) && !defined(CONFIG_STM32_FDCAN3)
+# error "No CAN is enabled. Please enable at least one CAN device"
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Enabled CAN instances, registered as /dev/can0, /dev/can1, ... */
+
+static const uint8_t g_can_ports[] =
+{
+#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_FDCAN1)
+ 1,
#endif
+#if defined(CONFIG_STM32_CAN2) || defined(CONFIG_STM32_FDCAN2)
+ 2,
+#endif
+#if defined(CONFIG_STM32_CAN3) || defined(CONFIG_STM32_FDCAN3)
+ 3,
+#endif
+};
/****************************************************************************
* Public Functions
@@ -54,50 +86,41 @@
* Name: stm32_can_setup
*
* Description:
- * Initialize CAN and register the CAN device
+ * Initialize CAN and register the CAN devices
*
****************************************************************************/
int stm32_can_setup(void)
{
struct can_dev_s *can;
+ char devpath[16];
int ret;
+ int i;
- /* Register the first enabled CAN interface at "/dev/can0" */
-
- can = stm32_caninitialize(CAN_PORT);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
-
- ret = can_register("/dev/can0", can);
- if (ret < 0)
- {
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
- }
-
-#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2)
- /* Both CAN1 and CAN2 are enabled: register CAN2 at "/dev/can1" */
+#ifdef BOARD_CAN_GPIO_STBY
+ /* Enable the CAN transceiver */
- can = stm32_caninitialize(2);
- if (can == NULL)
- {
- canerr("ERROR: Failed to get CAN interface\n");
- return -ENODEV;
- }
+ stm32_configgpio(BOARD_CAN_GPIO_STBY);
+ stm32_gpiowrite(BOARD_CAN_GPIO_STBY, false);
+#endif
- ret = can_register("/dev/can1", can);
- if (ret < 0)
+ for (i = 0; i < sizeof(g_can_ports); i++)
{
- canerr("ERROR: can_register failed: %d\n", ret);
- return ret;
+ can = CAN_INITIALIZE(g_can_ports[i]);
+ if (can == NULL)
+ {
+ canerr("ERROR: Failed to get CAN%d interface\n", g_can_ports[i]);
+ return -ENODEV;
+ }
+
+ snprintf(devpath, sizeof(devpath), "/dev/can%d", i);
+ ret = can_register(devpath, can);
+ if (ret < 0)
+ {
+ canerr("ERROR: can_register %s failed: %d\n", devpath, ret);
+ return ret;
+ }
}
-#endif
return OK;
}
-
-#endif /* CONFIG_CAN */
diff --git a/boards/arm/common/stm32/src/stm32_cansock_setup.c b/boards/arm/common/stm32/src/stm32_cansock_setup.c
index aad7a7df26d..0c3dbeb659b 100644
--- a/boards/arm/common/stm32/src/stm32_cansock_setup.c
+++ b/boards/arm/common/stm32/src/stm32_cansock_setup.c
@@ -28,17 +28,51 @@
#include <nuttx/debug.h>
-#include "stm32_can.h"
+#include <arch/board/board.h>
+
+#ifdef BOARD_CAN_GPIO_STBY
+# include "stm32_gpio.h"
+#endif
+#ifdef CONFIG_STM32_FDCAN_SOCKET
+# include "stm32_fdcan.h"
+#else
+# include "stm32_can.h"
+#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-/* Configuration ************************************************************/
+#ifdef CONFIG_STM32_FDCAN_SOCKET
+# define CANSOCK_INITIALIZE(port) stm32_fdcansockinitialize(port)
+#else
+# define CANSOCK_INITIALIZE(port) stm32_cansockinitialize(port)
+#endif
+
+#if !defined(CONFIG_STM32_CAN1) && !defined(CONFIG_STM32_CAN2) && \
+ !defined(CONFIG_STM32_CAN3) && !defined(CONFIG_STM32_FDCAN1) && \
+ !defined(CONFIG_STM32_FDCAN2) && !defined(CONFIG_STM32_FDCAN3)
+# error "No CAN is enabled. Please enable at least one CAN device"
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Enabled CAN instances */
-#if !defined(CONFIG_STM32_CAN1) && !defined(CONFIG_STM32_CAN2)
-# error "No CAN is enable. Please enable at least one CAN device"
+static const uint8_t g_can_ports[] =
+{
+#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_FDCAN1)
+ 1,
+#endif
+#if defined(CONFIG_STM32_CAN2) || defined(CONFIG_STM32_FDCAN2)
+ 2,
#endif
+#if defined(CONFIG_STM32_CAN3) || defined(CONFIG_STM32_FDCAN3)
+ 3,
+#endif
+};
/****************************************************************************
* Public Functions
@@ -54,32 +88,26 @@
int stm32_cansock_setup(void)
{
- int ret = OK;
-
- UNUSED(ret);
+ int ret;
+ int i;
-#ifdef CONFIG_STM32_CAN1
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
+#ifdef BOARD_CAN_GPIO_STBY
+ /* Enable the CAN transceiver */
- ret = stm32_cansockinitialize(1);
- if (ret < 0)
- {
- canerr("ERROR: Failed to get CAN interface %d\n", ret);
- goto errout;
- }
+ stm32_configgpio(BOARD_CAN_GPIO_STBY);
+ stm32_gpiowrite(BOARD_CAN_GPIO_STBY, false);
#endif
-#ifdef CONFIG_STM32_CAN2
- /* Call stm32_caninitialize() to get an instance of the CAN interface */
-
- ret = stm32_cansockinitialize(2);
- if (ret < 0)
+ for (i = 0; i < sizeof(g_can_ports); i++)
{
- canerr("ERROR: Failed to get CAN interface %d\n", ret);
- goto errout;
+ ret = CANSOCK_INITIALIZE(g_can_ports[i]);
+ if (ret < 0)
+ {
+ canerr("ERROR: Failed to get CAN%d interface %d\n",
+ g_can_ports[i], ret);
+ return ret;
+ }
}
-#endif
-errout:
- return ret;
+ return OK;
}