AnsweredAssumed Answered

How to flash and debug through QSPI RT1051

Question asked by Marcos Chiele on Mar 25, 2020
Latest reply on Mar 27, 2020 by Sabina Bruce

Hello all.

 

I have designed my own board with an RT1051 microcontroller. I am using an external XIP memory through Quad SPI.

The part number of the memory is MX25L6433FMI-08G.

 

When I try to flash and debug through SWD bus (I'm using a Universal Multilink PEMicro), something is going wrong.

It looks like it was programmed, but when I start debugging, the contents of the memory addresses do not match what should be programmed. You could check it in the picture below.

 

After the flash, the program is stopping on the main. However, when I click on start button to start the debug process, the program break on a specific address like picture below.

 

Important information about the parameters that I am using:

 

BOOT_MODE = 00

My eFuses are configurated like picture below (I am not using BOOT CFG by pins):

 

The memory areas are like that:

 

And finally, the XIP configuration is the code below:

const flexspi_nor_config_t hyperflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.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_4Pads,
.serialClkFreq = kFlexSpiSerialClk_100MHz,
.sflashA1Size = 8u * 1024u * 1024u,
// .dataValidTime = {16u, 16u},
.lookupTable =
{
// Read LUTs
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_DDR, 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,
};
#endif /* XIP_BOOT_HEADER_ENABLE */

 

So, guys, could I be missing some important step?

 

It's my first project using MCUExpress and RT1051 with external memory, so I'm a little lost.

 

Thanks in advance.

Outcomes