<?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 FlexSPI ROM API on RT1170 with FreeRTOS: Questions about Interrupt Disabling and Cache Coherency in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/FlexSPI-ROM-API-on-RT1170-with-FreeRTOS-Questions-about/m-p/2355823#M31685</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Dear NXP Team,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I would like to ask some questions about disabling interrupts and cache management when using the FlexSPI ROM API. I am using the RT1170 chip with FreeRTOS. Occasionally, the system hangs, and I suspect it may be caused by Flash operations using the ROM API.&lt;/P&gt;&lt;P&gt;1. In the SDK example `flexspi_romapi_cm7`, when reading/writing/erasing Flash with the ROM API, there is no interrupt disable/enable operation. I also found a document titled *"i.MX RT series FlexSPI Nor ROM APIs Usage &amp;amp; Flashloader.pdf"*, which mentions interrupts:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_1-1777029095740.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383487iCCF0AC585B642AD0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_1-1777029095740.png" alt="52liuyi52liuyi_1-1777029095740.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it because the ROM API already handles interrupt masking internally, or is there another reason?&lt;/P&gt;&lt;P&gt;To implement write and erase operations at arbitrary Flash addresses, I have wrapped the ROM API into `flash_eraseData()` and `flash_writeData()` functions, and simply wrapped the read operation as `flash_readData()`:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_2-1777029153497.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383488i69610D9941ADA4E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_2-1777029153497.png" alt="52liuyi52liuyi_2-1777029153497.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_3-1777029175571.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383489iC95A7AA30726AC81/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_3-1777029175571.png" alt="52liuyi52liuyi_3-1777029175571.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_4-1777029197881.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383490iCE2E4B19FA574688/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_4-1777029197881.png" alt="52liuyi52liuyi_4-1777029197881.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could you please review whether there are any potential errors in my three wrapper functions(I am a bit doubtful whether an erase operation is required before calling ROM_FLEXSPI_NorFlash_ProgramPage)? Also, when calling these functions (not the ROM API directly), is it necessary to disable/enable interrupts?&lt;/P&gt;&lt;P&gt;2. In the SDK example, after calling `ROM_FLEXSPI_NorFlash_ProgramPage` to write Flash, there is a `DCACHE_InvalidateByRange` operation to invalidate the D-Cache.&lt;BR /&gt;I understand that the ROM API operates on external NOR Flash through the FlexSPI controller's programming sequence, bypassing the Cache, so the CM7's data cache lines are not automatically updated.&lt;BR /&gt;Later, when we use `memcpy` to access Flash data, the access goes through D-Cache, and stale values may be fetched if the cache hits. Therefore, invalidating the D-Cache is necessary.&lt;BR /&gt;In my three wrapper functions that use these ROM APIs, could there also be cache coherency issues due to improper handling?&lt;/P&gt;&lt;P&gt;Any help would be very appreciated.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;langya.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2026 11:31:52 GMT</pubDate>
    <dc:creator>langya</dc:creator>
    <dc:date>2026-04-24T11:31:52Z</dc:date>
    <item>
      <title>FlexSPI ROM API on RT1170 with FreeRTOS: Questions about Interrupt Disabling and Cache Coherency</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/FlexSPI-ROM-API-on-RT1170-with-FreeRTOS-Questions-about/m-p/2355823#M31685</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear NXP Team,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I would like to ask some questions about disabling interrupts and cache management when using the FlexSPI ROM API. I am using the RT1170 chip with FreeRTOS. Occasionally, the system hangs, and I suspect it may be caused by Flash operations using the ROM API.&lt;/P&gt;&lt;P&gt;1. In the SDK example `flexspi_romapi_cm7`, when reading/writing/erasing Flash with the ROM API, there is no interrupt disable/enable operation. I also found a document titled *"i.MX RT series FlexSPI Nor ROM APIs Usage &amp;amp; Flashloader.pdf"*, which mentions interrupts:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_1-1777029095740.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383487iCCF0AC585B642AD0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_1-1777029095740.png" alt="52liuyi52liuyi_1-1777029095740.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it because the ROM API already handles interrupt masking internally, or is there another reason?&lt;/P&gt;&lt;P&gt;To implement write and erase operations at arbitrary Flash addresses, I have wrapped the ROM API into `flash_eraseData()` and `flash_writeData()` functions, and simply wrapped the read operation as `flash_readData()`:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_2-1777029153497.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383488i69610D9941ADA4E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_2-1777029153497.png" alt="52liuyi52liuyi_2-1777029153497.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_3-1777029175571.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383489iC95A7AA30726AC81/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_3-1777029175571.png" alt="52liuyi52liuyi_3-1777029175571.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="52liuyi52liuyi_4-1777029197881.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/383490iCE2E4B19FA574688/image-size/medium?v=v2&amp;amp;px=400" role="button" title="52liuyi52liuyi_4-1777029197881.png" alt="52liuyi52liuyi_4-1777029197881.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could you please review whether there are any potential errors in my three wrapper functions(I am a bit doubtful whether an erase operation is required before calling ROM_FLEXSPI_NorFlash_ProgramPage)? Also, when calling these functions (not the ROM API directly), is it necessary to disable/enable interrupts?&lt;/P&gt;&lt;P&gt;2. In the SDK example, after calling `ROM_FLEXSPI_NorFlash_ProgramPage` to write Flash, there is a `DCACHE_InvalidateByRange` operation to invalidate the D-Cache.&lt;BR /&gt;I understand that the ROM API operates on external NOR Flash through the FlexSPI controller's programming sequence, bypassing the Cache, so the CM7's data cache lines are not automatically updated.&lt;BR /&gt;Later, when we use `memcpy` to access Flash data, the access goes through D-Cache, and stale values may be fetched if the cache hits. Therefore, invalidating the D-Cache is necessary.&lt;BR /&gt;In my three wrapper functions that use these ROM APIs, could there also be cache coherency issues due to improper handling?&lt;/P&gt;&lt;P&gt;Any help would be very appreciated.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;langya.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 11:31:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/FlexSPI-ROM-API-on-RT1170-with-FreeRTOS-Questions-about/m-p/2355823#M31685</guid>
      <dc:creator>langya</dc:creator>
      <dc:date>2026-04-24T11:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: FlexSPI ROM API on RT1170 with FreeRTOS: Questions about Interrupt Disabling and Cache Coherency</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/FlexSPI-ROM-API-on-RT1170-with-FreeRTOS-Questions-about/m-p/2356260#M31704</link>
      <description>&lt;P&gt;&lt;A href="https://www.nxp.com.cn/docs/en/application-note/AN12077.pdf" target="_blank"&gt;AN12077: Using the i.MX RT FlexRAM – Application Note&lt;/A&gt;&amp;nbsp;FYI, have you test your code on RT1170 EVK? More error log during system hang would be helpful&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2026 04:09:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/FlexSPI-ROM-API-on-RT1170-with-FreeRTOS-Questions-about/m-p/2356260#M31704</guid>
      <dc:creator>db16122</dc:creator>
      <dc:date>2026-04-27T04:09:19Z</dc:date>
    </item>
  </channel>
</rss>

