Developing a custom image with Yocto The Summit SOM 8M Plus (and DVK) support the creation of custom images via the Yocto Project, and the steps below document how to setup a Yocto build environment for the Summit SOM 8M Plus (and DVK) and build an image and also outline some next steps for integrating the SOM into a custom board image. Prerequisites Yocto Project Prerequisites If completely new to the Yocto Project, the documentation site provides a Quick Build getting started guide focused on the Yocto Project reference distribution (Poky) and an emulated device (QEMU, or the Quick EMUlator); however, the steps below are tailored to the Summit SOM 8M Plus (and DVK) and assume that you have successfully setup a development PC for use with the Yocto Project (see the system requirements for more details). Summit SOM 8M Plus (and DVK) Prerequisites In addition to the standard Yocto Project system requirements, the repo tool is needed to support cloning the necessary repositories at the proper revisions via Git, and the steps necessary to install the repo tool are listed in the ‘Install’ section of the homepage. Build the Default Summit SOM 8M Plus DVK Image Create a working directory for the Yocto build environment and change directories to it: mkdir -p <working-dir> cd <working-dir> Pull in the necessary meta data sources using the repo tool optionally replacing <branch> with the target branch and <manifest> with the target manifest file: repo init -u git@github.com:LairdCP/Summit-SOM-Release-Packages.git [-b <branch>] [-m <manifest>] repo sync Setup the Yocto build environment by sourcing the setup-environment script and passing the proper parameters. [MACHINE=<machine>] [DISTRO=<distro>] source setup-environment [-h] <build-dir> Parameter Description <machine> Machine name - there is currently only one supported machine name for the Summit SOM 8M Plus DVK (imx8mp-summitsom) <distro> Distro name - there are currently three supported distro names for the Summit SOM 8M Plus DVK:<ul><li>summitsom-cmd</li><li>summitsom-wayland (default)</li><li>summitsom-xwayland</li></ul> -h Show the script usage help info (optional) <build-dir> Build directory For example, to setup the build environment for the Summit SOM 8M Plus DVK with Wayland support and use a build directory of build, use the following command: MACHINE=imx8mp-summitsom DISTRO=summitsom-wayland source setup-environment build Note: The first time the setup-environment script is run, the NXP Yocto BSP EULA is shown and must be read and accepted before continuing with development. On subsequent runs of the script, you do not need to specify the MACHINE and DISTRO parameters or accept the EULA. The settings can be specified at any time in the <build-dir>/conf/local.conf file. Build the image with bitbake. Presently, there are two supported images that can be built for the Summit SOM 8M Plus (and DVK): Image Name Description image-summitsom-cmd Summit SOM 8M Plus command line image To start the build, use the following command replacing <image-name> with the target image name: bitbake <image-name> For example, to build the Summit SOM 8M Plus command line image, use: bitbake image-summitsom-cmd Wait for the build to complete and find the build artifacts. The build process can take a significant amount of time, and when complete, the build artifacts are available in the following directory: <build-dir>/tmp/deploy/images/<machine-name> Here, you will find a .swu file that can be used to securely update the Summit SOM 8M Plus that uses the following naming pattern: <image-name>-<machine-name>-<date-time>.swu For example, the command line image for the Summit SOM 8M Plus would have a .swu file name like: image-summitsom-cmd-imx8mp-summitsom-20220324205149.swu There are a number of ways to flash the onboard eMMC of the Summit SOM 8M Plus: HTTP/FTP Server Start a HTTP or FTP server on a development machine that is connected to a network which can be accessed by the Summit SOM 8M Plus DVK. Boot the Summit SOM 8M Plus DVK from the SD card and use the fw_update script (built around swupdate) to flash the image to both a/b sides: fw_update -m complete <url> poweroff USB Flash Drive Copy the .swu file onto a USB flash drive. Boot the Summit SOM 8M Plus DVK from SD card and use the fw_update script (built around swupdate) to flash the image to both a/b sides: fw_update -m complete /media/.../update.swu poweroff SD Card Copy the .swu file onto a premade DVK SD card: sudo cp image-summitsom-cmd-imx8mp-summitsom-20220324205149.swu /media/$USER/rootfs_data/upper/home/root/ && sync Boot the Summit SOM 8M Plus DVK from the SD card and use the fw_update script (built around swupdate) to flash the image to both a/b sides: fw_update -m complete /path/to/update.swu poweroff Change the boot mode select DIP switch positions from 0011 to 0010 to switch to internal eMMC and cycle power. The board should now boot from the Summit SOM 8M Plus’ onboard eMMC. Updating the Image While Running From eMMC The standard Summit SOM 8M Plus DVK image utilizes an A/B update scheme when running from onboard eMMC which allows for built-in fallback support in the event of an update failure. To perform an image update, use one of the methods below once you have created a new .swu update file. HTTP/FTP Server Start a HTTP or FTP server on a development machine that is connected to a network which can be accessed by the Summit SOM 8M Plus DVK. Boot the Summit SOM 8M Plus DVK from internal eMMC and use the fw_update script (built around swupdate) to flash the image. The script will automatically determine where flash the new image (i.e., side ‘b’ if running from side ‘a’ or side ‘a’ if running from side ‘b’), toggle the proper environment variable to boot from the new bootside and reboot the board: fw_update <url> USB Flash Drive Copy the .swu file onto a USB flash drive. Boot the Summit SOM 8M Plus DVK from internal eMMC and use the fw_update script (built around swupdate) to flash the image. The script will automatically determine where flash the new image (i.e., side ‘b’ if running from side ‘a’ or side ‘a’ if running from side ‘b’), toggle the proper environment variable to boot from the new bootside and reboot the board: fw_update /media/.../update.swu Next Steps/Customizing the Image See the links below from the Yocto Project documentation site for further information and in depth guides to customize your image and integrate the Summit SOM 8M Plus into your custom design: What I wish I’d known about Yocto Project Transitioning to a custom environment for systems development Yocto Project Software Overview Tips and Tricks Wiki