[1/1] configs/stm32h747_disco_sd: new defconfig
Commit Message
Support STM32h747i-disco board. It includes an STM32H747XI SoC with the
following resources:
- 2 Mbytes Flash
- 1 Mbyte SRAM
- LCD-TFT controller
- MIPI-DSI interface
- FD-CAN
- USB 2.0 high-speed/full-speed
- Ethernet MAC
- camera interface
Detailed information can be found at:
https://www.st.com/en/evaluation-tools/stm32h747i-disco.html
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
DEVELOPERS | 2 ++
.../stm32h747-disco/extlinux.conf | 4 +++
.../stm32h747-disco/flash_sd.sh | 18 +++++++++++
.../stm32h747-disco/genimage.cfg | 10 ++++++
.../stm32h747-disco/linux-sd.fragment | 1 +
.../patches/linux-headers/linux-headers.hash | 1 +
.../stm32h747-disco/patches/linux/linux.hash | 2 ++
.../stm32h747-disco/patches/uboot/uboot.hash | 2 ++
.../stm32h747-disco/post-build.sh | 7 ++++
.../stm32h747-disco/readme.txt | 32 +++++++++++++++++++
configs/stm32h747_disco_sd_defconfig | 31 ++++++++++++++++++
11 files changed, 110 insertions(+)
create mode 100644 board/stmicroelectronics/stm32h747-disco/extlinux.conf
create mode 100755 board/stmicroelectronics/stm32h747-disco/flash_sd.sh
create mode 100644 board/stmicroelectronics/stm32h747-disco/genimage.cfg
create mode 100644 board/stmicroelectronics/stm32h747-disco/linux-sd.fragment
create mode 120000 board/stmicroelectronics/stm32h747-disco/patches/linux-headers/linux-headers.hash
create mode 100644 board/stmicroelectronics/stm32h747-disco/patches/linux/linux.hash
create mode 100644 board/stmicroelectronics/stm32h747-disco/patches/uboot/uboot.hash
create mode 100755 board/stmicroelectronics/stm32h747-disco/post-build.sh
create mode 100644 board/stmicroelectronics/stm32h747-disco/readme.txt
create mode 100644 configs/stm32h747_disco_sd_defconfig
Comments
Hi Dario,
Thanks for the patch! I have few comments, see below.
On 18/01/2026 16:55, Dario Binacchi wrote:
> Support STM32h747i-disco board. It includes an STM32H747XI SoC with the
> following resources:
>
> - 2 Mbytes Flash
> - 1 Mbyte SRAM
> - LCD-TFT controller
> - MIPI-DSI interface
> - FD-CAN
> - USB 2.0 high-speed/full-speed
> - Ethernet MAC
> - camera interface
>
> Detailed information can be found at:
> https://www.st.com/en/evaluation-tools/stm32h747i-disco.html
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
[...]
> diff --git a/board/stmicroelectronics/stm32h747-disco/flash_sd.sh
> b/board/stmicroelectronics/stm32h747-disco/flash_sd.sh
> new file mode 100755
> index 000000000000..db51fa7b6689
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32h747-disco/flash_sd.sh
> @@ -0,0 +1,18 @@
> +#!/bin/bash
This script does not really needs Bash, so it could be changed
to /bin/sh.
> +
> +OUTPUT_DIR=$1
> +
> +if ! test -d "${OUTPUT_DIR}" ; then
> + echo "ERROR: no output directory specified."
> + echo "Usage: $0 OUTPUT_DIR"
> + exit 1
> +fi
> +
> +"${OUTPUT_DIR}"/host/bin/openocd -f board/stm32h747i-disco.cfg \
> + -c "init" \
> + -c "reset init" \
> + -c "flash probe 0" \
> + -c "flash info 0" \
> + -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin
> 0x08000000" \
> + -c "reset run" \
> + -c "shutdown"
[...]
> diff --git
> a/board/stmicroelectronics/stm32h747-disco/patches/linux-headers/linux-headers.hash
> b/board/stmicroelectronics/stm32h747-disco/patches/linux-headers/linux-headers.hash
> new file mode 120000
> index 000000000000..5808d92afe89
> --- /dev/null
> +++
> b/board/stmicroelectronics/stm32h747-disco/patches/linux-headers/linux-headers.hash
If we switch this defconfig to use an external toolchain (see my comment
below in the defconfig), the linux-header.hash is no longer needed and
should be removed.
> @@ -0,0 +1 @@
> +../linux/linux.hash
> \ No newline at end of file
[...]
> diff --git a/board/stmicroelectronics/stm32h747-disco/post-build.sh
> b/board/stmicroelectronics/stm32h747-disco/post-build.sh
> new file mode 100755
> index 000000000000..45100509411b
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32h747-disco/post-build.sh
> @@ -0,0 +1,7 @@
> +#!/bin/sh
Could you add "set -eu" here?
This will make sure errors will be reported to "make" process.
> +BOARD_DIR="$(dirname "$0")"
> +
> +# Kernel is built without devpts support
> +sed -i '/^devpts/d' "${TARGET_DIR}"/etc/fstab
> +
> +install -m 0644 -D "${BOARD_DIR}"/extlinux.conf
> "${TARGET_DIR}"/boot/extlinux/extlinux.conf
> diff --git a/board/stmicroelectronics/stm32h747-disco/readme.txt
> b/board/stmicroelectronics/stm32h747-disco/readme.txt
> new file mode 100644
> index 000000000000..7125d4d12604
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32h747-disco/readme.txt
> @@ -0,0 +1,32 @@
> +STM32H747 Discovery
> +===================
> +
> +This tutorial describes how to use the predefined Buildroot
> +configuration for the STM32H747 Discovery evaluation platform.
> +
> +Building
> +--------
> +
> + make stm32h747_disco_sd_defconfig
> + make
> +
> +Flashing
> +--------
> +
> + ./board/stmicroelectronics/stm32h747-disco/flash_sd.sh output/
> +
> +It will flash the U-Boot bootloader.
> +
> +Creating SD card
> +----------------
> +
> +Buildroot prepares an"sdcard.img" image in the output/images/
> directory,
^
There is a is missing space here.
> +ready to be dumped on a SD card. Launch the following command as root:
> +
> + dd if=output/images/sdcard.img of=/dev/<your-sd-device>
> +
> +*** WARNING! This will destroy all the card content. Use with care!
> ***
> +
> +For details about the medium image layout and its content, see the
> +definition in board/stmicroelectronics/stm32h747-disco/genimage.cfg.
> +
> diff --git a/configs/stm32h747_disco_sd_defconfig
> b/configs/stm32h747_disco_sd_defconfig
> new file mode 100644
> index 000000000000..8c3db61d108e
> --- /dev/null
> +++ b/configs/stm32h747_disco_sd_defconfig
> @@ -0,0 +1,31 @@
> +BR2_arm=y
> +BR2_cortex_m7=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_18=y
We are trying to move all defconfigs to use Bootlin external
stable toolchains. See:
https://elinux.org/Buildroot:DeveloperDaysELCE2024#Rules_for_defconfigs
Could you remove the previous line, and add instead:
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7M_UCLIBC_STABLE=y
> +BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32h747-disco/patches"
> +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32h747-disco/post-build.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c
> board/stmicroelectronics/stm32h747-disco/genimage.cfg"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
> +BR2_LINUX_KERNEL_DEFCONFIG="stm32"
> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm/configs/dram_0xd0000000.config
> board/stmicroelectronics/stm32h747-disco/linux-sd.fragment"
> +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
> +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="st/stm32h747i-disco"
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> +BR2_PACKAGE_EVTEST=y
> +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
> +# BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2026.01"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32h747-disco"
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_OPENOCD=y
> --
> 2.43.0
Can you send an updated patch addressing those comments, please?
Best regards,
Julien.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
@@ -800,12 +800,14 @@ N: Dario Binacchi <dario.binacchi@amarulasolutions.com>
F: board/bsh/
F: board/stmicroelectronics/stm32f746-disco/
F: board/stmicroelectronics/stm32f769-disco/
+F: board/stmicroelectronics/stm32h747-disco/
F: boot/ti-k3-boot-firmware/
F: configs/imx6ulz_bsh_smm_m2_defconfig
F: configs/imx8mn_bsh_smm_s2_defconfig
F: configs/imx8mn_bsh_smm_s2_pro_defconfig
F: configs/stm32f746_disco_sd_defconfig
F: configs/stm32f769_disco_sd_defconfig
+F: configs/stm32h747_disco_sd_defconfig
F: package/aespipe/
F: package/armadillo/
F: package/atf/
new file mode 100644
@@ -0,0 +1,4 @@
+label stm32h747i-disco-buildroot
+ kernel /boot/zImage
+ devicetree /boot/stm32h747i-disco.dtb
+ append console=ttySTM0,115200 root=/dev/mmcblk0p1 rw rootfstype=ext2 rootwait earlyprintk consoleblank=0 ignore_loglevel
new file mode 100755
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+OUTPUT_DIR=$1
+
+if ! test -d "${OUTPUT_DIR}" ; then
+ echo "ERROR: no output directory specified."
+ echo "Usage: $0 OUTPUT_DIR"
+ exit 1
+fi
+
+"${OUTPUT_DIR}"/host/bin/openocd -f board/stm32h747i-disco.cfg \
+ -c "init" \
+ -c "reset init" \
+ -c "flash probe 0" \
+ -c "flash info 0" \
+ -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin 0x08000000" \
+ -c "reset run" \
+ -c "shutdown"
new file mode 100644
@@ -0,0 +1,10 @@
+image sdcard.img {
+ hdimage {
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext2"
+ size = 32M
+ }
+}
new file mode 100644
@@ -0,0 +1 @@
+# CONFIG_XIP_KERNEL is not set
new file mode 120000
@@ -0,0 +1 @@
+../linux/linux.hash
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 189d1f409cef8d0d234210e04595172df392f8cb297e14b447ed95720e2fd940 linux-6.18.5.tar.xz
new file mode 100644
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 b60d5865cefdbc75da8da4156c56c458e00de75a49b80c1a2e58a96e30ad0d54 u-boot-2026.01.tar.bz2
new file mode 100755
@@ -0,0 +1,7 @@
+#!/bin/sh
+BOARD_DIR="$(dirname "$0")"
+
+# Kernel is built without devpts support
+sed -i '/^devpts/d' "${TARGET_DIR}"/etc/fstab
+
+install -m 0644 -D "${BOARD_DIR}"/extlinux.conf "${TARGET_DIR}"/boot/extlinux/extlinux.conf
new file mode 100644
@@ -0,0 +1,32 @@
+STM32H747 Discovery
+===================
+
+This tutorial describes how to use the predefined Buildroot
+configuration for the STM32H747 Discovery evaluation platform.
+
+Building
+--------
+
+ make stm32h747_disco_sd_defconfig
+ make
+
+Flashing
+--------
+
+ ./board/stmicroelectronics/stm32h747-disco/flash_sd.sh output/
+
+It will flash the U-Boot bootloader.
+
+Creating SD card
+----------------
+
+Buildroot prepares an"sdcard.img" image in the output/images/ directory,
+ready to be dumped on a SD card. Launch the following command as root:
+
+ dd if=output/images/sdcard.img of=/dev/<your-sd-device>
+
+*** WARNING! This will destroy all the card content. Use with care! ***
+
+For details about the medium image layout and its content, see the
+definition in board/stmicroelectronics/stm32h747-disco/genimage.cfg.
+
new file mode 100644
@@ -0,0 +1,31 @@
+BR2_arm=y
+BR2_cortex_m7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_18=y
+BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32h747-disco/patches"
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32h747-disco/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32h747-disco/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
+BR2_LINUX_KERNEL_DEFCONFIG="stm32"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm/configs/dram_0xd0000000.config board/stmicroelectronics/stm32h747-disco/linux-sd.fragment"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="st/stm32h747i-disco"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_PACKAGE_EVTEST=y
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2026.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32h747-disco"
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_OPENOCD=y