Imxrt boot mode not working

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

Imxrt boot mode not working

Jump to solution
8,527 Views
ancymuhammed
Contributor III

We are using mimxrt1176 and 512Mb NOR flash connected via flexspi for booting. Program flashed successful ly, but code is not executing. Flexspi lines are working during flashing, but clock signal not seen at the start of execution. But the same code is working in EVK. Checked the boot mode pins and it is set to 10 during execution. What may the possible reasons

0 Kudos
Reply
1 Solution
8,176 Views
ancymuhammed
Contributor III

 

While programming via SWD in MCUXpresso the following error occurs

 

ancymuhammed_0-1640696039441.png

 

View solution in original post

0 Kudos
Reply
38 Replies
3,135 Views
KenG
Contributor II

I am experiencing similar issue.  What was root cause?

0 Kudos
Reply
3,124 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @KenG ,

  If you meet any issues, please create your own question post, then we can help you in your own question post directly, thanks!

 

Best Regards,

kerry

0 Kudos
Reply
4,871 Views
ancymuhammed
Contributor III

The micro controller using in custom board is MIMXRT1176AVM8A

0 Kudos
Reply
4,868 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ancymuhammed 

Thanks for your updated information.

2.When you test the SDK code:

SDK_2_10_1_MIMXRT1170-EVK\boards\evkmimxrt1170\driver_examples\flexspi\nor\polling_transfer

Please modify the LUT table, as your QSPI is not the same as the EVK board, QE bit position also not the same, so I think your Quad mode is not enabled until now in your customer board.

kerryzhou_0-1640239304932.png

 

const uint32_t customLUT[CUSTOM_LUT_LENGTH] = {
/* Normal read mode -SDR */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x03, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18),
[4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL + 1] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

/* Fast read mode - SDR */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x0B, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18),
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST + 1] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_1PAD, 0x08, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04),

/* Fast read quad mode - SDR */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xEB, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 0x18),
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD + 1] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 0x06, kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04),

/* Read extend parameters */
[4 * NOR_CMD_LUT_SEQ_IDX_READSTATUS] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x81, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04),

/* Write Enable */
[4 * NOR_CMD_LUT_SEQ_IDX_WRITEENABLE] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x06, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

/* Erase Sector */
[4 * NOR_CMD_LUT_SEQ_IDX_ERASESECTOR] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0X20, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18),

/* Page Program - single mode */
[4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x02, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18),
[4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE + 1] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

/* Page Program - quad mode */
[4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x32, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18),
[4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD + 1] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

/* Read ID */
[4 * NOR_CMD_LUT_SEQ_IDX_READID] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x9F, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04),

/* Enable Quad mode */
[4 * NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0X31, kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x04),

/* Enter QPI mode */
[4 * NOR_CMD_LUT_SEQ_IDX_ENTERQPI] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x35, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

/* Exit QPI mode */
[4 * NOR_CMD_LUT_SEQ_IDX_EXITQPI] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_4PAD, 0xF5, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

/* Read status register */
[4 * NOR_CMD_LUT_SEQ_IDX_READSTATUSREG] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x05, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04),

/* Erase whole chip */
[4 * NOR_CMD_LUT_SEQ_IDX_ERASECHIP] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xC7, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),
};

app.h, modify

#define FLASH_QUAD_ENABLE 0x40

to 

#define FLASH_QUAD_ENABLE 0x02

Then test it again, whether your external QSPI flash, read, erase, write all works?

4. Internal boot mode 10 is not working. In EVK we cannot flash through serial downloader when switch is in 10 position, but in custom board we can flash successfully in 10 mode also

Answer: you can also use the serial download mode 01

Then use the MCUBOOTUTILITY to connect and program your board:

https://github.com/JayHeng/NXP-MCUBootUtility/archive/refs/tags/v3.4.0.zip
the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

kerryzhou_1-1640239798501.png

Please also try it, whether your connection, program works.

 

Any updated information, please kindly let me know.

Best Regards,

Kerry

 

0 Kudos
Reply
4,851 Views
ancymuhammed
Contributor III

Thanks for the reply.

But we have tried the NOR flash W25Q512NWEIM in the EVK and it is working fine.

0 Kudos
Reply
4,844 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ancymuhammed ,

   Yes, I know, when you do the successful operation in the EVK with W25Q512NWEIM , the flashloader may help you enable the QE, but your customer board still didn't work, and download is OK, so I suspect your QE is not enabled, as seems you didn't specially enable it. As you know, in the boot code, xip will use quad mode to read the code, if your QE bit is not set, the boot will have issues. And the QE bit is the non-volatile writeable bit, so to the new chip, you need to enable it at first.

  Two ways:

1. Use the SDK my mentioned code with the modification, download it to the RAM and run it, check the result, it also check your external QSPI works Ok or not with the flexSPI bus in the customer board.

