QSPI Flash RT1050 failure

cancel
Showing results for 
Search instead for 
Did you mean: 

QSPI Flash RT1050 failure

Jump to solution
1,363 Views
Contributor IV

Dear,

I'm working on a project with the NXP i.MXRT1050 family MIMXRT1052DVL6B processor. For preliminary testing I'm using the MIMXRT1050-EVK development kit. For the initial tests we are using the SDX provided by NXP. The Kit has 3 types of flash memory (Hyperflash, QSPI and SD card), the default boot being done by Hyperflash, just as the SDK examples are also configured to work with Hyperflash memory. In the kit Hyperflash memory shares pins with QSPI memory and these cannot be used simultaneously.

As my goal is to use QSPI memory, I removed Hyperflah memory from the kit, and used the hello_word (from SDK) example to work with QSPI memory, and I encounter driver error (image below).

pastedImage_1.png

Following I set up the same project (hello_word_ as images below and was able to write it in the kit, enter debug mode, but MCUXpresso can not execute the lines of code.

pastedImage_7.png

pastedImage_8.png

pastedImage_9.png

pastedImage_3.png

After using these settings, the errors below occurs.

pastedImage_10.png

pastedImage_2.png

pastedImage_6.png

I ask for help in understanding and solving this problem.

From now, my sincere thanks.

Rubens Júnior.

Tags (2)
1 Solution
44 Views
NXP TechSupport
NXP TechSupport

Hi Rubens Junior,

You totally don't need to remove the on board hyper flash, you just need to modify the resistor to make the qspi work.

Now please follow my way to do it again, I already make it work on both the MCUxpresso IDE and the IAR.
Please still use the board which already modify the on board resistor: USE QSPI FLASH(Mount R153~R158, DNP R356,R361~R366)
1. Change the on board opensda firmware to DAPLink v0244 - Supports onboard spi-flash
  1)download k20dx_mimxrt1050_evk_qspi_if_crc_20180419.zip from this link:
     https://www.nxp.com/assets/downloads/data/en/initialization-boot-device-driver-code-generation/k20dx...
    unzip it, you will get this .bin file:k20dx_mimxrt1050_evk_qspi_if_crc.bin
  2) power off the board by unplug the usb cable
  3) press the SW4 button and hold on it, then plug the usb cable, you can find a device named as "MAINTENANCE".
     Then release the SW4 button.
  4) send k20dx_mimxrt1050_evk_qspi_if_crc.bin to "MAINTENANCE", and want the sending finished.
  5) power off the board, then plug the usb cable to J28 again, wait a moment, you will find a device named as "RT150-EVK"
  until now, the on board debugger is changed the qspi compatible firmware, you can use the CMSIS DAP to debug the code now.
2. Modify the code, let's take the iled_blinky as an example
  1) import iled_blinky code to MCUXpresso IDE, you can find this project in folder:
   SDK_2.5.0_EVKB-IMXRT1050\boards\evkbimxrt1050\demo_apps\led_blinky
  2) change the flash Driver to :MIMXRT1050-EVK_IS25WP064A.cfx
  3) Modify this code, this is the most important part, which I forget to tell you in the last email
    Open evkbimxrt1050_flexspi_nor_config.c in project folder xip.
    Please comment these code:
 /*
const flexspi_nor_config_t hyperflash_config = {
    .memConfig =
        {
            .tag = FLEXSPI_CFG_BLK_TAG,
            .version = FLEXSPI_CFG_BLK_VERSION,
            .readSampleClkSrc = kFlexSPIReadSampleClk_ExternalInputFromDqsPad,
            .csHoldTime = 3u,
            .csSetupTime = 3u,
            .columnAddressWidth = 3u,
            // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
            .controllerMiscOption =
                (1u << kFlexSpiMiscOffset_DdrModeEnable) | (1u << kFlexSpiMiscOffset_WordAddressableEnable) |
                (1u << kFlexSpiMiscOffset_SafeConfigFreqEnable) | (1u << kFlexSpiMiscOffset_DiffClkEnable),
            .sflashPadType = kSerialFlash_8Pads,
            .serialClkFreq = kFlexSpiSerialClk_133MHz,
            .sflashA1Size = 64u * 1024u * 1024u,
            .dataValidTime = {16u, 16u},
            .lookupTable =
                {
                    // Read LUTs
                    FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18),
                    FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06),
                    FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
                },
        },
    .pageSize = 512u,
    .sectorSize = 256u * 1024u,
    .blockSize = 256u * 1024u,
    .isUniformBlockSize = true,
};
*/
Then add these code:
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,
            // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
            .sflashPadType = kSerialFlash_4Pads,
            .serialClkFreq = kFlexSpiSerialClk_100MHz,
            .sflashA1Size = 8u * 1024u * 1024u,
            .lookupTable =
                {
                    // Read LUTs
                    FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
                    FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
                },
        },
    .pageSize = 256u,
    .sectorSize = 4u * 1024u,
    .blockSize = 256u * 1024u,
    .isUniformBlockSize = false,
};

  4)Save the code, and build the project.

