<?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 Complete FlexSPI Configuration with ROM_FLEXSPI_NORFlash_Init in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2093734#M5154</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m using the ROM API function &lt;FONT face="courier new,courier"&gt;ROM_FLEXSPI_NORFlash_Init()&lt;/FONT&gt; to initialize my QSPI NOR flash, and I pass in a pointer to a &lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt; instance built from these underlying structures:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/*! @brief FLEXSPI Memory Configuration Block */
typedef struct _flexspi_mem_config
{
    uint32_t tag;       /*!&amp;lt; [0x000-0x003] Tag, fixed value 0x42464346UL */
    uint32_t version;   /*!&amp;lt; [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix */
    uint32_t reserved0; /*!&amp;lt; [0x008-0x00b] Reserved for future use */
    uint8_t readSampleClkSrc;    /*!&amp;lt; [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3 */
    uint8_t csHoldTime;          /*!&amp;lt; [0x00d-0x00d] Data hold time, default value: 3 */
    uint8_t csSetupTime;         /*!&amp;lt; [0x00e-0x00e] Date setup time, default value: 3 */
    uint8_t columnAddressWidth;  /*!&amp;lt; [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
                                                    Serial NAND, need to refer to datasheet */
    uint8_t deviceModeCfgEnable; /*!&amp;lt; [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable */
    uint8_t deviceModeType; /*!&amp;lt; [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
                                               Generic configuration, etc. */
    uint16_t waitTimeCfgCommands;    /*!&amp;lt; [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
                                                        DPI/QPI/OPI switch or reset command */
    flexspi_lut_seq_t deviceModeSeq; /*!&amp;lt; [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
                                                        sequence number, [31:16] Reserved */
    uint32_t deviceModeArg;          /*!&amp;lt; [0x018-0x01b] Argument/Parameter for device configuration */
    uint8_t configCmdEnable;         /*!&amp;lt; [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable */
    uint8_t configModeType[3];       /*!&amp;lt; [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe */
    flexspi_lut_seq_t
        configCmdSeqs[3]; /*!&amp;lt; [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq */
    uint32_t reserved1;   /*!&amp;lt; [0x02c-0x02f] Reserved for future use */
    uint32_t configCmdArgs[3];     /*!&amp;lt; [0x030-0x03b] Arguments/Parameters for device Configuration commands */
    uint32_t reserved2;            /*!&amp;lt; [0x03c-0x03f] Reserved for future use */
    uint32_t controllerMiscOption; /*!&amp;lt; [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
                                      details */
    uint8_t deviceType;            /*!&amp;lt; [0x044-0x044] Device Type:  See Flash Type Definition for more details */
    uint8_t sflashPadType; /*!&amp;lt; [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal */
    uint8_t serialClkFreq; /*!&amp;lt; [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
                                              Chapter for more details */
    uint8_t
        lutCustomSeqEnable; /*!&amp;lt; [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
                                              be done using 1 LUT sequence, currently, only applicable to HyperFLASH */
    uint32_t reserved3[2];  /*!&amp;lt; [0x048-0x04f] Reserved for future use */
    uint32_t sflashA1Size;  /*!&amp;lt; [0x050-0x053] Size of Flash connected to A1 */
    uint32_t sflashA2Size;  /*!&amp;lt; [0x054-0x057] Size of Flash connected to A2 */
    uint32_t sflashB1Size;  /*!&amp;lt; [0x058-0x05b] Size of Flash connected to B1 */
    uint32_t sflashB2Size;  /*!&amp;lt; [0x05c-0x05f] Size of Flash connected to B2 */
    uint32_t csPadSettingOverride;       /*!&amp;lt; [0x060-0x063] CS pad setting override value */
    uint32_t sclkPadSettingOverride;     /*!&amp;lt; [0x064-0x067] SCK pad setting override value */
    uint32_t dataPadSettingOverride;     /*!&amp;lt; [0x068-0x06b] data pad setting override value */
    uint32_t dqsPadSettingOverride;      /*!&amp;lt; [0x06c-0x06f] DQS pad setting override value */
    uint32_t timeoutInMs;                /*!&amp;lt; [0x070-0x073] Timeout threshold for read status command */
    uint32_t commandInterval;            /*!&amp;lt; [0x074-0x077] CS deselect interval between two commands */
    flexspi_dll_time_t dataValidTime[2]; /*!&amp;lt; [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B */
    uint16_t busyOffset;                 /*!&amp;lt; [0x07c-0x07d] Busy offset, valid value: 0-31 */
    uint16_t busyBitPolarity; /*!&amp;lt; [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
                                                 busy flag is 0 when flash device is busy */
    uint32_t lookupTable[64]; /*!&amp;lt; [0x080-0x17f] Lookup table holds Flash command sequences */
    flexspi_lut_seq_t lutCustomSeq[12]; /*!&amp;lt; [0x180-0x1af] Customizable LUT Sequences */
    uint32_t reserved4[4];              /*!&amp;lt; [0x1b0-0x1bf] Reserved for future use */
} flexspi_mem_config_t;

