IVT Table for XIP image on Nor-Flash

cancel
Showing results for 
Search instead for 
Did you mean: 

IVT Table for XIP image on Nor-Flash

790 Views
kensu
Contributor V

Hi,

I want to check a simple concept,

pastedImage_1.png

My device is 1015RT, no need security boot, and run image on nor-flash.

In this condition, my binary is not need IVT table. Is it correct?

Because after MCUXpresso generate the binary file, I use MFGTool to download it, and the code will run successfully.

I think in this condition, there is no IVT or BD data in my binary.

Is my understanding correct?

Regards

Ken

Labels (1)
7 Replies

560 Views
t_thurgood
Contributor III

We are using the iMXRT1021 + flexspi NOR flash and the IVT offset in the bd files appears to contradict the RM.

In the IMXRT1020RM.pdf, page 244...

Boot Device Type                   Image Vector Table Offset             Initial Load Region Size
FlexSPI NOR/SEMC NOR         4 Kbyte = 0x1000 bytes                Entire Image Size

   and the NXP/IAR linker file (.icf) has...

define exported symbol m_boot_hdr_conf_start = 0x60000000;
define symbol m_boot_hdr_ivt_start = 0x60001000;
define symbol m_boot_hdr_boot_data_start = 0x60001020;
define symbol m_boot_hdr_dcd_data_start = 0x60001030;

However when using the manual serial download tools, i.e. elftosb which takes the .s19 output from the IAR builder/linker. The bd_files have...

imx-flexspinor-normal-unsigned.bd

options {
flags = 0x00;
startAddress = 0x60000000;
ivtOffset = 0x400;
initialLoadSize = 0x2000;

program_flexspinor_image_qspinor.bd

# The source block assign file name to identifiers
sources {
myBinFile = extern (0);
}

constants {
kAbsAddr_Start= 0x60000000;
kAbsAddr_Ivt = 0x60000400;
kAbsAddr_App = 0x60002000;
}

 

If those .bd files are edited to make the IVT = 0x1000 offset, then the elftosb fails...

Step 1 - create iMX format image files
1 file(s) copied.
Section: 0x0
Step 2 - create Kinetis format program files
failed to open source file: elftosb\img\ivt_output_xip_nopadding.bin (ignoring for now)
error: line 36: error opening source 'myBinFile'
Could Not Find C:\Projects\Hub2_Firmware_dev\Tools\Serial-Download\elftosb\img\ivt_output_xip_nopadding.bin
Step 3 - Attempting to program a Hermes...
Status (HAB mode) = 1450735702 (0x56787856) HAB disabled.
Reponse Status = 4042322160 (0xf0f0f0f0) HAB Success.
Preparing to send 60415 (0xebff) bytes to the target.
(1/1)1%Status (HAB mode) = 1450735702 (0x56787856) HAB disabled.
Reponse Status = 2290649224 (0x88888888) Write File complete.
Status (HAB mode) = 1450735702 (0x56787856) HAB disabled.
Step 4 - Now using 2nd stage bootloader...

Waiting for 0 seconds, press a key to continue ...
Ping responded in 1 attempt(s)
Inject command 'receive-sb-file'
Error: cannot open input data file 'elftosb\img\hermes_image.sb'

For the iMXRT1021, the IVT location should be 0x60001000.

Why do the bd files insist on 0x60000400 and fail to run if that is changed?

br,

Tony

0 Kudos

560 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Tony Thurgood,

  Where you get your .bd file, it is not correct, it is for the non-xip.

  Please download the RT1020 sdk from this link:

Welcome | MCUXpresso SDK Builder 

  Please check the .bd file from this folder:

SDK_2.7.0_EVK-MIMXRT1020\middleware\mcu-boot\bin\Tools\bd_file\imxrt102x

pastedImage_1.png

pastedImage_1.png

 

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos

560 Views
t_thurgood
Contributor III

Hi kerryzhou

Thanks for the information.

Our tools came from... Flashloader_RT1020_1.0_GA.

I have downloaded the latest SDK_2.7.0_EVK-MIMXRT1020-OM13588, there was a choice of OM or AGM. I'm not sure what the those letters signify?

Now using those unsigned bd files...

imx-flexspinor-normal-unsigned.bd

program_flexspinor_image_qspinor.bd

I ran the elftosb bat file and I get the same error previously mentioned...

Step 1 - create iMX format image files
1 file(s) copied.
Could Not Find C:\Projects\Hub2_Firmware_dev\Tools\Serial-Download\elftosb\img\hermes_image.sb
Section: 0x0
Step 2 - create Kinetis format program files
failed to open source file: elftosb\img\ivt_output_xip_nopadding.bin (ignoring for now)
error: line 62: error opening source 'myBinFile'
Could Not Find C:\Projects\Hub2_Firmware_dev\Tools\Serial-Download\elftosb\img\ivt_output_xip_nopadding.bin

So I still have this problem. I think early on in the project IVT=0x400 was used as a "fix".

How can I resolve this?

Is it something to do with the output file from IAR Workbench, is there a build setting that I need?

br,

Tony

0 Kudos

561 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Tony Thurgood,

  Could you please create your own question post?

  Then we can talk more detail in your own question post instead of talking under other's question post, thanks a lot for your understanding.

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos

561 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su ,

  No, to the complete bootable image in the external flash, IVT is the must item.

  You use the MCUXPresso IDE generate the code and didn't add the IVT header, you use the MFGTool download it, do you download the binary code or the sb code? If you use the sb, you should already add the IVT header files when you use the elftosb.

   You can do a external flash mass erase at first, then double test your app code again, if you use the MCUXPresso IDE download the code, you must select the XIP add the IVT data.

   No matter you use the IDE or the MFGTool download the code, if you have interest, you can readout your external flash, then check the 0X1000 offset data, you will find the IVT data.

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

561 Views
kensu
Contributor V

Hi Kerry

Thanks for your quick reply, you are correct.

Regards

Ken

0 Kudos

561 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ken Su,

  You are welcome!

   If you still have questions about this topic, just let me know.

   If your question is solved, please help me to mark the correct answer, just to close this question.

   Any new questions, welcome to create the new question post!

Wish it helps you!

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos