This repository contains the configuration and support files for building a custom Linux system using Buildroot for the STM32MP157-DK1 development board.
Buildroot is a simple, efficient, and powerful tool to generate embedded Linux systems through cross-compilation.
- STM32MP157-DK1, Raspberry Pi,Allwinner Chip (or any development board)
- STMicroelectronics MPU
configs/stm32mp157_defconfig- Custom Buildroot configuration fileboard/stm32mp157/- Post-build scripts and board-specific dataREADME.md- Project documentation
- Linux build host (Ubuntu 20.04+ recommended)
- Git, build-essential, cpio, rsync, unzip, wget, gcc, make
- Python3, libncurses-dev, bc, etc.
- Internet access to download packages
git clone https://github.com/buildroot/buildroot.git
cd buildroot
git checkout 2024.02 # or latest stable release
cp ../stm32mp157-buildroot/configs/stm32mp157_defconfig configs/
make stm32mp157_defconfigmake -jxoutput/images/
βββ zImage # Linux kernel
βββ rootfs.ext4 # Root filesystem
βββ boot.scr # U-Boot boot script
βββ sdcard.img # Full SD card image (optional)Insert your SD card and identify the correct device path (e.g., /dev/sdX). Then flash:
sudo dd if=output/images/sdcard.img of=/dev/sdX bs=1M status=progress
sync1-Insert the SD card.
2-Connect the USB-to-UART or HDMI display.
3-Power on the board.
4-You should see Linux boot messages.
You can customize the root filesystem with a post-build.sh script:
#!/bin/sh
echo "Customizing root filesystem..."
cp /path/to/local/script.sh $TARGET_DIR/usr/local/bin/
chmod +x $TARGET_DIR/usr/local/bin/script.shAdd this script path under System configuration β Custom scripts in make menuconfig.
U-Boot 2024.01 (Apr 29 2025 - 10:00:00 +0000)
CPU: STM32MP157C Rev.B
DRAM: 512 MiB
NAND: 0 MiB
MMC: STM32 SD/MMC: 0
In: serial
Out: serial
Err: serial
Net: No ethernet found.
Hit any key to stop autoboot: 0
Booting Linux...
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 6.6.9 (buildroot@localhost) ...
[ 2.123456] Freeing unused kernel memory...
[ 3.456789] Welcome to Buildroot
stm32mp157 login: root
Welcome to Buildroot
# uname -a
Linux buildroot 6.6.9 #1 SMP Tue Apr 29 10:00:00 UTC 2025 armv7l GNU/Linux
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 32M 15M 17M 47% /
tmpfs 64M 0 64M 0% /tmp
Developed by Sajad Mosayebi
This project is inspired by the open-source STM32 ecosystem and Buildroot community.
Buildroot: https://buildroot.org
STM32MP1 Docs: https://wiki.st.com/stm32mpu