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.
-------------------------------------------------------------------------------