Showing results for 
Search instead for 
Did you mean: 

How can I build an image using yocto? I can't find any guides to build it to the stm32mp1


I want to build image with appliance of build development and network features? I cant understand the process. Where can I find a manual for yocto and stm?

Principal III
Associate III


here you can find aplenty of tutorials and excellent books.


Marco Cavallini

Yocto Project ambassador

Associate II

Above are all good answers.

In a short summary, from a command shell, you --

  1. Install the 'repo' tool, which is a python tool for managing clusters of sub repositories as a single group.
  2. Run 'repo init ....' command to clone the openSTM32 yocto repository using the commands specified in the Distribution Package link above. Note that there are a couple of other repositories out on the net that work equally well for building custom distributions for the stm32mp1, e.g. the koan repository ( The koan link also has very easy-to-follow steps for getting a repo-repository up and running.
  3. Move into the repository folder and run "repo sync" to pull everything you need locally.
  4. You then need to locate the environment setup script. In some repos it is in the base folder. In others it may be several folders deep. Some name it "", others name it "setup-environment". DO NOT 'RUN' THIS SCRIPT.
  5. Once you locate the script, from the base folder for the repo you must SOURCE the file. If you run the file the environment config is lost when the script terminates. By sourcing the file you run a bunch of commands to configure environment variables, create a build directory, and generate some required build files. In the koan link above the command example is 'MACHINE=stm32mp1-disco DISTRO=openstlinux-eglfs source setup-environment build'
  6. This designates environment settings for machine type and the target distribution, and creates the folder 'build' in the base repository folder. There are a limited set of allowed settings for MACHINE and DISTRO. Examining the setup script you can find the allowable values. The koan link already lists them for you. Note that you can designate any name you want for 'build' as long as it is a legal folder name. You can also leave it off in which case the script creates 'build-distroname' (typically).
  7. The command will also move your working folder to the build folder. Don't be surprised when you find you are not where you started.... 🙂
  8. Now comes the time-consuming part....
  9. Run 'bitbake <desired build target>'. Typically the tool will list the implemented targets if you run it with no target.
  10. ...wait....wait even more.....
  11. ...did I say wait????
  12. I build on a Threadripper 32-core behemoth with 128G RAM and 6TB in M.2 storage mapped as RAID striped for maximum speed. And it takes well over an hour to complete the first build. Subsequent builds are much faster.
  13. When the build is done, you must then create the microSD flash image for booting.

Yes, it is a painful process, especially the first time, but if you peruse the (massive) info on yocto, you see that you can customize what goes into the image. For instance, it is a royal PAIN that chose NOT to include developer tools in their default image. And also a pain that nearly all of the shell commands use the 'busybox' utility and are crippled. And finally, the 'apt' command is not useful, because you must configure the repositories before it will do anything --( is your stm32mp1 friend) -- but once you get apt working, any attempt to "just update" or "just install" tools results in apt overwriting most of the critical system libraries with ones that don't work with the rest of the system.

By carefully modifying the stm32mp1 configuration I was able to include real command-line tools and a full development system.

As always, YMMV and "try at your own risk".... 🙂