# I.MX8M SoM Yocto U-Boot fw\_printenv fw\_setenv

**URL:** <https://community.solid-run.com/t/i-mx8m-som-yocto-u-boot-fw-printenv-fw-setenv/686>\
**Category:** NXP i.MX8M Plus\
**Tags:** iMX8M-plus\
**Created:** [July 21, 2023, 3:59pm UTC](https://community.solid-run.com/t/i-mx8m-som-yocto-u-boot-fw-printenv-fw-setenv/686 "2023-07-21T15:59:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philbot999](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@philbot999](https://community.solid-run.com/u/philbot999)\
**Post date:** [July 21, 2023, 3:59pm UTC](https://community.solid-run.com/t/i-mx8m-som-yocto-u-boot-fw-printenv-fw-setenv/686/1 "2023-07-21T15:59:33Z")

</div>

I am using the Yocto ( Kirkstone ) meta-solidrun-arm-imx8 layer to successfully build for the I.MX8M Plus SoM.

I need to access and set the U-Boot environment from Linux user space and so I need the fw\_printenv and fw\_setenv binaries.

For other boards, I am able to do that with the following recipe. However, when I try here I get the following error:

| \*\*\* Can’t find default configuration “arch/…/configs/imx8mp\_solidrun\_defconfig”!

How can I get fw\_printenv and fw\_setenv with meta-solidrun-arm-imx8? Thanks.

require u-boot-sensonix-common.inc

```auto
SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
DEPENDS = "mtd-utils bison-native"

EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'

inherit uboot-config

do_compile () {
    oe_runmake ${UBOOT_MACHINE}
    oe_runmake envtools
}

do_install () {
    install -d ${D}${base_sbindir}
    install -d ${D}${sysconfdir}
    install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
    install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv

    #install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
	echo -e "/boot/uboot.env 0x0000 0x4000" > ${D}${sysconfdir}/fw_env.config
}

do_install_class-cross () {
    install -d ${D}${bindir_cross}
    install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
    install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
}

SYSROOT_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
uboot_fw_utils_cross() {
    sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
}

PROVIDES += "u-boot-fw-utils"
RPROVIDES_${PN} += "u-boot-fw-utils"

PACKAGE_ARCH = "${MACHINE_ARCH}"
BBCLASSEXTEND = "cross"

```

```auto
inherit fsl-u-boot-localversion

LICENSE = "GPLv2+"

LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"

UBOOT_SRC ?= "git://source.codeaurora.org/external/imx/uboot-imx.git;protocol=https"

SRCBRANCH = "lf_v2021.04"

SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH} \

"

SRCREV = "1c0116f3da250c5a52858c53efb8b38c0963f477"

S = "${WORKDIR}/git"

PV_append = "+imx"

LOCALVERSION = "+imx"

```

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [July 22, 2023, 5:02am UTC](https://community.solid-run.com/t/i-mx8m-som-yocto-u-boot-fw-printenv-fw-setenv/686/2 "2023-07-22T05:02:42Z")

</div>

Those utilities are provided by the libubootenv recipe now. There is no defconfig because we use the default imx8mp kernel config and then append it from an additional config from our meta-layer.

---

<div class="post-metadata">

**Author:** ![philbot999](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@philbot999](https://community.solid-run.com/u/philbot999)\
**Post date:** [July 24, 2023, 1:02pm UTC](https://community.solid-run.com/t/i-mx8m-som-yocto-u-boot-fw-printenv-fw-setenv/686/3 "2023-07-24T13:02:49Z")

</div>

Thank you - that worked.
