Load instructions into RAM from external flash while executing in place (XIP) on IMXRT1062

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

Load instructions into RAM from external flash while executing in place (XIP) on IMXRT1062

跳至解决方案
1,469 次查看
ess1
Contributor I

Hello,

Me and my colleagues are developing a product using the IMXRT1062 MCU with external flash MX25UM51345G which we communicate with through OSPI. We've developed both a bootloader and an application and execute these using XIP.

We want to be able to flash a new application from the bootloader. To my understanding, we can't write or erase the flash while executing in place (XIP), is this correct?

If so, we need to load the bootloader instructions into RAM and run the program from there. Does anyone have any suggestions on how to do this?

I've attached the .icf file we use.

Best Regards

Eirik

标签 (1)
标记 (2)
1 解答
1,319 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Eirik Storesund,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) If so, we need to load the bootloader instructions into RAM and run the program from there. Does anyone have any suggestions on how to do this?
-- For RT1060, It's not necessary to make it run in the RAM actually, because RT1060 contain the ROM FlexSPI APIs which provide the driver function to implement the flash operations, such as erase and program. However, a flash operation shouldn't happen in the sector which is also occupied by the bootloader.

I've attached a demo project which illustrates how to call the ROM FlexSPI APIs, please check it.

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

在原帖中查看解决方案

2 回复数
1,319 次查看
ess1
Contributor I

Hi,

Thank you for your reply!

The attachment contained exactly what I needed. I copied bl_api.c/.h and flexspi_nor_flash.h to my project. 

The only editing I had to do was to set configOption.option0.U to match my external flash setting (which in my case is 0xC0403006).

Have a great day!

Eirik

0 项奖励
1,320 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Eirik Storesund,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) If so, we need to load the bootloader instructions into RAM and run the program from there. Does anyone have any suggestions on how to do this?
-- For RT1060, It's not necessary to make it run in the RAM actually, because RT1060 contain the ROM FlexSPI APIs which provide the driver function to implement the flash operations, such as erase and program. However, a flash operation shouldn't happen in the sector which is also occupied by the bootloader.

I've attached a demo project which illustrates how to call the ROM FlexSPI APIs, please check it.

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