<?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: Getting SFDP parameters from QSPI NOR flash using ROMAPI in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2093226#M5152</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/124967"&gt;@mastupristi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for your interest in NXP MIMXRT series!&lt;/P&gt;
&lt;P&gt;I used something similar to FLEXSPI_NorFlash_GetVendorID() to create a lut_seq, and &lt;SPAN&gt;update it&lt;/SPAN&gt; with &lt;SPAN&gt;ROM_FLEXSPI_NorFlash_UpdateLut(), and this method performs a successful read of the SFDP header.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try it on your end.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I hope it helps you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;Gavin&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2025 02:16:31 GMT</pubDate>
    <dc:creator>Gavin_Jia</dc:creator>
    <dc:date>2025-05-08T02:16:31Z</dc:date>
    <item>
      <title>Getting SFDP parameters from QSPI NOR flash using ROMAPI</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2091563#M5150</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have MIMXRT1020-EVK (rev A3). It is populated with IS25LP064A-JBLE.&lt;BR /&gt;&lt;BR /&gt;I would like to try to read SFDP parameters using the ROM API.&lt;/P&gt;&lt;P&gt;I read the documentation (both IS25LP064A datasheet and JESD216)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mastupristi_0-1746461024385.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336208i7886ED11A82DDD8D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mastupristi_0-1746461024385.png" alt="mastupristi_0-1746461024385.png" /&gt;&lt;/span&gt;&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="mastupristi_1-1746461144247.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336209iF7CD67D161ED8706/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mastupristi_1-1746461144247.png" alt="mastupristi_1-1746461144247.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this I modified the example &lt;STRONG&gt;evkmimxrt1020_fsl_romapi&lt;/STRONG&gt; (which I have attached), to run in RAM and not to write flash.&lt;BR /&gt;&lt;BR /&gt;Specifically, I added an entry in the LUT (I used the symbol &lt;STRONG&gt;NOR_CMD_LUT_SEQ_IDX_READ_SFDP&lt;/STRONG&gt; that was already defined in &lt;STRONG&gt;fsl_romapi.h&lt;/STRONG&gt;)&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    /* Read SFDP */
    config-&amp;gt;memConfig.lookupTable[4U * NOR_CMD_LUT_SEQ_IDX_READ_SFDP] =
        FSL_ROM_FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x5AU, RADDR_SDR, FLEXSPI_1PAD, 0x18U);
    config-&amp;gt;memConfig.lookupTable[4U * NOR_CMD_LUT_SEQ_IDX_READ_SFDP + 1U] =
        FSL_ROM_FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 0x08U, READ_SDR, FLEXSPI_1PAD, 0x04U);&lt;/LI-CODE&gt;&lt;P&gt;you can see that it's very similar to the read command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I defined the function to do SFDP transactions.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;status_t FLEXSPI_NorFlash_sfdp(uint32_t instance, uint32_t addr, uint32_t *readData, size_t readDataLen)
{
    flexspi_xfer_t xfer;
    xfer.operation            = kFLEXSPIOperation_Read;
    xfer.seqId                = NOR_CMD_LUT_SEQ_IDX_READ_SFDP;
    xfer.seqNum               = 1U;
    xfer.baseAddress          = addr;
    xfer.isParallelModeEnable = false;
    xfer.rxBuffer             = readData;
    xfer.rxSize               = readDataLen;

    uint32_t status = ROM_FLEXSPI_NorFlash_CommandXfer(instance, &amp;amp;xfer);
    return status;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This call, however, returns code 6001, which should mean &lt;STRONG&gt;Invalid Sequence&lt;/STRONG&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mastupristi_2-1746461912919.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336210iC9EF0B2AE72EFB11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mastupristi_2-1746461912919.png" alt="mastupristi_2-1746461912919.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Where am I going wrong? How to make SFDP reading work?&lt;BR /&gt;&lt;BR /&gt;best regards&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 16:25:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2091563#M5150</guid>
      <dc:creator>mastupristi</dc:creator>
      <dc:date>2025-05-05T16:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SFDP parameters from QSPI NOR flash using ROMAPI</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2093226#M5152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/124967"&gt;@mastupristi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for your interest in NXP MIMXRT series!&lt;/P&gt;
&lt;P&gt;I used something similar to FLEXSPI_NorFlash_GetVendorID() to create a lut_seq, and &lt;SPAN&gt;update it&lt;/SPAN&gt; with &lt;SPAN&gt;ROM_FLEXSPI_NorFlash_UpdateLut(), and this method performs a successful read of the SFDP header.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try it on your end.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I hope it helps you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;Gavin&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 02:16:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2093226#M5152</guid>
      <dc:creator>Gavin_Jia</dc:creator>
      <dc:date>2025-05-08T02:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting SFDP parameters from QSPI NOR flash using ROMAPI</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2093726#M5153</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203261"&gt;@Gavin_Jia&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh, brilliant – I just discovered that if manually overwrite the LUT in the hardware, everything starts working:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static status_t flash_sfdp(uint32_t addr, uint32_t *readData, size_t readDataLen)
{
    uint32_t lut_seq[4];
    memset(lut_seq, 0, sizeof(lut_seq));
    // Read SFDP
    lut_seq[0] = FSL_ROM_FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x5AU, RADDR_SDR, FLEXSPI_1PAD, 0x18U);
    lut_seq[1] = FSL_ROM_FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 0x08U, READ_SDR, FLEXSPI_1PAD, 0x04U);
    ROM_FLEXSPI_NorFlash_UpdateLut(0, NOR_CMD_LUT_SEQ_IDX_READ_SFDP, (const uint32_t *)lut_seq, 1U);

    flexspi_xfer_t xfer;
    xfer.operation            = kFLEXSPIOperation_Read;
    xfer.seqId                = NOR_CMD_LUT_SEQ_IDX_READ_SFDP;
    xfer.seqNum               = 1U;
    xfer.baseAddress          = addr;
    xfer.isParallelModeEnable = false;
    xfer.rxBuffer             = readData;
    xfer.rxSize               = readDataLen;

    uint32_t status = ROM_FLEXSPI_NorFlash_CommandXfer(0, &amp;amp;xfer);
    return status;
}&lt;/LI-CODE&gt;&lt;P&gt;So let me get this straight: you ask us to fill out a &lt;FONT face="courier new,courier"&gt;lookupTable&lt;/FONT&gt; array in the &lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt; struct, but the ROM API never even reads it? Totally intuitive design choice! &lt;LI-EMOJI id="lia_upside-down-face" title=":upside_down_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I mean, since you’ve already blessed us with half a dozen other fields in &lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt; that apparently exist solely for ornamental value, I guess my next step is to guess which ones actually do something? What else am I supposed to try—perform a rain dance?&lt;/P&gt;&lt;P&gt;At this point, can someone point me to the magical incantation that makes these “config” fields actually… you know, get used? Or should I just start writing my own ROM API to interpret hieroglyphics?&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 15:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2093726#M5153</guid>
      <dc:creator>mastupristi</dc:creator>
      <dc:date>2025-05-08T15:04:42Z</dc:date>
    </item>
  </channel>
</rss>

