imx rt 1020 Nor Flash and freertos?

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

imx rt 1020 Nor Flash and freertos?

跳至解决方案
813 次查看
bp1979
Senior Contributor I

Hi,

I have an imx rt 1020 evk board which has external flash. The external flash does not support RWW. So I have learned to put my code in RAM to prevent reading from flash (executing program code) while writing to flash (erasing/programming).

This went fine, until I started to integrate my prototype in my actual application, which runs in a freertos environment. 

Now I can make a simple test which consists of the following steps:

- initialize flash,

- erase a sector

- program some bytes

When I execute this test sequence before the freertos scheduler starts, all is good.

But, when I run this test sequence in a task, I get guaranteed hardfaults. I guess the reason is that while erasing/programming task switches happen, thus code gets executed which is stored in flash and boom, I'm screwed.

What is the best way to cope with this? I have 64K of ITC memory, but my application is 120K in debug (and still 80K in release build). So I am not really able to store my entire app in flash.

Can you please advise how to deal with this?

many thanks.

0 项奖励
回复
1 解答
807 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'd like to suggest you implement critical section protection for a variety of flash operations.
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 回复数
808 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'd like to suggest you implement critical section protection for a variety of flash operations.
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.
-------------------------------------------------------------------------------

794 次查看
bp1979
Senior Contributor I

I thought it would be a bit drastic to disable interrupts during erasing, but it works perfectly. Thanks, simple and works like a charm

0 项奖励
回复