<?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>topic Re: Create new U-Boot Environment Variable in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1604836#M201964</link>
    <description>&lt;P&gt;To test SWUpdate I was manually running the commands&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv swupdate_bootcmd "setenv bootargs console=ttymxc0,115200 root=/dev/ram0 rootfstype=ext4 rw ; load mmc 1:3 0x83000000 /swupdate-image-imx6ull14x14evk.ext4.gz.u-boot;load mmc 1 0x82a00000 imx6ull-14x14-evk.dtb;load mmc 1 0x80800000 zImage;load mmc 1 0x83000000 300000 100000;setenv root /dev/ram0;setenv rootfstype ext4;setenv fw_env_config /etc/fw_env.config;bootz 0x80800000 0x83000000 0x82a00000"
savenev
run swupdate_bootcmd&lt;/LI-CODE&gt;&lt;P&gt;I am now trying to automate this process.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2023 22:12:28 GMT</pubDate>
    <dc:creator>MichaelBMiner</dc:creator>
    <dc:date>2023-02-23T22:12:28Z</dc:date>
    <item>
      <title>Create new U-Boot Environment Variable</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1604835#M201963</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have implemented SWUpdate and I can successfully upgrade my kernel and OS. Now I am trying to create two new U-Boot environment variables.&lt;/P&gt;&lt;P&gt;CONFIG_KERNEL_TO_RUN and&amp;nbsp;CONFIG_SWUPDATE_BOOTCMD. The idea is&amp;nbsp;CONFIG_KERNEL_TO_RUN can have the values 0 or 1. If the value is 1 run the SWUpdate kernel to receive a new update, or run the default image kernel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To add these new variables I am attempting to patch the mx6ul_14x14_evk.h file in&amp;nbsp;build-fb/tmp/work/imx6ull14x14evk-poky-linux-gnueabi/u-boot-imx/2021.04-r0. My patch is properly applied but when I run my device and enter the bootloader, running printenv my new setting is not present.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note I have only attempted to add&amp;nbsp;CONFIG_SWUPDATE_BOOTCMD at this point. Here is my patch file.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--- a/include/configs/mx6ul_14x14_evk.h	2023-02-23 15:43:58.407930365 -0600
+++ b/include/configs/mx6ul_14x14_evk.h	2023-02-23 15:41:52.594126013 -0600
@@ -120,6 +120,7 @@
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
 	"splashimage=0x8c000000\0" \
+	"swupdate_bootcmd="__stringify(CONFIG_SWUPDATE_BOOTCMD)"\0" \
 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
@@ -218,6 +219,17 @@
 			   "fi; " \
 		   "fi; " \
 	   "else run netboot; fi"
+	   
+#define CONFIG_SWUPDATE_BOOTCMD \
+	"setenv bootargs console=ttymxc0,115200 root=/dev/ram0 rootfstype=ext4 rw ;" \
+	"load mmc 1:3 0x83000000 /swupdate-image-imx6ull14x14evk.ext4.gz.u-boot;" \
+	"load mmc 1 0x82a00000 imx6ull-14x14-evk.dtb;" \
+	"load mmc 1 0x80800000 zImage;" \
+	"load mmc 1 0x83000000 300000 100000;" \
+	"setenv root /dev/ram0;" \
+	"setenv rootfstype ext4;" \
+	"setenv fw_env_config /etc/fw_env.config;" \
+	"bootz 0x80800000 0x83000000 0x82a00000;"	   
 #endif
 
 /* Miscellaneous configurable options */&lt;/LI-CODE&gt;&lt;P&gt;Is there something I am missing? I figured if I told uboot about this new setting it would just appear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 22:11:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1604835#M201963</guid>
      <dc:creator>MichaelBMiner</dc:creator>
      <dc:date>2023-02-23T22:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create new U-Boot Environment Variable</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1604836#M201964</link>
      <description>&lt;P&gt;To test SWUpdate I was manually running the commands&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv swupdate_bootcmd "setenv bootargs console=ttymxc0,115200 root=/dev/ram0 rootfstype=ext4 rw ; load mmc 1:3 0x83000000 /swupdate-image-imx6ull14x14evk.ext4.gz.u-boot;load mmc 1 0x82a00000 imx6ull-14x14-evk.dtb;load mmc 1 0x80800000 zImage;load mmc 1 0x83000000 300000 100000;setenv root /dev/ram0;setenv rootfstype ext4;setenv fw_env_config /etc/fw_env.config;bootz 0x80800000 0x83000000 0x82a00000"
savenev
run swupdate_bootcmd&lt;/LI-CODE&gt;&lt;P&gt;I am now trying to automate this process.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 22:12:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1604836#M201964</guid>
      <dc:creator>MichaelBMiner</dc:creator>
      <dc:date>2023-02-23T22:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create new U-Boot Environment Variable</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1605315#M201995</link>
      <description>&lt;P&gt;Dumb mistake I was patching the wrong header file. I was patching&amp;nbsp;mx6ul_14x14_evk.h but needed to patch&amp;nbsp;mx6ullevk.h.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this by looking into the file&amp;nbsp;tmp/work/imx6ull14x14evk-poky-linux-gnueabi/u-boot-imx/2021.04-r0/build/mx6ull_14x14_evk_emmc_config/include/config.h which contains&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/* Automatically generated - do not edit */
#define CONFIG_IMX_CONFIG	board/freescale/mx6ullevk/imximage.cfg
#define CONFIG_BOARDDIR board/freescale/mx6ullevk
#include &amp;lt;config_uncmd_spl.h&amp;gt;
#include &amp;lt;configs/mx6ullevk.h&amp;gt;
#include &amp;lt;asm/config.h&amp;gt;
#include &amp;lt;linux/kconfig.h&amp;gt;
#include &amp;lt;config_fallbacks.h&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 Feb 2023 14:28:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Create-new-U-Boot-Environment-Variable/m-p/1605315#M201995</guid>
      <dc:creator>MichaelBMiner</dc:creator>
      <dc:date>2023-02-24T14:28:04Z</dc:date>
    </item>
  </channel>
</rss>

