# SPL not booting into main u-boot when loading using NXPs UUU tool and mender-uboot is enabled

**URL:** https://hub.mender.io/t/spl-not-booting-into-main-u-boot-when-loading-using-nxps-uuu-tool-and-mender-uboot-is-enabled/4042
**Category:** General Discussions
**Tags:** yocto, u-boot, variscite, uuu, imx8mp
**Created:** [August 29, 2021, 2:37am UTC](https://hub.mender.io/t/spl-not-booting-into-main-u-boot-when-loading-using-nxps-uuu-tool-and-mender-uboot-is-enabled/4042 "2021-08-29T02:37:46Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Ossian](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@Ossian](https://hub.mender.io/u/Ossian)
#### Post date: [September 8, 2021, 1:44am UTC](https://hub.mender.io/t/spl-not-booting-into-main-u-boot-when-loading-using-nxps-uuu-tool-and-mender-uboot-is-enabled/4042/6 "2021-09-08T01:44:30Z")

</div>

I’m just providing a solution for those that encounter a similar issue and are looking for a good solution. I found that the best thing to do to solve the the issue mentioned in this post was to patch the Mender recipes to accept CONFIG\_ENV\_IS\_NOWHERE as a valid configuration along with CONFIG\_ENV\_IS\_MMC. The final solution is very easy to fix, by patching/updating two files. The affected files are: recipes-bsp/u-boot/patches/0002-Generic-boot-code-for-Mender.patch and recipes-bsp/u-boot/files/uboot\_auto\_configure.sh

Make the following modification in recipes-bsp/u-boot/patches/0002-Generic-boot-code-for-Mender.patch:

```auto
+#ifndef MENDER_AUTO_PROBING
+
+#include <config_mender_defines.h>
+/* Ossian: CONFIG_ENV_IS_NOWHERE is needed to boot using the UUU tool was: #ifdef CONFIG_ENV_IS_NOWHERE */
+#if !defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_IS_IN_UBI)
+# error A CONFIG_ENV_IS_IN_<storage-type> define is required for Mender to work. For standard Mender setups this should be CONFIG_ENV_IS_IN_MMC for HD/SSD/MMC/SD storage setup, and CONFIG_ENV_IS_IN_UBI for Flash/UBI storage.
+#endif
+
+#ifndef CONFIG_BOOTCOUNT_LIMIT

```

Make the following modification in recipes-bsp/u-boot/files/uboot\_auto\_configure.sh:

```auto
    # Make sure the environment is in MMC.
    replace_definition \
        'CONFIG_ENV_IS_(NOWHERE|IN_[^]*)' \
        'CONFIG_ENV_IS_IN_MMC'
    
    # Ossian: Need to have CONFIG_ENV_IS_NOWHERE defined for the UUU tool. 
    # Mender still works as designed with this config enabled.
    add_definition \
        'CONFIG_ENV_IS_NOWHERE'
        
    add_definition \
        'CONFIG_CMD_EXT4'
    add_definition \
        'CONFIG_CMD_FS_GENERIC'
    add_definition \
        'CONFIG_MMC'
}

```

With these two modifications and MENDER\_UBOOT\_AUTO\_CONFIGURE = “1” enabled u-boot should be setup to work with the UUU tool, and will continue to work as expected for Mender updates.

---

_[View the full topic](https://hub.mender.io/t/spl-not-booting-into-main-u-boot-when-loading-using-nxps-uuu-tool-and-mender-uboot-is-enabled/4042)._
