iMXRT1064 External Flash XIP Support

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

iMXRT1064 External Flash XIP Support

跳至解决方案
5,652 次查看
prashanthkk
Contributor II

Hi team,

We are having iMXRT1064 with 16MB External SPI Flash and also having 4MB Internal Flash.

As of now we are running Secondary bootloader and Application in Internal Flash. But now we want to run bootloader from Internal flash and  Application from External Flash.

So now we want to how to implement XIP on our bootloader to execute the Application from External flash.

Or any other approaches are available for this?

 

Best Regards,

Prashanth Kumar K

标签 (1)
0 项奖励
回复
1 解答
5,458 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Please check the attachment.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

在原帖中查看解决方案

15 回复数
5,636 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) Or any other approaches are available for this?
-- In my opinion, this scheme is feasible, firstly, you should generate an image file that links to the external QSPI, next, load the image file to the external QSPI, and it should initialize the external QSPI prior to the jump operation.
BTW, you can refer to the evkmimxrt1064_flexspi_nor_polling_transfer
to learn how to initialize the external QSPI.
Have a great day,
TIC

-------------------------------------------------------------------------------
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 项奖励
回复
5,632 次查看
prashanthkk
Contributor II

Hi Jeremyzhou,

We have loaded the application in external flash at memory 0x60xxxxxx. In bootloader we have done the same init sequence as "evkmimxrt1064_flexspi_nor_polling_transfer" in the program mentioned. then we point our application entry and vector table to external flash in the bootloader. But its not jumping to the external flash and not execute in place. 

We know that we can read the external flash application  to RAM from bootloader and then we run our application. But we don't want this approach.

if i can include xip header (FCB) in external flash application image. then what changes we have to do in bootloader to execute the application from external flash.

We are thinking we need some logic has to develop in bootloader to have XIP in external flash.

Thanks and Regards,

Prashanth Kumar K

0 项奖励
回复
5,607 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I was wondering if you can describe your testing environment and list the steps of testing, it can help me to figure out.
Have a great day,
TIC

-------------------------------------------------------------------------------
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 项奖励
回复
5,593 次查看
prashanthkk
Contributor II

Hi,

Step 1: We flashed the application in external flash at address 0x60400000 using the Jflash tool. (This application doesn't have fcb sections, only it contains IVT table and other general sections.)

In our application,  the linker file we pointed the address of external flash starts at 0x60400000.

First step in bootloader we just init the external flash (referred in flexspi_nor_polling_transfer.c), then

use the code to start our app from bootloader using the below code

#define VECTOR_ADDR 0x60400000

uint32_t appEntry = *(uint32_t*)(VECTOR_ADDR + 4u);
uint32_t appStack = *(uint32_t*)(VECTOR_ADDR);

static void (*jump_to_application)(void);
static uint32_t stack_pointer;

jump_to_application = (void (*)(void))appEntry;
stack_pointer = (uint32_t)appStack;

SCB->VTOR = VECTOR_ADDR;

__set_MSP(stack_pointer);
__set_PSP(stack_pointer);
PRINTF("\r\n Jumping to application \r\n");

jump_to_application();

But using the external flash application it doesn't booting, but if I flash the application in internal flash (qspi) and it gets booting up. For external flash we feel we need something to boot up in XIP mode. 

Note : our application linker file is just a simple one(no other sections)

For your i'm attaching the file here.

0 项奖励
回复
5,493 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I make it now, and I'd like to share the below experience.
1) The bootloader that resides in internal QSPI should initialize the external QSPI prior to jumping to.
2) The application should be programmed to correct the area in the external QSPI.
3) In the application, it should avoid initializing the FlexSPI1 that connects the external QSPI.

jeremyzhou_0-1639040030005.png


Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

 

5,477 次查看
prashanthkk
Contributor II

Hi,

Thank you very much for your kind support, if possible can you share your code please?

 

Thanks & Regards

Prashanth 

0 项奖励
回复
5,459 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Please check the attachment.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

5,450 次查看
prashanthkk
Contributor II

Thanks for your great help, we are able to boot up your led blink app, but if we boot our app then we are not able to get it up. then we noticed you have added the vectorTableRam linker section and function named "BOARD_RelocateVectorTableToRam(void)" and one more changes

//MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_RO, 0, 0, 1, 1, 0,ARM_MPU_REGION_SIZE_512MB);

could you please explain why we are doing relocating Vector table to RAM and from where we are relocating (internal flash or external flash)?

0 项奖励
回复
5,443 次查看
prashanthkk
Contributor II

Hi,

 

We now understood the problem in our application, we didn't disable clock for flexspi that's the problem.

Again thanks for your great help, 

 

Thanks & Regards

Prashanth.

标记 (1)
0 项奖励
回复
5,370 次查看
prashanthkk
Contributor II

Hi,

We are facing problem when we use the "evkmimxrt1064_littlevgl_guider" examples with the shared boot loader code. We also disabled the clock for external flash in the littlevgl_guider examples. But bootloader doesn't start the app.

Output log:

FLEXSPI example started!

Reset status reghister is 0x3
Vendor ID: 0x9d

FLEXSPI example started!

Reset status reghister is 0x3
Vendor ID: 0x9d

FLEXSPI example started!

Reset status reghister is 0x3
Vendor ID: 0x9d

FLEXSPI example started!

Reset status reghister is 0x3
Vendor ID: 0x9d

Could you please help us to proceed further? this only happens when lvgl is enabled.

0 项奖励
回复
5,309 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) Could you please help us to proceed further?
-- According to Reset status register indication, the reset is caused by CPU lockup, which root cause is encountering HardFault issue.
From my experience, I'd like to suggest you port the library to evkmimxrt1064_littlevgl_guider to figure out the line that triggers the HardFault issue.
Have a great day,
TIC

-------------------------------------------------------------------------------
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 项奖励
回复
5,570 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I was wondering if you can share the bin file of the application, further, please shows the steps of programming the bin file to the external QSPI via the Jflash tool.
Hope it helps.
Have a great day,
TIC

-------------------------------------------------------------------------------
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 项奖励
回复
5,563 次查看
prashanthkk
Contributor II

Hi Jeremyzhou,

I have attached sample Hello_world.bin and images included with steps of programming the bin file to the external QSPI via the Jflash tool.

Regards,

Prashanth Kumar K

0 项奖励
回复
5,549 次查看
prashanthkk
Contributor II

Hi,

Could you help us to configure custom LUT for XIP mode for the 'IS25WP064AJBLE' QSPI?

Do you think we are missing this part?

Note: We are using IMXRT1064 EVM External QSPI Flash (No Hardware Changes).

Regards,

Prashanth Kumar K 

0 项奖励
回复
5,514 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
1)Do you think we are missing this part?
-- No, I don't think so.
I'm still working on it.
TIC

-------------------------------------------------------------------------------
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 项奖励
回复