2. Use my mentioned MCUBootUtility tool, download code in the serial download mode, with my pictures configuration.

Please test it on your side, in fact, it is easy to test.

Any updated information, just kindly let me know.

Best Regards,

kerry

0 Kudos
Reply
4,816 Views
ancymuhammed
Contributor III

1. Tried the flexspi communication and it is working fine.

What we have to do to work in the boot mode. FlexSPI communication seems to be OK

We will try using the utility tool also

0 Kudos
Reply
4,811 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ancymuhammed 

  Good, if you make sure the flexspi polling code works, erase, write, read all works, then you can download the led_blinky code, and test the boot directly.

  Yes, you also can try MCUbootutity tool in serial download mode to download the app code, the app code you even can use the tool's code directly:

NXP-MCUBootUtility-3.4.0\apps\NXP_MIMXRT1170-EVK_Rev.A\cm7\led_blinky_0x3000a000.srec

 

Best Regards,

Kerry

0 Kudos
Reply
4,782 Views
ancymuhammed
Contributor III

After flashing in customer board it is showing break at address 0x0 with no debug information available or outside of the program code

0 Kudos
Reply
4,755 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ancymuhammed 

  Which debugger you are using? CMSIS DAP or JLINK?

  Which IDE you are using? MCUXpresso, IAR, or MDK?

  Please give me your debug issue picture instead of just a description, thanks. As a different debugger, IDE, the situation is different.

 

Best Regards,

Kerry

0 Kudos
Reply
4,806 Views
ancymuhammed
Contributor III

After flashing in customer board it is showing break at address 0x0 with no debug information available or outside of the program code

0 Kudos
Reply
4,801 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  @ancymuhammed 

   Which debugger you are using?

   Please also give me your debug screenshot, I need to check it.

 

Best Regards,

Kerry

0 Kudos
Reply
4,807 Views
ancymuhammed
Contributor III

FlexSPI polling code works fine, erase, write & read is success, but led blinking code is flashing successfully, but not executing. We are using JTAG for debugging. 

0 Kudos
Reply
4,840 Views
ancymuhammed
Contributor III

Thank for the information.

 

I have the flash IS25WP512M-JLLE. Whether I can use it without any modification

0 Kudos
Reply
4,819 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ancymuhammed 

    You have test the winbond on the MIMXRT1170-EVK, right?

    Then, you remove the IS25WP128 which is in the MIMXRT1170-EVK board, I think you also can use that board's QSPI chip directly. 

    BTW, if you consider the voltage match issues, of course you can use IS25WP512M, no modification, just test the SDK directly.

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply
4,761 Views
ancymuhammed
Contributor III

I had checked with the same EVK memory. But the below error is observed. By searching in net it is found that the below error normally occurs due to less current. VDD_3V3 is provided by 3A source & SNVS_3V3 by 150 mA. 

ancymuhammed_0-1640324317380.png

 

0 Kudos
Reply
4,752 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  @ancymuhammed ,

  Don't test the internal boot mode, test the internal boot mode with MCUbootutility, whether you can do the connection, program, read memory?

you can also use the serial download mode 01

Then use the MCUBOOTUTILITY to connect and program your board:

https://github.com/JayHeng/NXP-MCUBootUtility/archive/refs/tags/v3.4.0.zip
the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

   Please also check the JTAG_MOD pin, it should connect to GND through 10k resistor:

kerryzhou_0-1640330318084.png

 

 

Best Regards,

kerry

0 Kudos
Reply
4,745 Views
ancymuhammed
Contributor III

We had tried the secure provisioning tool. Boot mode set to 01. But at the final stage of programming the following error is showing

### Erase memory before writing image ###
blhost -t 50279 -u 0x15A2,0x0073 -j -- flash-erase-region 0x30000000 27940 9
WARNING:MBOOT:Note: memoryId is not required when accessing mapped external memory
{
"command": "flash-erase-region",
"response": [],
"status": {
"description": "20106 (0x4e8a) FlexSPINOR: Command Failure.",
"value": 20106
}
}
blhost failed

0 Kudos
Reply
4,736 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ancymuhammed 

  Please help to check your flexspi DQS pin, this pin need to be float, do you set it as float?

kerryzhou_0-1640335103469.png

  In the previous time, you tell me the flexspi polling project can do the erase, write, read OK, but now, seems it still have issues, please use the MCUbootUtility tool test it, as that tool will be more clear.

 

Best Regards,

Kerry

 

0 Kudos
Reply
4,724 Views
ancymuhammed
Contributor III

We will try using MCUBootUtilitytool. 

 

The DQS pin is left open. In secure programming I had checked with the minimum frequency 30Mhz, still it is not working.

In the board in which EVK flash assembled the error occurs during writing time, but in Winbond writing will be succesful. But not working when we change the mode to 10. For writing serial downloader mode is selected 01

0 Kudos
Reply