IMX RT1052: Non XIP image stored on Hyperflash

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

IMX RT1052: Non XIP image stored on Hyperflash

4,660 Views
ulipe
Contributor II

Hi All,

I'm working on a proprietary second stage bootloader on IMX RT1052, but due to impossibility to write on Hyperflash at same time the my loader firmware executes on a another location, I decided to build my application to run entirely to run into RAM_OC region.

After read the Reference Manual (more specifically the bootloader section), it states the IMX RT internal bootloader supports the loading of a non XIP image, for example I can build my application to run on SRAM_OC and put it on Hyperflash, after a boot process the internal bootloader could find my application then places into SRAM_OC and jump to that.

The XIP image guidelines are pretty documented, but the non XIP image is not, there is no documentation and even code example on SDK.

So could you help me to find what is the guidelines for IVT header configuration to a non XIP image?

Glad for your help.

Felipe

Labels (1)
Tags (2)
0 Kudos
8 Replies

2,753 Views
jay_heng
NXP Employee
NXP Employee
0 Kudos

2,753 Views
ryanshuttlewort
Contributor IV

Hello all, I seem to have a non-XIP QSPI Flash image working for IAR.  Please see this post for details

2,753 Views
michaelwhite
Contributor II

Wigros,

I'm also trying to do this.  The document you appear to be quoting from (AN12107.pdf) does not seem to be using MCUExpresso IDE.  Do you have a similar set of instructions for MCUExpresso IDE?  Again, is it possible to use the on-board Hyperflash to store and load non-XIP code?  Step 2 in your instructions seems to imply this won't work for Hyperflash - if you don't change the vector table address for Hyperflash, then won't the vector table still be in Hyperflash?

Thanks.

0 Kudos

2,753 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Felipe,

   Please refer to booting from SD card !

-----------------------------------------------------------

Boot From SD Card (TF)

---Code in ITCM
---Data in DTCM
(internal RAM)


1.Open hello_world project with “Debug” configuration
2.Change the MIMXRT1052xxx6A_ram.icf, to start vector table from 0x00002000 (if Hyperflash, don't change)
3.Build project for elf hello_world.out
4.Use elftosb tool to generate image file
elftosb.exe -f imx -V -c ../../../example_bd_files/imx-itcm-unsigned.bd -o ivt_hello_world_tcm.bin hello_world.out
5.Use elftosb tool to generate .sb file for MFGTool, copy to “OS Firmware” folder
elftosb.exe -f kinetis -V -c ../../../example_bd_files/program_sdcard_image.bd -o boot_image.sb ivt_hello_world_tcm_nopadding.bin
6.EVK board boot switch SW7 set to 4-ON, others OFF
7.Power up EVK, connect USB device U9, insert TF card
8.Open MFGTool to download
9.Power off EVK, boot switch SW7 set to 1/3-ON, 2/4-OFF
10.Power up EVK and check hello world works

------------------------------------------------------------

Have a nice day!

TIC Weidong Sun

0 Kudos

2,753 Views
tsantzi
Contributor III

Hi all,

I am in the same situation. My final objective is to boot to ITCM and SDRAM (non-XIP) from QSPI flash. I decided to start by booting from SD to ITCM, which I achieved by following the instructions in AN12107.pdf, and also thanks to Yuri's additional input (https://community.nxp.com/message/998757?commentID=998757&et=watches.email.thread#comment-998757).

As a next step, I tried to non-xip from Hyperflash by adjusting the above, as suggested to the OP by Wigros in this thread. I substituted "program_flexspinor_image_hyperflash.bd" for "program_sdcard_image.bd", while still using "imx-itcm-unsigned.bd" and the "MIMXRT1052xxxxx_ram.icf" linker file. However, I have not as yet succeeded in configuring these files for hyperflash non-xip, in particular:

Vector table start address in "MIMXRT1052xxxxx_ram.icf" - Wigros' comment suggests that this should stay at 0x0000 for Hyperflash (unlike the SD case, where it had to be changed to 0x2000)? Is this also the case for QSPI?

startAddress in imx-itcm-unsigned.bd - Yuri's comment (in link above) seems to imply that this should be less than the vector table start address. However, if we leave the vector table at 0x0000, this would make startAddress also 0x0000, which goes against the comment in the .bd file (which states that startAddress should be non-zero). This also makes elftosb.exe crash with a segfault.

ivtOffset in same file - Does this stay at 0x400 since we're not XIP'ing?

"program_flexspinor_image_hyperflash.bd" - Should this be adjusted for flashing a non-xip image?

Any help is greatly appreciated,

Nikos

0 Kudos

2,753 Views
christiangradl
Contributor III

Hi,

i have the similar problems.

I'm using the EVK board with µVision Keil. I have dismounted the hyperflash and use the QSPI Flash.
My firmware can now read and program the qspi flash.
I have set boot pins to QSPI.
What are the steps to create qpsi image, so that my firmware starts from QSPI flash?
The documents AN12108.pdf and AN12107.pdf say to use elftosb.exe to get a "boot_image.sb" file.
In Keil µVision i changed my linker script file to "MIMXRT1052xxxxx_flexspi_nor.scf", recompiled my firmware, copied the AXF file to the elftosb directory and started the image process as described in the documents.

"elftosb.exe -f imx -V -c ../../bd_file/imx10xx/imx-flexspinor-normal-unsigned.bd -o ivt_shantal.bin shantal.axf"

=> Elftosb.exe crashes.

 

Then i changed the addresses in the Linkerscript file to 0x60002000, etc.

"elftosb.exe -f imx -V -c ../../bd_file/imx10xx/imx-flexspinor-normal-unsigned.bd -o ivt_shantal.bin shantal.axf"

 

ivt_shantal.bin and ivt_shantal_nopadding.bin are now in the directory

 

Then i executed

"elftosb.exe -f kinetis -V -c ../../bd_file/imx10xx/program_flexspinor_image_qspinor.bd -o boot_image.sb ivt_shantal_nopadding.bin"

 

I programmed the "boot_image.sb" into the QSPI flash with an programmer and switched the bootcfg to QSPI load.
But after power up nothing happened. I checked content of the QSPI flash, everything ok.

Do You Already Have the Solution to your Problem?

0 Kudos

2,753 Views
ryanshuttlewort
Contributor IV

Hello all, I'm trying to do something similar but I am trying to boot a RAM-based, non-XIP image from QSPI Flash (the IS25WP064 on the EVK).  Could someone please suggest the necessary steps?

Thanks.

0 Kudos

2,753 Views
ulipe
Contributor II

Hi Wigros, thanks for the fast response, I will use your suggestion then

get back with the

results.

Best

Felipe

2018-03-05 1:14 GMT-03:00 weidong.sun <admin@community.nxp.com>:

NXP Community

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

Re: IMX RT1052: Non XIP image stored on Hyperflash

reply from Wigros Sun

<https://community.nxp.com/people/weidong.sun?et=watches.email.thread> in *i.MX

Community* - View the full discussion

<https://community.nxp.com/message/992045?commentID=992045&et=watches.email.thread#comment-992045>

0 Kudos