3. Download the code to the RT1050 board.

  You can refer to these application note:

https://www.nxp.com/docs/en/nxp/application-notes/AN12183.pdf 

https://www.nxp.com/docs/en/application-note/AN12108.pdf

Configure SW7:1 OFF, 2 OFF, 3 ON, 4 OFF

Then download the code again, it should works OK.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

8 Replies
44 Views
Contributor IV

This might be a red herring, but I followed kerryzhou‌ and amwilhite@indesign-llc.com‌'s advice and it still didn't work for me.

Then I tried the MIMXRT1050_SFDP_QSPI.cfx driver instead of the MIMXRT1050-EVK_IS25WP064A.cfx driver and that worked. However now I've switched back to the MIMXRT1050-EVK_IS25WP064A.cfx driver and my code still works... Does anyone know why that may have helped? Could the memory have gotten into some sort of unstable state and the more generic driver made it recover?

44 Views
NXP TechSupport
NXP TechSupport

Hi Luke Marvin,

   When you meet the can't download problems, you also can try to do the external chip mass erase at first, then you download it again should works.

   BTW, you also can use our MCUBootUtility tool to download the code in the serial download mode.

   You can find MCUBootUtility  tool from this link:

https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v2.0.0 

The related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

44 Views
Contributor III

For others who may experience the 0xA8 error, it appears that the root cause of the error for me was inadequate power. After connecting a 5VDC adapter to the board and switching the J1 jumper to pins 1 and 2, I was able to successfully program and line step with both the on-board CMISIS-DAP probe (after re-programming it with the Quad-SPI-compatible firmware) and an external J-Link (after editing the JLinkDevices.xml file).

44 Views
NXP TechSupport
NXP TechSupport

Hi Austin Wilhite,

   Thanks a lot for your experience sharing!

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

44 Views
NXP TechSupport
NXP TechSupport

BTW, MIMXRT1050-EVK is the old board, it's better to use MIMXRT1050-EVKB board.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

44 Views
Contributor IV

Hi Kerry Zhou,

Thank you very much! Your answer help me solve the problem of running the project in the kit EVKRT1050. I am very grateful! 

Now I need to run the project on my board, which was based on the RT1050 wiring diagram, but the error below occurs. I can burn the project to my board, but I can't run it.

The difference between the RT1050 Kit wiring diagram and my wiring diagram is that my scheme does not have the SW7 (boot selection) switch and my card has only QSPI memory, ie it has neither Hyperflash memory nor SD card memory.

You believe this may be a limitation, or if not, you understand the solution to this problem.

I thank you very much for your attention to me.

Rubens Júnior

pastedImage_1.png

0 Kudos
44 Views
NXP TechSupport
NXP TechSupport

Hi Rubens Junior,

   You are welcome, and that's very good to hear it works on your side.

   Normally, one case to one question topic.

   If your own board have the debug problem, could you create a new question post, it's better to share your own board schematic, then we can help you to check it in details.

  You also can check your own boot pins and the boot config pins, if the boot pin configuration is not correct, than your own boot maybe failed.

   If you create the new question post,  and still want I to provide service for you, you can @Kerry zhou in your question post, thank you!

 

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

