LPC54018 persistent variable storage in single SPI Flash across power cycles

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

LPC54018 persistent variable storage in single SPI Flash across power cycles

2,873 次查看
mitchkapa
Contributor III
Hi,
 
I'm using an LPC54S018 microcontroller with a single 16 MB SPIFI flash.  The application code is too large to fit into RAM and so I am using the XIP_IMAGE flag during compile.  I need to store variables in the flash for access across power cycles.  I have been following the steps listed in this forum post:
 
but I can't modify the "test" variable once the code is running, because it is read-only.  Is there a way to make the test variable read/write, and able to be saved across power cycles?
 
Thanks for your help,
Mitch
0 项奖励
回复
5 回复数

2,869 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @mitchkapa 

There is XIP demo under SDK demo, you can have a look:

Alice_Yang_0-1675930047424.png

 

 

BR

Alice

0 项奖励
回复

2,855 次查看
mitchkapa
Contributor III

Hi, Alice, thanks for your reply but I am afraid that demo isn't helpful for us.  We are currently able to do XIP but our problem is specifically that we cannot do an Erase/Write within another partition of the same physical flash while we are XIP from that same flash part.

I am now exploring if we can execute our code from Board SDRAM which will then allow us to manipulate the SPI Flash while in application.

0 项奖励
回复

2,835 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @mitchkapa 

 

How about "lpcxpresso54s018_spifi_polling_transfer"?

 

BR

Alice

0 项奖励
回复

2,828 次查看
mitchkapa
Contributor III

I think this example does cover some of what we need to accomplish.  However, our code is too large to fit into SRAMX.  I think we need to be able to execute from Board_SDRAM.  Is there any example code available for that?

I found document AN12423 but I haven't had success trying to follow it yet.  Possibly because of section 2.3 of that document.  It was unclear to me exactly where those code changes for the MPU needed to be made.

0 项奖励
回复

2,808 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @mitchkapa 

About  MPU  configuration, please refer to <Arm®v7-M Architecture Reference Manual> -> B3.5.7 MPU Region Number Register, MPU_RNR, you can download from Arm website, I also attached it for you.

 

BR

Alice

 

0 项奖励
回复