<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: saveenv is not working from uuu script</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699065#M210270</link>
    <description>&lt;P&gt;Yes I was succeeded. The secret was to init and reload the environment after setting the location.&lt;/P&gt;&lt;P&gt;This example works for me (uboot v2021.04)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;typedef enum ESource{
    SOURCE_AUTO = 0,
    SOURCE_SD_CARD,
    SOURCE_MMC,
}ESource;

static ESource env_location = SOURCE_AUTO;

void env_set_inited(enum env_location location)
{
    /*
     * We're using a 32-bits bitmask stored in gd (env_has_init)
     * using the above enum value as the bit index. We need to
     * make sure that we're not overflowing it.
     */
    //BUILD_BUG_ON(ARRAY_SIZE(env_locations) &amp;gt; BITS_PER_LONG);
    debug("%s: init environment on loc %d before: 0x%lx\n", __func__, location, gd-&amp;gt;env_has_init &amp;amp; BIT(location));
    gd-&amp;gt;env_has_init |= BIT(location);
    debug("%s: init environment after: 0x%lx\n", __func__, gd-&amp;gt;env_has_init &amp;amp; BIT(location));
}


int do_set_env_location(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
    env_location = SOURCE_MMC;
    env_set_inited(ENVL_MMC);
    env_load();
    debug("%s: set environment location to SD card\n", __func__);
    return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;After that you have access to the&amp;nbsp;&lt;SPAN&gt;environment variables. You can set and save them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 04:18:57 GMT</pubDate>
    <dc:creator>MicMoba</dc:creator>
    <dc:date>2023-08-04T04:18:57Z</dc:date>
    <item>
      <title>saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1197531#M166274</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;saveenv is not working from uuu script. Is there any configuration missing. I able to do from uboot console but not from script.&lt;/P&gt;&lt;PRE&gt;FB: ucmd saveenv&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 17:10:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1197531#M166274</guid>
      <dc:creator>vinothkumars</dc:creator>
      <dc:date>2020-12-10T17:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1198264#M166359</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/65315"&gt;@vinothkumars&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Yes sir you are missing rest of the command line requirements.&amp;nbsp; See below and let me know if this helps:&lt;/P&gt;&lt;P&gt;To Talk with fastboot, boot linux kernel:&lt;/P&gt;&lt;P&gt;uuu FB: ucmd setenv fastboot_buffer ${loadaddr}&lt;BR /&gt;uuu FB: download -f Image&lt;BR /&gt;uuu FB: ucmd setenv fastboot_buffer ${fdt_addr}&lt;BR /&gt;uuu FB: download -f imx8qxp_mek.dtb&lt;BR /&gt;uuu FB: acmd booti ${loadaddr} - ${fdt_addr}&lt;/P&gt;&lt;P&gt;Good Luck!&lt;/P&gt;&lt;P&gt;DeWayne&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 21:49:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1198264#M166359</guid>
      <dc:creator>dewayne_gibson</dc:creator>
      <dc:date>2020-12-11T21:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1199831#M166526</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/133794"&gt;@dewayne_gibson&lt;/a&gt; for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will you please share the full script. I am unable to save from uuu script.&lt;/P&gt;&lt;P&gt;1:13&amp;gt;Start Cmd:FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0&lt;BR /&gt;1:13&amp;gt;Okay&lt;BR /&gt;1:13&amp;gt;Start Cmd:FB: ucmd printenv&lt;BR /&gt;1:13&amp;gt;Okay&lt;BR /&gt;1:13&amp;gt;Start Cmd:FB: ucmd saveenv&lt;BR /&gt;&lt;STRONG&gt;1:13&amp;gt;Fail&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 18:56:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1199831#M166526</guid>
      <dc:creator>vinothkumars</dc:creator>
      <dc:date>2020-12-15T18:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1201395#M166678</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Does uboot output something?&lt;BR /&gt;Also, please share the script you're using&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 20:28:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1201395#M166678</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2020-12-17T20:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1201965#M166745</link>
      <description>&lt;P&gt;Hello&amp;nbsp;@ Vinothkumar:&lt;/P&gt;&lt;P&gt;I provided you the UUU user guide in the earlier post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need only change the one line below to call the proper uuu FB: download -f imx8&lt;STRONG&gt;---&lt;/STRONG&gt;_mek.dtb:&lt;/P&gt;&lt;P&gt;To talk with fastboot:&lt;/P&gt;&lt;P&gt;First Step: boot linux kernel using these commands&lt;BR /&gt;uuu FB: ucmd setenv fastboot_buffer ${loadaddr}&lt;BR /&gt;uuu FB: download -f Image&lt;BR /&gt;uuu FB: ucmd setenv fastboot_buffer ${fdt_addr}&lt;BR /&gt;uuu FB: download -f imx8qxp_mek.dtb&lt;BR /&gt;uuu FB: acmd booti ${loadaddr} - ${fdt_addr}&lt;BR /&gt;Extended environment for fastboot&lt;BR /&gt;fastboot_buffer Image download address&lt;BR /&gt;fastboot_bytes reflect previous download image byte size&lt;/P&gt;&lt;P&gt;Last Step: write image to emmc&lt;BR /&gt;uuu FB: flash -raw2sparse all &amp;lt;image file&amp;gt;&lt;/P&gt;&lt;P&gt;You will not be able to save the commands that you script in UUU. UUU is not an editor utility.&amp;nbsp; If you want to save the script commands you are using, create and save to a text file or USE the XML2 method instead of UUU commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards and Good Luck!&lt;/P&gt;&lt;P&gt;DeWayne&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 23:11:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1201965#M166745</guid>
      <dc:creator>dewayne_gibson</dc:creator>
      <dc:date>2020-12-18T23:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336515#M179743</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;is there a solution? I have the same issue. I am able to flash my emmc and I can call all uboot commands but saveenv is not working.&lt;/P&gt;&lt;P&gt;Flash of emmc:&lt;BR /&gt;uuu.exe -v -b emmc_all uboot.bin image.wic&lt;/P&gt;&lt;P&gt;After successful flashing I want to reset and save my environment&lt;/P&gt;&lt;P&gt;uuu.exe FB: ucmd env default -a&lt;BR /&gt;&amp;gt;Okay&lt;/P&gt;&lt;P&gt;uuu.exe FB: ucmd saveenv&lt;BR /&gt;&amp;gt;Error:&lt;/P&gt;&lt;P&gt;Unfortunately uuu tool does not print out any error. The serial console prints also nothing.&lt;/P&gt;&lt;P&gt;In general the serial console prints two errors:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;## Error: Can't overwrite "serial#" &lt;/SPAN&gt;&lt;BR /&gt;## Error inserting "serial#" variable, errno=1&lt;BR /&gt;Detect USB boot. Will enter fastboot mode!&lt;BR /&gt;request 00000000bdf3e1c0 was not queued to ep1in-bulk&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But I don't know if this has something to do with the saveenv issue.&lt;/P&gt;&lt;P&gt;The reason why I want to set my environment to default and save it is because I use a redundant environment and only with a saveenv it will be stored to flash. If it is not stored to flash I wouldn't be able to use fw_printenv and fw_setenv out of rootfs.&lt;/P&gt;&lt;P&gt;Is there another possibility to save the environment initialy?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 06:02:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336515#M179743</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2021-09-08T06:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336744#M179761</link>
      <description>&lt;P&gt;Okay, I think I know why saveenv doesn't work.&lt;/P&gt;&lt;P&gt;This prints the serial console after I load the bootloade into RAM and start in fastboot mode:&lt;BR /&gt;...&lt;BR /&gt;&lt;STRONG&gt;Loading Environment from nowhere... OK&lt;/STRONG&gt;&lt;BR /&gt;In: &amp;nbsp;&amp;nbsp;&amp;nbsp;serial&lt;BR /&gt;Out: &amp;nbsp;&amp;nbsp;serial&lt;BR /&gt;Err: &amp;nbsp;&amp;nbsp;serial&lt;BR /&gt;&lt;BR /&gt;BuildInfo:&lt;BR /&gt;&amp;nbsp;- ATF f1d7187&lt;BR /&gt;&amp;nbsp;- U-Boot 2020.04&lt;BR /&gt;&lt;BR /&gt;Detect USB boot. Will enter fastboot mode!&lt;BR /&gt;Net: &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Warning: ethernet@30bf0000 using MAC address from ROM&lt;BR /&gt;eth1: ethernet@30bf0000 [PRIME]&lt;BR /&gt;Fastboot: Normal&lt;BR /&gt;Boot from USB for mfgtools&lt;BR /&gt;*** Warning - Use default environment for &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mfgtools&lt;BR /&gt;, using default environment&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;Because of the Serial Download Mode the environment is nowhere. And then it makes sense that the saveenv command do nothing &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 08:59:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336744#M179761</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2021-09-08T08:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336765#M179762</link>
      <description>&lt;P&gt;It is very simple reason.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The u-boot has&amp;nbsp;mmcautodetect, it can&amp;nbsp; detect boot from&amp;nbsp; the emmc(for example) and make the u-boot environment save to that device regardless the u-boot environment.&lt;/P&gt;
&lt;P&gt;But boot from usb, uboot will think it is not from emmc or sd or any usdhc interface.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so the mmcdev=1, not match the hardware.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;even you don't issue the command&amp;nbsp;uuu -v FB: ucmd env default -a. you could not saveenv, either.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to manually set the mmc device.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;uuu -v FB: ucmd setenv mmcdev &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;${emmc_dev}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;uuu -v FB: ucmd saveenv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, uuu flash use the&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;emmc_dev&lt;/STRONG&gt; &lt;/FONT&gt;and sd_dev to do flash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 09:29:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336765#M179762</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2021-09-08T09:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336870#M179782</link>
      <description>&lt;P&gt;Hi&lt;SPAN class="UserName lia-user-name lia-user-rank-NXP-Employee lia-component-message-view-widget-author-username"&gt; &lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/25009" target="_self"&gt;&lt;SPAN class=""&gt;BiyongSUN,&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-NXP-Employee lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;thanks for your reply but this doesn't work for me. I set the mmcdev to my emmc_dev but the saveenv command doesn't work either.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 12:46:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1336870#M179782</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2021-09-08T12:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1487308#M192373</link>
      <description>&lt;P&gt;Okay, I have to reopen this case &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I still have the same problem. When I run u-boot over UUU tool I can't access to the environment stored in my emmc.&lt;/P&gt;&lt;P&gt;If the u-boot detects that it is startet over USB and it is using a default environment. How can I get access to the environment.&lt;/P&gt;&lt;P&gt;Following situation:&lt;/P&gt;&lt;P&gt;Start device (i.MX8MP) in serial-download-mode and connect PC over USB&lt;/P&gt;&lt;P&gt;Load image to emmc over UUU-Tool&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;sudo ./uuu -b emmc_all imx-boot image.wic&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The redundant environment is located at:&lt;/P&gt;&lt;P&gt;CONFIG_ENV_SIZE=0x10000&lt;BR /&gt;CONFIG_ENV_OFFSET=0x3C0000&lt;BR /&gt;CONFIG_ENV_OFFSET_REDUND=0x3E0000&lt;/P&gt;&lt;P&gt;Now I want to set an environment variable over FastBoot protocol and save the environment on the emmc.&lt;/P&gt;&lt;P&gt;Afterwards set boot-options to boot from emmc. Now the u-boot should work with the environment variable that I have set before over UUU-Tool and FB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 08:09:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1487308#M192373</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2022-07-11T08:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1698910#M210254</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you succeed to change U-boot parameter with UUU ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;K.regards&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 21:57:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1698910#M210254</guid>
      <dc:creator>gnulux</dc:creator>
      <dc:date>2023-08-03T21:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699065#M210270</link>
      <description>&lt;P&gt;Yes I was succeeded. The secret was to init and reload the environment after setting the location.&lt;/P&gt;&lt;P&gt;This example works for me (uboot v2021.04)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;typedef enum ESource{
    SOURCE_AUTO = 0,
    SOURCE_SD_CARD,
    SOURCE_MMC,
}ESource;

static ESource env_location = SOURCE_AUTO;

void env_set_inited(enum env_location location)
{
    /*
     * We're using a 32-bits bitmask stored in gd (env_has_init)
     * using the above enum value as the bit index. We need to
     * make sure that we're not overflowing it.
     */
    //BUILD_BUG_ON(ARRAY_SIZE(env_locations) &amp;gt; BITS_PER_LONG);
    debug("%s: init environment on loc %d before: 0x%lx\n", __func__, location, gd-&amp;gt;env_has_init &amp;amp; BIT(location));
    gd-&amp;gt;env_has_init |= BIT(location);
    debug("%s: init environment after: 0x%lx\n", __func__, gd-&amp;gt;env_has_init &amp;amp; BIT(location));
}


int do_set_env_location(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
    env_location = SOURCE_MMC;
    env_set_inited(ENVL_MMC);
    env_load();
    debug("%s: set environment location to SD card\n", __func__);
    return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;After that you have access to the&amp;nbsp;&lt;SPAN&gt;environment variables. You can set and save them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 04:18:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699065#M210270</guid>
      <dc:creator>MicMoba</dc:creator>
      <dc:date>2023-08-04T04:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699603#M210339</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You mean i have to patch U-boot first ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 21:44:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699603#M210339</guid>
      <dc:creator>gnulux</dc:creator>
      <dc:date>2023-08-04T21:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699834#M210366</link>
      <description>&lt;P&gt;I had provided the command two years ago.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Today, I have to give a demo.&lt;/P&gt;
&lt;P&gt;Using uuu to send uboot command is exactly the same as you using uart to type uboot command to saveenv.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you need to make sure the configuration. Because there are default settings. Or you may lose some settings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you get error, please check such as emmc dev is correct or not.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HW: i.MX8MM EVK&lt;/P&gt;
&lt;P&gt;SW:&amp;nbsp;LF_v5.15.71-2.2.0_images_IMX8MMEVK&lt;/P&gt;
&lt;P&gt;uuu_setenv.uuu(uuu_setenv.zip attached):&lt;/P&gt;
&lt;P&gt;uuu_version 1.2.39&lt;/P&gt;
&lt;P&gt;# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ&lt;BR /&gt;SDP: boot -f imx-boot-imx8mmevk-sd.bin-flash_evk&lt;/P&gt;
&lt;P&gt;# This command will be run when ROM support stream mode&lt;BR /&gt;# i.MX8QXP, i.MX8QM&lt;BR /&gt;SDPS: boot -f imx-boot-imx8mmevk-sd.bin-flash_evk&lt;/P&gt;
&lt;P&gt;# These commands will be run when use SPL and will be skipped if no spl&lt;BR /&gt;# SDPU will be deprecated. please use SDPV instead of SDPU&lt;BR /&gt;# {&lt;BR /&gt;SDPU: delay 1000&lt;BR /&gt;SDPU: write -f imx-boot-imx8mmevk-sd.bin-flash_evk -offset 0x57c00&lt;BR /&gt;SDPU: jump&lt;BR /&gt;# }&lt;/P&gt;
&lt;P&gt;# These commands will be run when use SPL and will be skipped if no spl&lt;BR /&gt;# if (SPL support SDPV)&lt;BR /&gt;# {&lt;BR /&gt;SDPV: delay 1000&lt;BR /&gt;SDPV: write -f imx-boot-imx8mmevk-sd.bin-flash_evk -skipspl&lt;BR /&gt;SDPV: jump&lt;BR /&gt;# }&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FB: ucmd setenv mmcdev ${emmc_dev}&lt;BR /&gt;FB: ucmd setenv ABC test&lt;BR /&gt;FB: ucmd saveenv&lt;BR /&gt;FB: ucmd setenv mmcdev 1&lt;BR /&gt;FB: ucmd saveenv&lt;BR /&gt;FB: done&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;uuu log&lt;/P&gt;
&lt;P&gt;dev 2 is emmc and dev 1 is sdcard/tf card.&lt;/P&gt;
&lt;P&gt;The script saves the env to the emmc first. Then it switches to the sdcard and save again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/235255iAAD3719E6A4AD4D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;boot and check&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/235258iB20569D5AF0AC1D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled1.png" alt="Untitled1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 03:29:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699834#M210366</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2023-08-07T03:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699845#M210368</link>
      <description>&lt;P&gt;What you can do with uboot command through uart, you can do the exactly the same through uuu.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference I had told two years ago.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;The u-boot has&amp;nbsp;mmcautodetect, it can&amp;nbsp; detect boot from&amp;nbsp; the emmc(for example) and make the u-boot environment save to that device regardless the u-boot environment.&lt;/P&gt;
&lt;P&gt;But boot from usb, uboot will think it is not from emmc or sd or any usdhc interface.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you use "uuu -v FB: ucmd env default -a", the mmcdev will become 1.&lt;/P&gt;
&lt;P&gt;That is why you saveenv will get fail.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;uuu -b spl imx-boot-imx8mm-lpddr4-evk-sd.bin-flash_evk&lt;/P&gt;
&lt;P&gt;uuu -v FB: ucmd env default -a&amp;nbsp;&amp;nbsp;&lt;BR /&gt;uuu -v FB: ucmd print mmcdev&lt;BR /&gt;uuu -v FB: ucmd saveenv&lt;BR /&gt;uuu -v FB: ucmd print emmc_dev&lt;BR /&gt;uuu -v FB: ucmd setenv mmcdev ${emmc_dev}&lt;BR /&gt;uuu -v FB: ucmd saveenv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;## Checking Image at 43800000 ...&lt;BR /&gt;Unknown image format!&lt;BR /&gt;Run fastboot ...&lt;BR /&gt;## Resetting to default environment&lt;BR /&gt;Detect USB boot. Will enter fastboot mode!&lt;BR /&gt;mmcdev=1&lt;BR /&gt;Detect USB boot. Will enter fastboot mode!&lt;BR /&gt;Saving Environment to MMC... MMC: no card present&lt;BR /&gt;No block device&lt;BR /&gt;Failed (1)&amp;nbsp;fastboot mode!&lt;BR /&gt;Detect USB boot. Will enter fastboot mode!&lt;BR /&gt;Saving Environment to MMC... Writing to MMC(2)... OK&lt;BR /&gt;Detect USB boot. Will enter fastboot mode!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/235261iB02640E46AC7CD3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 03:49:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1699845#M210368</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2023-08-07T03:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1700282#M210410</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry to bother, you're right and i understood well the case. Except that on my board (Not EVK) I have another behavior i would like to fix.&amp;nbsp;&lt;/P&gt;&lt;P&gt;With your uuu_setenv , i have the error :&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Saving Environment to nowhere... not possible&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;uuu_version 1.2.39

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f LEC-IMX8MP-2G-IPi-SMARC-PLUS-UUU-TOOL_20220309

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f LEC-IMX8MP-2G-IPi-SMARC-PLUS-UUU-TOOL_20220309

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f LEC-IMX8MP-2G-IPi-SMARC-PLUS-UUU-TOOL_20220309 -offset 0x57c00
SDPU: jump
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f LEC-IMX8MP-2G-IPi-SMARC-PLUS-UUU-TOOL_20220309 -skipspl
SDPV: jump
# }


FB: ucmd setenv fastboot mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd setenv ABC test
FB: ucmd saveenv
FB: ucmd setenv mmcdev  1
FB: ucmd saveenv
FB: done &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UUU output :&amp;nbsp;&lt;/P&gt;&lt;P&gt;1:13&amp;gt;Start Cmd:FB: ucmd setenv fastboot mmc&lt;BR /&gt;1:13&amp;gt;Okay (0.01s)&lt;BR /&gt;1:13&amp;gt;Start Cmd:FB: ucmd setenv mmcdev ${emmc_dev}&lt;BR /&gt;1:13&amp;gt;Okay (0.01s)&lt;BR /&gt;1:13&amp;gt;Start Cmd:FB: ucmd setenv ABC test&lt;BR /&gt;1:13&amp;gt;Okay (0.01s)&lt;BR /&gt;1:13&amp;gt;Start Cmd:FB: ucmd saveenv&lt;BR /&gt;1:13&amp;gt;&lt;FONT color="#FF0000"&gt;Fail (0.011s)&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I have checked with command lines , and FB enable emmc 2 . I can flash fat and rootfs without problem. But only the savenv failed (trying to set mac addresses during flash)&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Console output :&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;U-Boot 2021.04-lf_v2021.04+g263b27e076 (Nov 22 2021 - 01:39:23 +0000)

alloc space exhausted
CPU:   i.MX8MP[8] rev1.1 at 1200 MHz
Reset cause: POR
Model: Adlink lec-imx8mp LPDDR4 SOM
DRAM:  2 GiB
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
[*]-Video Link 0probe video device failed, ret -2

        [0] lcd-controller@32e80000, video
        [1] mipi_dsi@32e60000, video_bridge
In:    serial
Out:   serial
Err:   serial

 BuildInfo:
  - ATF 5782363

MMC: no card present
Detect USB boot. Will enter fastboot mode!
Net:   
Warning: ethernet@30be0000 (eth0) using random MAC address - fa:22:46:75:18:a5
eth0: ethernet@30be0000
Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for                                mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; e;
Hit any key to stop autoboot:  0 

## Checking Image at 43800000 ...
Unknown image format!
Run fastboot ...
Unknown command 'setenc' - try 'help'
(NULL udevice *): request 00000000bcf23d00 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
(NULL udevice *): request 00000000bcf23d00 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
(NULL udevice *): request 00000000bcf23d00 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
(NULL udevice *): request 00000000bcf23d00 was not queued to ep1in-bulk
Saving Environment to nowhere... not possible
(NULL udevice *): request 00000000bcf23d00 was not queued to ep1in-bulk&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if it is not related to&amp;nbsp;CONFIG_ENV_IS_NOWHERE=y in U-Boot ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 14:07:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1700282#M210410</guid>
      <dc:creator>gnulux</dc:creator>
      <dc:date>2023-08-07T14:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1700817#M210446</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also create a scard mirror with env already set.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;--- u-boot/arch/arm/mach-imx/imx8m/soc.c.orig   2023-08-08 19:06:07.627236934 +0800
+++ u-boot/arch/arm/mach-imx/imx8m/soc.c        2023-08-08 19:07:15.708770073 +0800
@@ -1713,6 +1713,9 @@ enum env_location env_get_location(enum
                return ENVL_UNKNOWN;

        switch (dev) {
+       case USB_BOOT:
+       case USB2_BOOT:
+               return ENVL_MMC;
        case QSPI_BOOT:
                if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))
                        return ENVL_SPI_FLASH;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 11:08:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1700817#M210446</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2023-08-08T11:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1701040#M210458</link>
      <description>&lt;P&gt;The alternative way. I think it is the better way to set the u-boot environment into sdcard mirror.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is better, because this way can be used for mass production.&lt;/P&gt;
&lt;P&gt;The idea is to use fw_setenv to set the sdcard mirror as the operation on a real emmc/sdcard.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the demo.&lt;/P&gt;
&lt;P&gt;I add test=ABCD for test purpose.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And use fw_printenv to check and use hexdump to double confirm it.&lt;/P&gt;
&lt;P&gt;The uboot env is already written into sdcard mirror(imx-image-multimedia-imx8mpevk.wic).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those operations are on the host x86/x64 PC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; ./fw_setenv -c fw_env.config -f u-boot-initial-env
Environment WRONG, copy 0
Cannot read environment, using default

 ./fw_printenv -c fw_env.config
Environment OK, copy 0
 jh_root_dtb=imx8mp-evk-root.dtb
 loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bsp_script};
 mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
arch=arm
baudrate=115200
.........
........
........
splashimage=0x50000000
test=ABCD
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=freescale

 
 hexdump -s 0x400000 -n 100 -C imx-image-multimedia-imx8mpevk.wic
            
00400000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

hexdump -s 0x400000 -n 10000 -C imx-image-multimedia-imx8mpevk.wic
00400000  5f a4 9b 97 20 6a 68 5f  72 6f 6f 74 5f 64 74 62  |_... jh_root_dtb|
00400010  3d 69 6d 78 38 6d 70 2d  65 76 6b 2d 72 6f 6f 74  |=imx8mp-evk-root|
00400020  2e 64 74 62 00 20 6c 6f  61 64 62 6f 6f 74 73 63  |.dtb. loadbootsc|
00400030  72 69 70 74 3d 66 61 74  6c 6f 61 64 20 6d 6d 63  |ript=fatload mmc|
00400040  20 24 7b 6d 6d 63 64 65  76 7d 3a 24 7b 6d 6d 63  | ${mmcdev}:${mmc|
00400050  70 61 72 74 7d 20 24 7b  6c 6f 61 64 61 64 64 72  |part} ${loadaddr|
00400060  7d 20 24 7b 62 73 70 5f  73 63 72 69 70 74 7d 3b  |} ${bsp_script};|
00400070  00 20 6d 6d 63 5f 62 6f  6f 74 3d 69 66 20 6d 6d  |. mmc_boot=if mm|



00401390  76 3d 31 00 73 6f 63 3d  69 6d 78 38 6d 00 73 70  |v=1.soc=imx8m.sp|
004013a0  6c 61 73 68 69 6d 61 67  65 3d 30 78 35 30 30 30  |lashimage=0x5000|
004013b0  30 30 30 30 00 74 65 73  74 3d 41 42 43 44 00 75  |0000.test=ABCD.u|
004013c0  73 62 5f 62 6f 6f 74 3d  75 73 62 20 73 74 61 72  |sb_boot=usb star|
004013d0  74 3b 20 69 66 20 75 73  62 20 64 65 76 20 24 7b  |t; if usb dev ${|
004013e0  64 65 76 6e 75 6d 7d 3b  20 74 68 65 6e 20 64 65  |devnum}; then de|
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then,&lt;/P&gt;
&lt;P&gt;I flash the sdcard mirror into i.MX8MP evk&amp;nbsp; board&amp;nbsp; emmc to check&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;uuu -b emmc_all imx-boot-imx8mp-lpddr4-evk-sd.bin-flash_evk  imx-image-multimedia-imx8mpevk.wic&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first time boot, the env is already there.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 742px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/235541i4239FD8AA1F2D841/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How to:&lt;/P&gt;
&lt;P&gt;a. fw_setenv/fw_printenv:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/sbabic/libubootenv.git" target="_blank" rel="noopener"&gt;https://github.com/sbabic/libubootenv.git&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Note: Please do not use uboot&amp;nbsp;fw_setenv/fw_printenv&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compile it on the host x86/x64 PC. It is used on host.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b.&amp;nbsp;u-boot-initial-env&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Under uboot,&amp;nbsp;make u-boot-initial-env&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Note: Yocto deploys u-boot-initial-env by default&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c.&amp;nbsp;fw_env.config&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;imx-image-multimedia-imx8mpevk.wic 0x400000 0x4000
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 0x400000 0x4000&amp;nbsp; are from&amp;nbsp;uboot-imx\configs\imx8mp_evk_defconfig&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x400000&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, you can run&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;./fw_setenv -c fw_env.config -f u-boot-initial-env&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 11:26:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1701040#M210458</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2023-08-08T11:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1702073#M210539</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/25009" target="_self"&gt;&lt;SPAN class=""&gt;BiyongSUN&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;It works fine. Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Indeed I will use this method for mass production instead of setenv from UUU.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 15:37:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1702073#M210539</guid>
      <dc:creator>gnulux</dc:creator>
      <dc:date>2023-08-09T15:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: saveenv is not working from uuu script</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1702563#M210560</link>
      <description>&lt;P&gt;It is great to hear it works fine on your side.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That makes me think file it into my collection, more people can see it and use it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;u-boot environment preset for sdcard mirror&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/u-boot-environment-preset-for-sdcard-mirror/ta-p/1702549" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/u-boot-environment-preset-for-sdcard-mirror/ta-p/1702549&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-Development-Miscellanea-i-MX-%E5%BC%80%E5%8F%91%E6%9D%82%E8%AE%B0/ta-p/1104265" target="_blank" rel="noopener"&gt;i.MX Development Miscellanea(i.MX 开发杂记) - NXP Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 04:47:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/saveenv-is-not-working-from-uuu-script/m-p/1702563#M210560</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2023-08-10T04:47:29Z</dc:date>
    </item>
  </channel>
</rss>

