How to flash and debug through QSPI RT1051

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

How to flash and debug through QSPI RT1051

Jump to solution
1,844 Views
marcos_chiele
Contributor I

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.

pastedImage_1.png

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.

pastedImage_2.png

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):

pastedImage_3.png

The memory areas are like that:

pastedImage_4.png

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.

0 Kudos
1 Solution
1,713 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Marcos,

Hope you are doing well. 

While checking the information you have provided, the first thing that pops out at me is the driver chosen for the memory. Since you are using a different one than the one on our evaluation boards. You  can modify this to use the generic driver. 

pastedImage_1.png

If you click on it, three dots will appear that will open a drop down menu. If its through QuadSPI, please choose the generic option. 

pastedImage_2.png

Try this and let me know if this results differently for you. 

Best Regards,

Sabina

View solution in original post

0 Kudos
4 Replies
1,116 Views
brufecon
Contributor II

Hi @marcos_chiele !

How do you generate your code? You used some SDK example or you generated you project from zero with MCU Config Tools inside MCUXpresso? You used XIP folder and files? I tried to repeat your way, but was unsuccessfull.
Basically:
- Add flash in MCU Settings

- Add and configure files of XIP folder according my Winbond memory, and preprocessor tags (MCU Config Tools do not add XIP folder automatically)

- Adjust BOOT_CFG (I use res for pull up or down) and BOOT_MODE

- Adjust JLinkDevices.xml (https://mcuoneclipse.com/2019/10/27/using-segger-j-link-with-qspi-flash-on-nxp-i-mx-boards/)

The example pooling flash nor works fine. I think that is no hardware soldering or similar problem.
Any idea?

Thanks in advance.

Tags (3)
0 Kudos
1,713 Views
marcos_chiele
Contributor I

Hello Sabrina.

Actually, I had the same issue with the evaluation board (when I was using the specific driver).

However, yesterday I changed the driver to the generic driver (exactly the model that you suggested).

So, now it's working on demo board and on muy custom board too!

Thank you very much.

0 Kudos
1,713 Views
Sabina_Bruce
NXP Employee
NXP Employee

I'm glad that you were able to resolve this!

Please don't hesitate to contact us in the future for any other questions.

Have a great weekend.

Sabina

0 Kudos
1,714 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Marcos,

Hope you are doing well. 

While checking the information you have provided, the first thing that pops out at me is the driver chosen for the memory. Since you are using a different one than the one on our evaluation boards. You  can modify this to use the generic driver. 

pastedImage_1.png

If you click on it, three dots will appear that will open a drop down menu. If its through QuadSPI, please choose the generic option. 

pastedImage_2.png

Try this and let me know if this results differently for you. 

Best Regards,

Sabina

0 Kudos