/*! @brief  Serial NOR configuration block */
typedef struct _flexspi_nor_config
{
    flexspi_mem_config_t memConfig; /*!&amp;lt; Common memory configuration info via FLEXSPI */
    uint32_t pageSize;              /*!&amp;lt; Page size of Serial NOR */
    uint32_t sectorSize;            /*!&amp;lt; Sector size of Serial NOR */
    uint8_t ipcmdSerialClkFreq;     /*!&amp;lt; Clock frequency for IP command */
    uint8_t isUniformBlockSize;     /*!&amp;lt; Sector/Block size is the same */
    uint8_t isDataOrderSwapped;     /*!&amp;lt; Data order (D0, D1, D2, D3) is swapped (D1,D0, D3, D2) */
    uint8_t reserved0[1];           /*!&amp;lt; Reserved for future use */
    uint8_t serialNorType;          /*!&amp;lt; Serial NOR Flash type: 0/1/2/3 */
    uint8_t needExitNoCmdMode;      /*!&amp;lt; Need to exit NoCmd mode before other IP command */
    uint8_t halfClkForNonReadCmd;   /*!&amp;lt; Half the Serial Clock for non-read command: true/false */
    uint8_t needRestoreNoCmdMode;   /*!&amp;lt; Need to Restore NoCmd mode after IP commmand execution */
    uint32_t blockSize;             /*!&amp;lt; Block size */
    uint32_t reserve2[11];          /*!&amp;lt; Reserved for future use */
} flexspi_nor_config_t;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently I learned that at least the LUT isn’t automatically written into the hardware when you call the ROM init function (see &lt;A href="https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2091563#M5150" target="_self"&gt;https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2091563#M5150&lt;/A&gt;). As a result, everything works only after I manually update the LUT in the peripheral.&lt;/P&gt;&lt;P&gt;Could you please clarify:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Which additional steps must I perform by hand before or after calling &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ROM_FLEXSPI_NORFlash_Init&lt;/STRONG&gt;()&lt;/FONT&gt;?&lt;/LI&gt;&lt;LI&gt;Do I need to configure the FlexSPI controller registers myself—even though the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt;&lt;/STRONG&gt; provides all the necessary fields for this?&lt;/LI&gt;&lt;LI&gt;Are there other configuration commands or ROM API calls that should be executed to apply all of the settings in &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt;&lt;/STRONG&gt;?&lt;/LI&gt;&lt;LI&gt;What should the field configure or communicate to the driver &lt;FONT face="courier new,courier"&gt;flexspi_nor_config.&lt;STRONG&gt;ipcmdSerialClkFreq&lt;/STRONG&gt;&lt;/FONT&gt;?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2025 15:42:47 GMT</pubDate>
    <dc:creator>mastupristi</dc:creator>
    <dc:date>2025-05-08T15:42:47Z</dc:date>
    <item>
      <title>Complete FlexSPI Configuration with ROM_FLEXSPI_NORFlash_Init</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2093734#M5154</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m using the ROM API function &lt;FONT face="courier new,courier"&gt;ROM_FLEXSPI_NORFlash_Init()&lt;/FONT&gt; to initialize my QSPI NOR flash, and I pass in a pointer to a &lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt; instance built from these underlying structures:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/*! @brief FLEXSPI Memory Configuration Block */
typedef struct _flexspi_mem_config
{
    uint32_t tag;       /*!&amp;lt; [0x000-0x003] Tag, fixed value 0x42464346UL */
    uint32_t version;   /*!&amp;lt; [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix */
    uint32_t reserved0; /*!&amp;lt; [0x008-0x00b] Reserved for future use */
    uint8_t readSampleClkSrc;    /*!&amp;lt; [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3 */
    uint8_t csHoldTime;          /*!&amp;lt; [0x00d-0x00d] Data hold time, default value: 3 */
    uint8_t csSetupTime;         /*!&amp;lt; [0x00e-0x00e] Date setup time, default value: 3 */
    uint8_t columnAddressWidth;  /*!&amp;lt; [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
                                                    Serial NAND, need to refer to datasheet */
    uint8_t deviceModeCfgEnable; /*!&amp;lt; [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable */
    uint8_t deviceModeType; /*!&amp;lt; [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
                                               Generic configuration, etc. */
    uint16_t waitTimeCfgCommands;    /*!&amp;lt; [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
                                                        DPI/QPI/OPI switch or reset command */
    flexspi_lut_seq_t deviceModeSeq; /*!&amp;lt; [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
                                                        sequence number, [31:16] Reserved */
    uint32_t deviceModeArg;          /*!&amp;lt; [0x018-0x01b] Argument/Parameter for device configuration */
    uint8_t configCmdEnable;         /*!&amp;lt; [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable */
    uint8_t configModeType[3];       /*!&amp;lt; [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe */
    flexspi_lut_seq_t
        configCmdSeqs[3]; /*!&amp;lt; [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq */
    uint32_t reserved1;   /*!&amp;lt; [0x02c-0x02f] Reserved for future use */
    uint32_t configCmdArgs[3];     /*!&amp;lt; [0x030-0x03b] Arguments/Parameters for device Configuration commands */
    uint32_t reserved2;            /*!&amp;lt; [0x03c-0x03f] Reserved for future use */
    uint32_t controllerMiscOption; /*!&amp;lt; [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
                                      details */
    uint8_t deviceType;            /*!&amp;lt; [0x044-0x044] Device Type:  See Flash Type Definition for more details */
    uint8_t sflashPadType; /*!&amp;lt; [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal */
    uint8_t serialClkFreq; /*!&amp;lt; [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
                                              Chapter for more details */
    uint8_t
        lutCustomSeqEnable; /*!&amp;lt; [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
                                              be done using 1 LUT sequence, currently, only applicable to HyperFLASH */
    uint32_t reserved3[2];  /*!&amp;lt; [0x048-0x04f] Reserved for future use */
    uint32_t sflashA1Size;  /*!&amp;lt; [0x050-0x053] Size of Flash connected to A1 */
    uint32_t sflashA2Size;  /*!&amp;lt; [0x054-0x057] Size of Flash connected to A2 */
    uint32_t sflashB1Size;  /*!&amp;lt; [0x058-0x05b] Size of Flash connected to B1 */
    uint32_t sflashB2Size;  /*!&amp;lt; [0x05c-0x05f] Size of Flash connected to B2 */
    uint32_t csPadSettingOverride;       /*!&amp;lt; [0x060-0x063] CS pad setting override value */
    uint32_t sclkPadSettingOverride;     /*!&amp;lt; [0x064-0x067] SCK pad setting override value */
    uint32_t dataPadSettingOverride;     /*!&amp;lt; [0x068-0x06b] data pad setting override value */
    uint32_t dqsPadSettingOverride;      /*!&amp;lt; [0x06c-0x06f] DQS pad setting override value */
    uint32_t timeoutInMs;                /*!&amp;lt; [0x070-0x073] Timeout threshold for read status command */
    uint32_t commandInterval;            /*!&amp;lt; [0x074-0x077] CS deselect interval between two commands */
    flexspi_dll_time_t dataValidTime[2]; /*!&amp;lt; [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B */
    uint16_t busyOffset;                 /*!&amp;lt; [0x07c-0x07d] Busy offset, valid value: 0-31 */
    uint16_t busyBitPolarity; /*!&amp;lt; [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
                                                 busy flag is 0 when flash device is busy */
    uint32_t lookupTable[64]; /*!&amp;lt; [0x080-0x17f] Lookup table holds Flash command sequences */
    flexspi_lut_seq_t lutCustomSeq[12]; /*!&amp;lt; [0x180-0x1af] Customizable LUT Sequences */
    uint32_t reserved4[4];              /*!&amp;lt; [0x1b0-0x1bf] Reserved for future use */
} flexspi_mem_config_t;

/*! @brief  Serial NOR configuration block */
typedef struct _flexspi_nor_config
{
    flexspi_mem_config_t memConfig; /*!&amp;lt; Common memory configuration info via FLEXSPI */
    uint32_t pageSize;              /*!&amp;lt; Page size of Serial NOR */
    uint32_t sectorSize;            /*!&amp;lt; Sector size of Serial NOR */
    uint8_t ipcmdSerialClkFreq;     /*!&amp;lt; Clock frequency for IP command */
    uint8_t isUniformBlockSize;     /*!&amp;lt; Sector/Block size is the same */
    uint8_t isDataOrderSwapped;     /*!&amp;lt; Data order (D0, D1, D2, D3) is swapped (D1,D0, D3, D2) */
    uint8_t reserved0[1];           /*!&amp;lt; Reserved for future use */
    uint8_t serialNorType;          /*!&amp;lt; Serial NOR Flash type: 0/1/2/3 */
    uint8_t needExitNoCmdMode;      /*!&amp;lt; Need to exit NoCmd mode before other IP command */
    uint8_t halfClkForNonReadCmd;   /*!&amp;lt; Half the Serial Clock for non-read command: true/false */
    uint8_t needRestoreNoCmdMode;   /*!&amp;lt; Need to Restore NoCmd mode after IP commmand execution */
    uint32_t blockSize;             /*!&amp;lt; Block size */
    uint32_t reserve2[11];          /*!&amp;lt; Reserved for future use */
} flexspi_nor_config_t;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently I learned that at least the LUT isn’t automatically written into the hardware when you call the ROM init function (see &lt;A href="https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2091563#M5150" target="_self"&gt;https://community.nxp.com/t5/MCUXpresso-SDK/Getting-SFDP-parameters-from-QSPI-NOR-flash-using-ROMAPI/m-p/2091563#M5150&lt;/A&gt;). As a result, everything works only after I manually update the LUT in the peripheral.&lt;/P&gt;&lt;P&gt;Could you please clarify:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Which additional steps must I perform by hand before or after calling &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ROM_FLEXSPI_NORFlash_Init&lt;/STRONG&gt;()&lt;/FONT&gt;?&lt;/LI&gt;&lt;LI&gt;Do I need to configure the FlexSPI controller registers myself—even though the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt;&lt;/STRONG&gt; provides all the necessary fields for this?&lt;/LI&gt;&lt;LI&gt;Are there other configuration commands or ROM API calls that should be executed to apply all of the settings in &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;flexspi_nor_config_t&lt;/FONT&gt;&lt;/STRONG&gt;?&lt;/LI&gt;&lt;LI&gt;What should the field configure or communicate to the driver &lt;FONT face="courier new,courier"&gt;flexspi_nor_config.&lt;STRONG&gt;ipcmdSerialClkFreq&lt;/STRONG&gt;&lt;/FONT&gt;?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 15:42:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2093734#M5154</guid>
      <dc:creator>mastupristi</dc:creator>
      <dc:date>2025-05-08T15:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Complete FlexSPI Configuration with ROM_FLEXSPI_NORFlash_Init</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2095180#M5156</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 open this new thread!&lt;/P&gt;
&lt;P&gt;The issue is ROM related and I am checking with the internal team. I will sync with you once I get new developments. Please give me some time and thanks in advance!&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Gavin&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 06:13:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2095180#M5156</guid>
      <dc:creator>Gavin_Jia</dc:creator>
      <dc:date>2025-05-12T06:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Complete FlexSPI Configuration with ROM_FLEXSPI_NORFlash_Init</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2095322#M5157</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;After confirming with the internal team that this is a ROM limitation, the `ROM_FLEXSPI_NORFlash_Init` in the ROM API will only recognize and enable a few fixed location LUTs, including read\write\erase.&lt;/P&gt;
&lt;P&gt;Therefore, it is recommended to use `&lt;SPAN data-teams="true"&gt;ROM_FLEXSPI_NorFlash_UpdateLut`&lt;/SPAN&gt; for any other user-added commands in this ROMAPI project.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Gavin&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 08:32:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Complete-FlexSPI-Configuration-with-ROM-FLEXSPI-NORFlash-Init/m-p/2095322#M5157</guid>
      <dc:creator>Gavin_Jia</dc:creator>
      <dc:date>2025-05-12T08:32:10Z</dc:date>
    </item>
  </channel>
</rss>

