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

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

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

Jump to solution
1,942 Views
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

Labels (1)
Tags (2)
1 Solution
1,792 Views
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.
-------------------------------------------------------------------------------

View solution in original post

2 Replies
1,792 Views
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 Kudos
Reply
1,793 Views
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.
-------------------------------------------------------------------------------