boot_header for qspi-flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

boot_header for qspi-flash

Jump to solution
1,687 Views
ThomasSC
Contributor III

Hello,

For production programming of the RT1061 I want to use the Segger flasher.
In order for the program to run from the external QSPI flash (IS25LP080D), the QE bit in the flash must be set.
Unfortunately, the QE bit cannot be set with the flasher.
Segger suggests a boot header (see file) for setting the QE bit, but the application no longer starts with it.

What needs to be changed?

Regards

Thomas

0 Kudos
1 Solution
1,566 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ThomasSC ,

  Sorry for my later reply, I already finished your mentioned testing.

  It works on my MIMXRT1060-EVK board, I disable the QE, and run the FCB with the QE enable.

  Please use my attached code:

  evkmimxrt1060_flexspi_nor_polling_transfer.zip used to disable the QE

  evkmimxrt1060_iled_blinky.zip: FCB is enable QE.

 Test step:

   1. Download the evkmimxrt1060_iled_blinky.zip.

   2. run  evkmimxrt1060_flexspi_nor_polling_transfer.zip in RAM, used to disable the QE.

kerryzhou_0-1683625276951.png

You can see QE is disabled.

Then, I run the led_blinky in the flash again. the QE is enabled again.

and the LED is blinking.

So, please try my code.

Best Regards,

Kerry

 

 

View solution in original post

6 Replies
1,629 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ThomasSC ,

   Please refer to this post:

https://community.nxp.com/t5/i-MX-RT/i-MX-RT1050-QSPI-NOR-boot-initially-fails/m-p/1056368

 In your app add the QE enable related code.

const flexspi_nor_config_t nor_spi_config = {
  .memConfig = {
    // ...
    .deviceModeCfgEnable = 1u,
    .deviceModeType = kDeviceConfigCmdType_QuadEnable,
    .deviceModeSeq = {
      .seqId = NOR_CMD_LUT_SEQ_IDX_WRITE_STATUS,
      .seqNum = 1u,
    },
    .deviceModeArg = 0x40, // set Bit6 (=QE, quad enable)
    // ...
    .lookupTable = {
      // ...
      /* 4 - WriteStatus */
      [NOR_CMD_LUT_SEQ_IDX_WRITE_STATUS*4+0] =
                      FLEXSPI_LUT_SEQ(CMD_SDR       , FLEXSPI_1PAD, 0x01, // WRSR
                                      WRITE_SDR     , FLEXSPI_1PAD, 0x01),
      // ...
    },
  },
};

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
1,622 Views
ThomasSC
Contributor III

Hello,

with the expansion of the boot header to set the QE bit, the application no longer starts.
The application only starts with deviceModeCfgEnable = 0.

#define NUM_CUSTOM_LUT_SEQ               2
#define NOR_CMD_LUT_SEQ_IDX_CUSTOM_WE    7
#define NOR_CMD_LUT_SEQ_IDX_CUSTOM_QE_EN 8

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_100MHz,
     .sflashA1Size         = 1u * 1024u * 1024u,
     .deviceModeCfgEnable  = 1,
     .deviceModeType = kDeviceConfigCmdType_QuadEnable,
     .waitTimeCfgCommands  = 10,
     .deviceModeSeq        = {
       NUM_CUSTOM_LUT_SEQ,
       NOR_CMD_LUT_SEQ_IDX_CUSTOM_WE,
      },
     .deviceModeArg = 0x40,     // set Bit6 (=QE, quad enable)
     .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),

          [4 * NOR_CMD_LUT_SEQ_IDX_CUSTOM_WE]    = FLEXSPI_LUT_SEQ(
                              CMD_SDR,   FLEXSPI_1PAD, 0x06,             
                              STOP,      FLEXSPI_1PAD, 0x00),   // Perform WE
          [4 * NOR_CMD_LUT_SEQ_IDX_CUSTOM_QE_EN] = FLEXSPI_LUT_SEQ(
                              CMD_SDR,   FLEXSPI_1PAD, 0x01, 
                              WRITE_SDR, FLEXSPI_1PAD, 0x01),   // WRSR
     },
   },
  .pageSize           = 256u,
  .sectorSize         = 4u * 1024u,
  .ipcmdSerialClkFreq = 1u,
  .blockSize          = 64u * 1024u,
  .isUniformBlockSize = false,
};

Regards,

Thomas

0 Kudos
1,620 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ThomasSC ,

   Thanks for your information.

  Do you also have the MIMXRT1060-EVK board or not? Can you also reproduce it?

   I will find time to double check it on my side.

Best Regards,

Kerry

0 Kudos
1,616 Views
ThomasSC
Contributor III

Hi Kerry,

Yes, I can reproduce this behavior using the MIMXRT1060-EVK board.

Regards,

Thomas

0 Kudos
1,567 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ThomasSC ,

  Sorry for my later reply, I already finished your mentioned testing.

  It works on my MIMXRT1060-EVK board, I disable the QE, and run the FCB with the QE enable.

  Please use my attached code:

  evkmimxrt1060_flexspi_nor_polling_transfer.zip used to disable the QE

  evkmimxrt1060_iled_blinky.zip: FCB is enable QE.

 Test step:

   1. Download the evkmimxrt1060_iled_blinky.zip.

   2. run  evkmimxrt1060_flexspi_nor_polling_transfer.zip in RAM, used to disable the QE.

kerryzhou_0-1683625276951.png

You can see QE is disabled.

Then, I run the led_blinky in the flash again. the QE is enabled again.

and the LED is blinking.

So, please try my code.

Best Regards,

Kerry

 

 

1,558 Views
ThomasSC
Contributor III

Hello Kerry,

with the boot header from your blinky demo, the QE bit is also set in my application and is now running properly!

Many thanks for your support!


Regards,

Thomas

0 Kudos