45 Views
NXP TechSupport
NXP TechSupport

Hi Rubens Junior,

You totally don't need to remove the on board hyper flash, you just need to modify the resistor to make the qspi work.

Now please follow my way to do it again, I already make it work on both the MCUxpresso IDE and the IAR.
Please still use the board which already modify the on board resistor: USE QSPI FLASH(Mount R153~R158, DNP R356,R361~R366)
1. Change the on board opensda firmware to DAPLink v0244 - Supports onboard spi-flash
  1)download k20dx_mimxrt1050_evk_qspi_if_crc_20180419.zip from this link:
     https://www.nxp.com/assets/downloads/data/en/initialization-boot-device-driver-code-generation/k20dx...
    unzip it, you will get this .bin file:k20dx_mimxrt1050_evk_qspi_if_crc.bin
  2) power off the board by unplug the usb cable
  3) press the SW4 button and hold on it, then plug the usb cable, you can find a device named as "MAINTENANCE".
     Then release the SW4 button.
  4) send k20dx_mimxrt1050_evk_qspi_if_crc.bin to "MAINTENANCE", and want the sending finished.
  5) power off the board, then plug the usb cable to J28 again, wait a moment, you will find a device named as "RT150-EVK"
  until now, the on board debugger is changed the qspi compatible firmware, you can use the CMSIS DAP to debug the code now.
2. Modify the code, let's take the iled_blinky as an example
  1) import iled_blinky code to MCUXpresso IDE, you can find this project in folder:
   SDK_2.5.0_EVKB-IMXRT1050\boards\evkbimxrt1050\demo_apps\led_blinky
  2) change the flash Driver to :MIMXRT1050-EVK_IS25WP064A.cfx
  3) Modify this code, this is the most important part, which I forget to tell you in the last email
    Open evkbimxrt1050_flexspi_nor_config.c in project folder xip.
    Please comment these code:
 /*
const flexspi_nor_config_t hyperflash_config = {
    .memConfig =
        {
            .tag = FLEXSPI_CFG_BLK_TAG,
            .version = FLEXSPI_CFG_BLK_VERSION,
            .readSampleClkSrc = kFlexSPIReadSampleClk_ExternalInputFromDqsPad,
            .csHoldTime = 3u,
            .csSetupTime = 3u,
            .columnAddressWidth = 3u,
            // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
            .controllerMiscOption =
                (1u << kFlexSpiMiscOffset_DdrModeEnable) | (1u << kFlexSpiMiscOffset_WordAddressableEnable) |
                (1u << kFlexSpiMiscOffset_SafeConfigFreqEnable) | (1u << kFlexSpiMiscOffset_DiffClkEnable),
            .sflashPadType = kSerialFlash_8Pads,
            .serialClkFreq = kFlexSpiSerialClk_133MHz,
            .sflashA1Size = 64u * 1024u * 1024u,
            .dataValidTime = {16u, 16u},
            .lookupTable =
                {
                    // Read LUTs
                    FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18),
                    FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06),
                    FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
                },
        },
    .pageSize = 512u,
    .sectorSize = 256u * 1024u,
    .blockSize = 256u * 1024u,
    .isUniformBlockSize = true,
};
*/
Then add these code:
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,
            // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
            .sflashPadType = kSerialFlash_4Pads,
            .serialClkFreq = kFlexSpiSerialClk_100MHz,
            .sflashA1Size = 8u * 1024u * 1024u,
            .lookupTable =
                {
                    // Read LUTs
                    FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
                    FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
                },
        },
    .pageSize = 256u,
    .sectorSize = 4u * 1024u,
    .blockSize = 256u * 1024u,
    .isUniformBlockSize = false,
};

  4)Save the code, and build the project.

3. Download the code to the RT1050 board.

  You can refer to these application note:

https://www.nxp.com/docs/en/nxp/application-notes/AN12183.pdf 

https://www.nxp.com/docs/en/application-note/AN12108.pdf

Configure SW7:1 OFF, 2 OFF, 3 ON, 4 OFF

Then download the code again, it should works OK.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post