Yessss! I succeeded!
FLEXSPI NOR example started!
Successfully init FLEXSPI serial NOR flash
HyperFlash Information:
Total program flash size: 8192 KB, Hex: (0x800000)
Program flash sector size: 4 KB, Hex: (0x1000)
Program flash page size: 256 B, Hex: (0x100)
Erasing serial NOR flash over FLEXSPI
Successfully erased one sector of NOR flash device 0x7ff000 -> 0x800000
Program a buffer to a page of NOR flash
Successfully programmed and verified location FLEXSPI memory 0x607ff000 -> 0x607ff100
End of FLEXSPI NOR Example!
In the following, I'll report what I modified in 1050 ROM API example project to make it working with QSPI Flash, instead of HyperFlash. In all the screenshots I'm going to post, left side is always MODIFIED code, right side is ORIGINAL EXAMPLE code.
First, I adjusted BOARD_FLASH_SIZE macro in board.h to reflect QSPI Flash total size:

Then I basically replaced evkbimxrt1050_flexspi_nor_config.h and evkbimxrt1050_flexspi_nor_config.c content with code from evkbimxrt1060_fsl_romapi example project; in evkbimxrt1050_flexspi_nor_config.h file, the only difference is the following:

while for evkbimxrt1050_flexspi_nor_config.c file basically EVERYTHING is different; in this case, let me just copy-paste modified file content:
/*
* Copyright 2021 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "evkbimxrt1050_flexspi_nor_config.h"
/* Component ID definition, used by tools. */
#ifndef FSL_COMPONENT_ID
#define FSL_COMPONENT_ID "platform.drivers.xip_board"
#endif
/*******************************************************************************
* Code
******************************************************************************/
#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
__attribute__((section(".boot_hdr.conf"), used))
#elif defined(__ICCARM__)
#pragma location = ".boot_hdr.conf"
#endif
const flexspi_nor_config_t qspiflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
.controllerMiscOption = (1u << kFlexSpiMiscOffset_SafeConfigFreqEnable),
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_120MHz,
.sflashA1Size = 8u * 1024u * 1024u,
.lookupTable =
{
// Read LUTs
[0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
[1] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
// Read Status LUTs
[4 * 1 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x04),
// Write Enable LUTs
[4 * 3 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0x0),
// Erase Sector LUTs
[4 * 5 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20, RADDR_SDR, FLEXSPI_1PAD, 0x18),
// Erase Block LUTs
[4 * 8 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8, RADDR_SDR, FLEXSPI_1PAD, 0x18),
// Page Program LUTs
[4 * 9 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02, RADDR_SDR, FLEXSPI_1PAD, 0x18),
[4 * 9 + 1] = FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
// Erase Chip LUTs
[4 * 11 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60, STOP, FLEXSPI_1PAD, 0x0),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.ipcmdSerialClkFreq = 1u,
.blockSize = 64u * 1024u,
.isUniformBlockSize = false,
};
#endif /* XIP_BOOT_HEADER_ENABLE */
In main source file (flexspi_romapi.c, don't ask me why NXP is not simply calling it main...) I commented out FLEXSPI_NorFlash_GetConfig() method because, as explained in my previous post, the idea is to read FLASH configuration from qspiflash_config instance already defined in evkbimxrt1050_flexspi_nor_config.c file:

[...]

I commented out everything related to local norConfig copy in main() method:

then, in each call involving norConfig pointer, I substituted it with (flexspi_nor_config_t*)&qspiflash_config. Let me post just some examples and not the entire code, you can do it by yourself easily:


Also local variables used for total FLASH size calculation etc. should take memory geometry information from qspiflash_config instead of norConfig:

and, more than this, qspiflash_config should be visible from main source file:

Last but not least, some macros related to memory geometry defined in main file (don't ask me why NXP is defining here and there macros reporting again and again always the same memory geometry information...) are no more necessary because related to FLEXSPI_NorFlash_GetConfig() method which we will not use anymore, but FLASH_PAGE_SIZE should be adapted because used by the sample code as read and write size:

That's it! Hope that my contribution will be appreciated, obviously thanks to @kerryzhou for giving some hint!