Skip to content

Commit 1ac44c1

Browse files
committed
boards/arm/stm32h7: switch board common to boards/arm/common/stm32
Wire the STM32H7 family to the shared boards/arm/common/stm32 board-common directory. Drop the local copies that are already provided by the shared directory: - stm32_reset.c from nucleo-h723zg, nucleo-h743zi, nucleo-h743zi2, nucleo-h753zi, stm32h745i-disco and stm32h750b-dk - stm32_romfs_initialize.c and stm32_romfs.h from nucleo-h743zi (identical to the shared versions) Enable CONFIG_ARCH_BOARD_COMMON=y in the configs that use CONFIG_BOARDCTL_RESET or CONFIG_STM32_ROMFS so board_reset()/romfs are pulled from the shared directory. Signed-off-by: raiden00pl <raiden00@railab.me>
1 parent a72efa0 commit 1ac44c1

37 files changed

Lines changed: 119 additions & 671 deletions

File tree

boards/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5206,7 +5206,7 @@ endif
52065206
if ARCH_CHIP_SAMV7
52075207
source "boards/arm/samv7/common/Kconfig"
52085208
endif
5209-
if ARCH_CHIP_STM32C0 || ARCH_CHIP_STM32F0 || ARCH_CHIP_STM32F1 || ARCH_CHIP_STM32F2 || ARCH_CHIP_STM32F3 || ARCH_CHIP_STM32F4 || ARCH_CHIP_STM32F7 || ARCH_CHIP_STM32G0 || ARCH_CHIP_STM32G4 || ARCH_CHIP_STM32L0 || ARCH_CHIP_STM32L1 || ARCH_CHIP_STM32H5
5209+
if ARCH_CHIP_STM32C0 || ARCH_CHIP_STM32F0 || ARCH_CHIP_STM32F1 || ARCH_CHIP_STM32F2 || ARCH_CHIP_STM32F3 || ARCH_CHIP_STM32F4 || ARCH_CHIP_STM32F7 || ARCH_CHIP_STM32G0 || ARCH_CHIP_STM32G4 || ARCH_CHIP_STM32L0 || ARCH_CHIP_STM32L1 || ARCH_CHIP_STM32H5 || ARCH_CHIP_STM32H7
52105210
source "boards/arm/common/stm32/Kconfig"
52115211
endif
52125212
if ARCH_CHIP_RP2040
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ##############################################################################
2+
# boards/arm/stm32h7/common/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
add_subdirectory(${NUTTX_DIR}/boards/arm/common/stm32 stm32_common)

boards/arm/stm32h7/common/Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#############################################################################
2+
# boards/arm/stm32h7/common/Makefile
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
#############################################################################
22+
23+
include $(TOPDIR)/Make.defs
24+
25+
STM32_BOARD_COMMON_DIR := $(TOPDIR)$(DELIM)boards$(DELIM)arm$(DELIM)common$(DELIM)stm32
26+
27+
include board/Make.defs
28+
include $(STM32_BOARD_COMMON_DIR)$(DELIM)src$(DELIM)Make.defs
29+
30+
DEPPATH += --dep-path board
31+
32+
include $(TOPDIR)/boards/Board.mk
33+
34+
ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src
35+
BOARDDIR = $(ARCHSRCDIR)$(DELIM)board
36+
CFLAGS += ${INCDIR_PREFIX}$(BOARDDIR)$(DELIM)include

boards/arm/stm32h7/linum-stm32h753bi/src/Makefile renamed to boards/arm/stm32h7/linum-stm32h753bi/src/Make.defs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
############################################################################
2-
# boards/arm/stm32h7/linum-stm32h753bi/src/Makefile
2+
# boards/arm/stm32h7/linum-stm32h753bi/src/Make.defs
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
@@ -80,4 +80,6 @@ ifeq ($(CONFIG_INPUT_FT5X06),y)
8080
CSRCS += stm32_touchscreen.c
8181
endif
8282

83-
include $(TOPDIR)/boards/Board.mk
83+
DEPPATH += --dep-path board
84+
VPATH += :board
85+
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board

boards/arm/stm32h7/nucleo-h723zg/src/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ if(CONFIG_PWM)
5656
list(APPEND SRCS stm32_pwm.c)
5757
endif()
5858

59-
if(CONFIG_BOARDCTL_RESET)
60-
list(APPEND SRCS stm32_reset.c)
61-
endif()
62-
6359
if(CONFIG_NET_OA_TC6)
6460
list(APPEND SRCS stm32_oa_tc6.c)
6561
endif()

boards/arm/stm32h7/nucleo-h723zg/src/Makefile renamed to boards/arm/stm32h7/nucleo-h723zg/src/Make.defs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
############################################################################
2-
# boards/arm/stm32h7/nucleo-h723zg/src/Makefile
2+
# boards/arm/stm32h7/nucleo-h723zg/src/Make.defs
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
@@ -58,12 +58,10 @@ ifeq ($(CONFIG_PWM),y)
5858
CSRCS += stm32_pwm.c
5959
endif
6060

61-
ifeq ($(CONFIG_BOARDCTL_RESET),y)
62-
CSRCS += stm32_reset.c
63-
endif
64-
6561
ifeq ($(CONFIG_NET_OA_TC6),y)
6662
CSRCS += stm32_oa_tc6.c
6763
endif
6864

69-
include $(TOPDIR)/boards/Board.mk
65+
DEPPATH += --dep-path board
66+
VPATH += :board
67+
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board

boards/arm/stm32h7/nucleo-h723zg/src/stm32_reset.c

Lines changed: 0 additions & 64 deletions
This file was deleted.

boards/arm/stm32h7/nucleo-h743zi/configs/elf/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# CONFIG_STM32_DTCMEXCLUDE is not set
1212
CONFIG_ARCH="arm"
1313
CONFIG_ARCH_BOARD="nucleo-h743zi"
14+
CONFIG_ARCH_BOARD_COMMON=y
1415
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
1516
CONFIG_ARCH_CHIP="stm32h7"
1617
CONFIG_ARCH_CHIP_STM32=y

boards/arm/stm32h7/nucleo-h743zi/configs/mcuboot-app/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# CONFIG_STANDARD_SERIAL is not set
99
CONFIG_ARCH="arm"
1010
CONFIG_ARCH_BOARD="nucleo-h743zi"
11+
CONFIG_ARCH_BOARD_COMMON=y
1112
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
1213
CONFIG_ARCH_CHIP="stm32h7"
1314
CONFIG_ARCH_CHIP_STM32=y

boards/arm/stm32h7/nucleo-h743zi/configs/mcuboot-loader/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
CONFIG_ARCH="arm"
99
CONFIG_ARCH_BOARD="nucleo-h743zi"
10+
CONFIG_ARCH_BOARD_COMMON=y
1011
CONFIG_ARCH_BOARD_NUCLEO_H743ZI=y
1112
CONFIG_ARCH_CHIP="stm32h7"
1213
CONFIG_ARCH_CHIP_STM32=y

0 commit comments

Comments
 (0)