The following are just a bunch of notes on getting the STM32MP1 development environment running on Arch Linux.

ST’s documentation target Ubuntu and WSL2. I might have run Ubuntu in a full VM, but that is kind of a pain in that I don’t have the entirety of my working environment available.

Another option is containerizing all of this into Docker. The only caveat with that is there are a number of GUI applications and running GUI apps in Docker is also kind of a PITA.

I’ve built a kernel and some simple demos and all the dependencies appear to be present as everything works as expected. I’m sure if I get to the point of generating a full linux distribution that I may run into dependency issues. shrug.

install dependencies for Arch Linux

# gcc-multilib (not sure what the equivalent Arch package is for this Ubuntu package.)
yay -S gawk wget git diffstat unzip texinfo chrpath socat cpio python3 python-pip python-pexpect \
  xz debianutils iputils python-git python-jinja mesa sdl2 sdl12-compat python-pylint \
  xterm bsdmainutils openssl gmp libmpc lz4 zstd ncurses libyaml
echo 'options mmc_block perdev_minors=16' > /tmp/mmc_block.conf
doas mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf

create directories, download and install ST packages

  # install the STMProgrammer app
  # *** download the latest version of STMCubeProgrammer

  # create some directories to keep things organized
  export STMHOME="/home/jlynch/projects/codeposse/stm32"

  mkdir -p $STMHOME/tools/programmer-2.15.0/
  mkdir $STMHOME/tmp
  cd !$

  # install to $STMHOME/tools/programmer-2.15.0/

  # copy the udev rules
  doas cp $STMHOME/tools/programmer-2.15.0/Drivers/rules/*.rules /etc/udev/rules.d

  # grab the OS base images (so called "starter package")
  # *** download the starter package to $STMHOME/tmp
  mkdir -p $STMHOME/ecosystem-5.0.0/starter-package
  tar xf en.FLASH-stm32mp1-openstlinux-5-10-dunfell-mp1-21-11-17_tar.xz -C \

  # Flash an OS onto the sdcard.
  # We just follow the instructions on the wiki for flashing a
  # new image to the sdcard. THIS TAKES HOURS.

  # Check if everything flashed properly and we have a working system.
  cu -s 115200 -l /dev/ttyACM0

  # install the A7 SDK
  # *** download the toolchain, the SDK and the sources. We'll use the sources later.

  tar xf en.SDK-x86_64-stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.tar.gz

  mkdir -p $STMHOME/ecosystem-5.0.0/developer-package/SDK

  # SDK install script
  ./stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sdk/ -d $STMHOME/ecosystem-5.0.0/developer-package/SDK

  # now, mangle my the sdk paths (MUST BE BASH!)
  . $STMHOME/ecosystem-5.0.0/developer-package/SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
  # verify installation
  echo $ARCH
  $CC --version

setup the network via built-in USB OTG ethernet interface

# the following commands should be run on the development machine.
# enp10s0 is the development machine's main NIC.
# emp104s0u3 is the USB OTG ethernet interface provided by the MP1.

ip addr add dev enp104s0u3
ip link set enp104s0u3 up
ip route add via
sysctl -w net.ipv4.ip_forward=1
iptables -A FORWARD -i enp10s0 -j ACCEPT
iptables -A FORWARD -i enp104s0u3 -j ACCEPT
iptables -t nat -A POSTROUTING -o enp10s0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o enp104s0u3 -j MASQUERADE

# the following are to be run on the MP1
route add -net default gw
# (probably some nameserver shit too)

install the linux sources

  # install the source, finally.
  # *** the source should have been downloaded with the SDK

  cd $STMHOME/tmp
  tar xf en.sources-stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.tar.gz -C \
  # extract the kernel sources
  cd !$/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/linux-stm32mp-6.1.28-stm32mp-r1-r0
  tar xf linux-6.1.28.tar.xz

  # apply the ST patches
  cd linux-6.1.28
  for p in `ls -1 ../*.patch`; do patch -p1 < $p; done

  # apply the fragments (this is the ST augmented kernel configuration)
  # (XXX it's be nice to understand exactly what is going on here)
  make ARCH=arm multi_v7_defconfig "fragment*.config"
  for f in `ls -1 ../fragment*.config`; do 
      scripts/kconfig/ -m -r .config $f

build a kernel

  # configure
  yes '' | make ARCH=arm oldconfig
  # build
  make -j32 ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040

  # build modules
  make -j32 ARCH=arm modules

  # install kernel modules to a local directory
  mkdir -p $PWD/install_artifact/
  make ARCH=arm INSTALL_MOD_PATH="$PWD/install_artifact" modules_install

  # copy the kernel, device tree to the board via scp
  scp arch/arm/boot/uImage root@
  scp arch/arm/boot/dts/stm32mp157*.dtb root@

  ## copy the modules to the board
  # remove the links in the artifact directory so we don't recursively copy
  rm install_artifact/lib/modules/5.10.10/build install_artifact/lib/modules/5.10.10/source

  # optionally strip the modules
  find install_artifact/ -name "*.ko" | xargs $STRIP --strip-debug --remove-section=.comment --remove-section=.note --preserve-dates

  # copy modules to the board
  scp -r install_artifact/lib/modules/* root@

  # aaaaaand on the board's console
  /sbin/depmod -a

install the IDE for the sidecar M4

  # install stm32cube ide
  # *** download and extract the installer
  unzip -q

  doas bash ./

  # fin.

finally, enjoy beer



That is a lot of stuff to install!

Anyhow, here’s an obligatory pic of the board. As you can see, “embedded” is a misnomer in this case. Just check the specs of the STM32MP1 line.

plenty of accoutrements.