Is it possible to write data on EMC flash where code is running

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

Is it possible to write data on EMC flash where code is running

626 次查看
priyankb
Contributor III

Hi,

I am facing a problem regarding EMC Nor flash SST39VF3201C. I have my bootloader code on internal flash & user application on EMC nor flash. But when I try to write some data(variables) using LPCOpen APIs on a specific address far from code address it causes hard fault. I have initialized flash in bootloader & not(again) in user application. Code works fine & reading from an address is working too. Is there any solution for this.

Any help is appreciated.

Thank you.

Priyank.

标签 (3)
标记 (2)
1 回复

485 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Priyank,

If I understood correct, you want to write in the flash while you are executing also from flash, right? 

This is not possible, if you want to write in flash then you must be running from RAM. For example, you should move the specific functions that are writing on the flash to the RAM memory. I recommend you read the following community post to see how to do this. Relocating Code and Data Using the MCUXpresso IDE 

Hope it helps!

Victor.

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------