<?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: fw_setenv corrupts environment on MTD for Linux kernels after 5.4 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1866290#M223771</link>
    <description>&lt;P&gt;We experienced the same issue using the&amp;nbsp;sst25vf032b and&amp;nbsp;sst26vf032b in both the 6.1 and 6.6 kernels. Thanks for this patch it has fixed the problem in both kernels versions for us as well.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 12:24:27 GMT</pubDate>
    <dc:creator>shawnkarow</dc:creator>
    <dc:date>2024-05-15T12:24:27Z</dc:date>
    <item>
      <title>fw_setenv corrupts environment on MTD for Linux kernels after 5.4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1845194#M222390</link>
      <description>&lt;P&gt;I'm using a BoundaryDevices Nitrogen 6 SOM2v2 with an i.MX6Q and sst25vf016b SPI NOR for U-Boot (environment stored on /dev/mtd1). System image is built via buildroot. For our system upgrade process, we need to change U-Boot variables from a shell script which is achieved via fw_setenv.&lt;/P&gt;&lt;P&gt;The issue now is, that trying to use a kernel after 5.4 (tested with 5.10. 5.15, and 6.1), fw_setenv destroys the environment on the MTD, making the upgrade process fail (same failure for fw_setenv from UBOOT_TOOLS and LIBUBOOTENV). According to the folks at Boundary Devices, "The issue you're seeing is related to a bug in the MTD driver.&amp;nbsp; The driver comes from NXP, and we haven't made any modifications."&lt;/P&gt;&lt;P&gt;The latest buildroot (2024.02.1), using the defconfig for this board uses the MTD driver from &lt;A href="https://github.com/boundarydevices/linux/tree/boundary-imx_6.1.y/drivers/mtd" target="_blank" rel="noopener"&gt;https://github.com/boundarydevices/linux/tree/boundary-imx_6.1.y/drivers/mtd&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The failure can easily be triggered using the following steps:&lt;/P&gt;&lt;PRE&gt;# fw_printenv bootdelay&lt;BR /&gt;bootdelay=3&lt;BR /&gt;# fw_setenv bootdelay 5&lt;BR /&gt;# fw_printenv bootdelay&lt;BR /&gt;Warning: Bad CRC, using default environment&lt;/PRE&gt;&lt;P&gt;Looking at the stored environment after these steps by means of&lt;/P&gt;&lt;PRE&gt;hexdump -C /dev/mtd1&lt;/PRE&gt;&lt;P&gt;we can see that everything but the first byte for each block is 0xff, pointing to the erase being successful but the write only writing one byte.&lt;/P&gt;&lt;P&gt;Any ideas on how to fix the driver? We really would like to move on past a 5.4 kernel/buildroot 2021.02…&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 15:47:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1845194#M222390</guid>
      <dc:creator>aahndee</dc:creator>
      <dc:date>2024-05-15T15:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: fw_setenv corrupts environment on MTD for Linux kernels after 5.4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1845268#M222400</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Maybe someone of @Nitrogen could help on this.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 14:41:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1845268#M222400</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2024-04-11T14:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: fw_setenv corrupts environment on MTD for Linux kernels after 5.4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1849129#M222658</link>
      <description>&lt;P&gt;If by "Nitrogen" you mean the people at Ezurio (formerly Boundary Devices), I've tried that first and they said that their Linux kernel is the one from NXP so I should try here…&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 15:00:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1849129#M222658</guid>
      <dc:creator>aahndee</dc:creator>
      <dc:date>2024-04-17T15:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: fw_setenv corrupts environment on MTD for Linux kernels after 5.4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1863643#M223577</link>
      <description>&lt;P&gt;After comparing the SPI traffic during write with working vs. non-working kernel issues I was able to track the issue down to the SST write code in the MTD driver and managed to fix this using the attached patch (patch against Linux 6.1, only tested against sst25vf016b).&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 17:50:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1863643#M223577</guid>
      <dc:creator>aahndee</dc:creator>
      <dc:date>2024-05-10T17:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: fw_setenv corrupts environment on MTD for Linux kernels after 5.4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1866290#M223771</link>
      <description>&lt;P&gt;We experienced the same issue using the&amp;nbsp;sst25vf032b and&amp;nbsp;sst26vf032b in both the 6.1 and 6.6 kernels. Thanks for this patch it has fixed the problem in both kernels versions for us as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 12:24:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/fw-setenv-corrupts-environment-on-MTD-for-Linux-kernels-after-5/m-p/1866290#M223771</guid>
      <dc:creator>shawnkarow</dc:creator>
      <dc:date>2024-05-15T12:24:27Z</dc:date>
    </item>
  </channel>
</rss>

