Hello,
We are developing an application for NXP RT1061 (custom board) and are experiencing some issues when it comes to debugging.
MCU: MIMXRT1061CVL5B
Flash: IS25LP032D
Debuger: JLink Plus
1. The JLink server seems to have problems halting the mcu after reset, when running and debugging from flash, hinting that we have faulty flash settings. (Flash configuration is appended at the end.)
This causes for example breakpoints in the beginning of main not to trigger. And possibly also other issues as described below.
Log from JLinkServer:
Received monitor command: reset
ResetTarget() start
Core did not halt on flash image verification. Assuming faulty flash settings.
Halting target manually.
ResetTarget() end
What causes this, do we have the wrong flash configuration?
2. We have no problem booting from the flash. However once a program is present in the flash the Jlink Debugger is unable to reprogram the flash. Could be related to issue 1 since if we insert a delay in the beginning of main it works. We have some units which we at the moment are unable to recover because of this.
We suspect that configuring the MPU or something similar to this prevent JLink from uploading its "Ram code" but we have not been able to confirm this. We have however tried to disable the MPU using JLink commander but have not been successful. The FlexRam module has default configuration (128k DTC, 128K ITC, 256K OC).
JLink Commander Log:
J-Link>exec EnableEraseAllFlashBanks
J-Link>erase
Without any given address range, Erase Chip will be executed
Erasing device...
****** Error: Failed to prepare RAMCode using RAM
Error while determining flash info (Bank @ 0x60000000)
ERROR: Erase returned with error code -1.
3. Starting a debug session takes a long time.
The time from when the program has been written to flash/ram and the triggering of the first breakpoint in main is long sometimes more than a minute. This could for some reason be a related to the application size since we do not experience this issue when running nxp's example applications. Our application is around 400k. This happens both if we execute from ram and flash.
We are using McuXpresso.
What could be causing this? Anything we can do to improve the debugging experience.
Thanks
/Björn
Flash config:
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,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_100MHz,
.sflashA1Size = 4u * 1024u * 1024u,
.lookupTable =
{
// 0 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),
0,0,
// 1 Read Status
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x81, READ_SDR, FLEXSPI_1PAD, 0x04),
0,0,0,
// 2 Reserved
0,0,0,0,
// 3 Write Enable
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0),
0,0,0,
// 4 Reserved
0,0,0,0,
// 5 Erase Sector
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD7, RADDR_SDR, FLEXSPI_1PAD, 0x18),
0,0,0,
// 6 Reserved
0,0,0,0,
// 7 Reserved
0,0,0,0,
// 8 Reserved
0,0,0,0,
// 9 Page Program
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x32, RADDR_SDR, FLEXSPI_1PAD, 0x18),
FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_4PAD, 0x04, STOP, FLEXSPI_1PAD, 0),
0,0,
// 10 Reserved
0,0,0,0,
// 11 Chip Erase
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xC7, STOP, FLEXSPI_1PAD, 0),
0,0,0,
// 12 Reserved
0,0,0,0,
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 64u * 1024u,
.isUniformBlockSize = false,
};