copy image to ram and start

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

copy image to ram and start

Jump to solution
2,878 Views
rans
Senior Contributor I

Hello,

We start to use imxRT 1050, MCUExpresso, freeRTOS, with a memory unit for boot , not sure yet exactly which hyperFlash, qspi, or spi nor flash, (it shall be decided according to the answers), but it is required that the application shall copy itself to RAM and starts running from RAM.

  • Is it possible ?  Is it required that it shall be non-xip application only or can  it do the copy somehow in software from the flash memory to RAM ?

I read carefully AN12107, "How to Enable Boot from Octal SPI Flash and SD Card", yet still not sure: 

  • Which of the examples in the document refers to non-xip image ? 
  • Why example for "3.6. MFG boot from Hyper Flash with DCD for SDRAM" uses offset 0x400 (which is used for non-xip) ?

I see that linked file <name>.icf contains:

  1. interrupt_start/end
  2. text_start/end
  3. data_start/end
  4. data2_start/end

But it is not explained what the meaning of each of this values:

  • what's the difference between data_start and data2_start?
  • Where are these values writting inside IVT , for example there is "entry" in vit which I assume equals to text_start, but where is data_start and data2_start in IVT ?

Thank you,

ranran

1 Solution
2,253 Views
igorpadykov
NXP Employee
NXP Employee

Hi ranran

data_start/end,data2_start/end are described in icf files (like MIMXRT1052xxxxx_sdram.icf )

included in

Users Guide (4)
i.MXRT1050 EVK Extended Feature Example Code and HW guide
i.MX RT1050 MCU/Applications Crossover Processor | Arm® Cortex®-M7 @600 MHz, 512KB SRAM |NXP 

I do not think that "m_start_text  in icf = startaddress +ivtOffset +initialLoadSize", as it can be in any place

above startaddress +ivtOffset.

Best regards
igor

View solution in original post

0 Kudos
6 Replies
2,252 Views
igorpadykov
NXP Employee
NXP Employee

Hi ranran

for ram example one can look on

RT1050 - Booting from serial NOR flash to SDRAM 

>Why example for "3.6. MFG boot from Hyper Flash with DCD for SDRAM" uses

>offset 0x400 (which is used for non-xip) ?

please check Figure 8-14. Image Vector Table i.MX RT1050 Reference Manual
https://www.nxp.com/docs/en/reference-manual/IMXRT1050RM.pdf

So if "Dest.Memory" is the same as "Boot Device Memory", then it is xip, if different - then non-xip.

For IAR linked file <name>.icf structure description one can look at IAR documentation

http://supp.iar.com/FilesPublic/UPDINFO/011453/arm/doc/EWARM_DevelopmentGuide.ENU.pdf 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,253 Views
rans
Senior Contributor I

Hi,

>So if "Dest.Memory" is the same as "Boot Device Memory", then it is xip, if different - then non-xip.

But in the given example

RT1050 - Booting from serial NOR flash to SDRAM 

File imx-sdram-normal-unsigned-dcd.bd contains "ivtOffset = 0x1000;"

As I understand 0x1000 means it is xip , so "Dest.Memory" should be the same as "Boot Device Memory".

But it is not the same : boot from serialNOR to SDRAM.

How can it be ?

Best Regards,

ranran

0 Kudos
2,253 Views
igorpadykov
NXP Employee
NXP Employee

you should look for "boot_data" (absolute address where rom copies image)

sect.8.7.1.2 Boot data structure Reference Manual.

0x1000 means that this is "offset" described in Table 8-36. Image Vector Table Offset and Initial Load Region Size.

Best regards
igor

2,253 Views
rans
Senior Contributor I

Hello Igor,

Thank you very much for the information.

It seems, as far as I understand, that there is a mistake in AN12107.pdf :

In section 3.6 , .bd file in page 40 shows:

startaddress = 0x60000000

ivtOffset = 0x1000

initialLoadSize = 0x2000

--> I expects that m_start_text  in icf = startaddress +ivtOffset +initialLoadSize = 0x60003000 , but 

the icf file shows (step 3, page 37):

m_start_text = 0x60002400

Note that a similar example with icf file and bd file in section 3.5 shows icf file with m_start_text  value exactly as expected from the given .bd file in that section (I am using the same calculation : m_start_text  in icf = startaddress +ivtOffset +initialLoadSize).

Is it correct that there is a mistake with m_start_text   value  in .icf given in page 37 ?

Thank you very much for the time,

ranran

0 Kudos
2,254 Views
igorpadykov
NXP Employee
NXP Employee

Hi ranran

data_start/end,data2_start/end are described in icf files (like MIMXRT1052xxxxx_sdram.icf )

included in

Users Guide (4)
i.MXRT1050 EVK Extended Feature Example Code and HW guide
i.MX RT1050 MCU/Applications Crossover Processor | Arm® Cortex®-M7 @600 MHz, 512KB SRAM |NXP 

I do not think that "m_start_text  in icf = startaddress +ivtOffset +initialLoadSize", as it can be in any place

above startaddress +ivtOffset.

Best regards
igor

0 Kudos
2,253 Views
rans
Senior Contributor I

Hello Igor,

Where can I read how to set the values in bd file ? (startaddress ,ivtOffset ,initialLoadSize, etc)  It's not described in elftosb user guide.

Thank you,

ranran

0 Kudos