How to partition an external NOR flash for LittleFS and CODE in a IMXRT1062

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

How to partition an external NOR flash for LittleFS and CODE in a IMXRT1062

跳至解决方案
3,107 次查看
patriciocohen
Contributor IV

Hi,

In my custom board I'm using an external NOR Flash connected to FLEXSPI1.
I need to partition this external flash, so it can contain code and also a filesystem. I'm using FreeRTOS and the filesystem is LittleFS.

I have seen some posts that a solution is to execute code from RAM, but this is not possible in my case. I need to be able to run code from flash and use it as filesystem storage as well.

Please give directions on how to do it. At the moment I'm getting hard faults.

1) Do I need to create a partition in MCU Settings?

2) How to configure the MPU in this case?

Is there and example available that shares external NOR flash between code and filesystem?

Thank you,

Patricio

 

 

0 项奖励
回复
1 解答
3,041 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @patriciocohen ,

You can move erase and program function code to SRAM. When it is executing, disable all interrupt and stay in SRAM. The flexspi demo in SDK works in this way.

Or you can use two spi flash.

 

Regards,

Jing

在原帖中查看解决方案

3 回复数
3,066 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @patriciocohen ,

It's very hard to XIP while littlefs access nor flash. LittleFS access NOR flash in IP command mode(write, erase), XIP read flash on AHB bus. This will certainly cause conflict.

 

Regards,

Jing

0 项奖励
回复
3,056 次查看
patriciocohen
Contributor IV

Hi @jingpan 

Thanks for your reply.

Is there a way to do this that you can think of?

Best regards,

Patricio 

 

0 项奖励
回复
3,042 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @patriciocohen ,

You can move erase and program function code to SRAM. When it is executing, disable all interrupt and stay in SRAM. The flexspi demo in SDK works in this way.

Or you can use two spi flash.

 

Regards,

Jing