imx rt 1020 Nor Flash and freertos?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx rt 1020 Nor Flash and freertos?

ソリューションへジャンプ
1,009件の閲覧回数
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 解決策
1,003件の閲覧回数
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 返答(返信)
1,004件の閲覧回数
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.
-------------------------------------------------------------------------------

990件の閲覧回数
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 件の賞賛
返信