RT1165 Boot From FlexSPI2A Flash (Custom Board)

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

RT1165 Boot From FlexSPI2A Flash (Custom Board)

1,587 Views
smitht_shure
Contributor II

Hello,

We've got a custom board with the RT1165 on it, as well as an SDRAM (IS42SM16320E-75BLI) and a QSPI Flash (IS25LP512M-RHLE).

The flash is connected to the FlexSPI2A pins.

We've burned no fuses, BOOT_MODE is set to 0x10. BOOT_CFG is 0b100000000001 . Both of these have jumpers / alternate pulls so I can change them if needed.

I have a J-Link Ultra+ connected to the MCU.

 

I've imported the Hello World example in MCUexpresso, and run it on the eval board (EVKMIMXRT1160) successfully. But I'm having trouble porting the example to our custom board. 

I've changed the MCU settings to point BOARD_FLASH to flex spi 2A:

smitht_shure_0-1670351604242.png

 

In evkmimxrt1160_flexspi_nor_config.c, I've changed the memConfig to the following:

smitht_shure_1-1670351668797.png

 

I've changed BOARD_FLASH_SIZE to 0x20000000U, and FLASH_BASE to FlexSPI2_AMBA_BASE.

 

When I debug, it seems to reach the ResetISR before hanging. When I pause debugging, it breaks at 0x223104. "Break at address "0x223104" with no debug information available, or outside of program code."

 

Not sure what I'm missing here, any tips very appreciated. Let me know if I can provide any more information too.

 

Thanks,

 

Tristan

 

 

0 Kudos
Reply
7 Replies

1,562 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @smitht_shure 

I hope you are doing great, thanks for your description. 

Could you let me know which specific FlexSPI2A pins are you using? 

To narrow down the issue, I propose two alternatives to first check communication of the MCU and the memory:

1 Run code that executes from SRAM and then proceeds to  read/write external flash on FlexSPI2.

  •  Import  flexspi_nor_polling_transfer.
  •  Link the demo to SRAM( Properties->C/C++ build->settings->Managed linker scrypt->Link application to RAM)
  •  Set FlexSPI2 for demo config,  and portA pins. 

 The demo should be able to discover the flash SFDP parameters, and  possible execute  read and write commands.

2   Test flash memory settings (use ROM bootloader and a image generation tool)

Use the  MCUboot Utitliy or the MCUXpresso Secure Provisioning Tool (SPT) With the SPT. Below some steps with the SPT

1   Set MCU into serial downloader mode. 

2 Open the SPT and do the below config. 

diego_charles_0-1670883567238.png

3 Edit memory settings and run the TEST option. This will invoke bootloader APIS and try to write that configuration on your flash memory.

diego_charles_1-1670883828642.png

Please let me know your results,

All the best, 

Diego

1,534 Views
smitht_shure
Contributor II

Hi Diego, thanks for your help. 

 

I tried the Secure Provisioning Tool and was able to successfully test the flash:

smitht_shure_0-1671054090195.png

 

However, I can't get flexspi_nor_polling_transfer to work. I see "Vendor ID: 0xff" in the debug console, and then it hangs at FLEXSPI_TransferBlocking:

smitht_shure_1-1671054168629.png

 

These are the FlexSPI2A pins I'm using:

smitht_shure_2-1671054187261.png

And I changed the app.h to match:

smitht_shure_3-1671054214686.png

 

 

Any idea what I'm missing with the example project?

 

Thanks,

 

Tristan

 

1,528 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @smitht_shure 

I am glad that you where able to successfully test the flash configuration with the SPT. Now,  lets review if we can boot an application : 

1 Take a plain image from the MCUboot Utility package  <>/NXP-MCUBootUtility-master\apps\NXP_MIMXRT1060-EVK_Rev.A1  for example : led_blinky_0x60002000

2 Build  and program that image with the SPT.

3 Select internal boot.

Let me know  your results, or if you have any issues. 

Regarding  the flexspi_nor_polling_transfer project setup : 

I can't tell if the FlexSPI2 A pins are setup correctly within the config tools. Are you linking all the project to SRAM?  In which function does  the program actually halts?

I have to say that I am more interested on checking if  you can boot an application, with the steps from the above point.

All the best, 

Diego.

0 Kudos
Reply

1,518 Views
smitht_shure
Contributor II

Hi Diego, thanks for the quick response -

I was able to build and write the image successfully with the SPT. I'm not sure how to verify that the image is running correctly - I don't have the same pin mux / LED / UART as the evk. 

Regarding the flexspi_nor_polling example, here are my pin assignments:

smitht_shure_0-1671121689730.png

 

I am linking the application to RAM. The program blocks when I step over "flexspi_nor_enable_quad_mode()." If I pause debugging, I can see that the I'm inside "FLEXSPI_ReadBlocking" waiting for a buffer to fill.

 

Thanks again,

Tristan

0 Kudos
Reply

1,476 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi  Tristan,

I am very sorry for the delayed response! Did you manage to get any further results on this?

Regarding :  I'm not sure how to verify that the image is running correctly.

the fastest thing for me is  by halting the CPU. Then check where is the program counter. If the app booted correctly it should be on 0x60xx_xxxx space. You should see that every instruction the PC changes, and it is not repeatedly on any bad place like where the hardfault handler is typically located.

I think that the MCU boot utility application should toggle a RT1160 EVK user LED1 or user LED2. With  the schematics of the EVK, you should see check which GPIO pins are connected to the user LEDs

diego_charles_0-1671141810988.png

Diego

 

0 Kudos
Reply

1,391 Views
smitht_shure
Contributor II

Hi Diego,

I was able to program the blinky image using SPT and then halt the MCU and see that I'm in the 0x6xx xxxx space. I can also see the LED1 pin toggling (no LED on our board).

I still can't get any of the demo projects to load onto the flash and execute from flash using MCUXpresso, but it seems like it's a project config issue and not a hardware issue at this point?

Thanks for your help,

Tristan

0 Kudos
Reply

1,339 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @smitht_shure 

Thanks for your reply and patience!

It is good to know that HW is able to work properly, as you mention this may be now related to SW.

I suggest the next steps :

  •  Use the SPT tool to generate the FCB binary (this is the "convert to FCB" button inside the flash memory "edit" window)
  •   Generate MCUxpresso project binary image (locate the generated .axf after compiling the image in the IDE, do a left click and use the option binary utilities to produce the binary)
  •   Locate the FCB in the project binary and compare it against the SPT one.
  •   Try to make both FCB match.

For inspecting and locating addresses in binary images I like to use https://hexed.it   , but you can use any other tool of your preference. Also refer to the FCB addresses on the reference manual.

Please let me know your results! If problems keep arising, please share me debugger console output.

Diego

 

 

 

 

0 Kudos
Reply