imx rt 1024 internal flash configure as RWW

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

imx rt 1024 internal flash configure as RWW

ソリューションへジャンプ
327件の閲覧回数
bp1979
Senior Contributor I

Hi,

I have a follow up question regarding this topic

https://community.nxp.com/t5/i-MX-RT/imx-rt-1024-internal-flash-configure-as-RWW/td-p/1584737

So we are using a part of flash as "eeprom" and we learned in previous question that we must run code in SRAM while operating flash (read/write/erase). Since we also run free rtos, we can have task switches while an operation in flash is pending. I think we'll run into hard faults when free rtos switches to a task executes code which runs from flash while for example we were busy with writing to flash.

Therefore, I put all "flash operations" (read/write/erase) in critical sections, so that I can guarantee that these actions are completely finished before allowing freertos to task switch.

This, is very annoying, because when a sector erase needs to be performed, free rtos will be "effectively dead" until the sector erase is done. During that time, my software is unable to respond to interrupts. Well, not all of them, some interrupts I also run in ITC sram (e.g. my RTC clock and some timers), but most of the application is temporary unresponsive due to these critical sections I set around the flash operation routines.

So my question is, do I *need* to do this? I think I am asking what the flash timing are. Lets say task 1 is active, and it needs to erase a sector on flash. What if I don't put a critical section around it, and allow free rtos to preempt the task, and "while flash is erasing a sector" freertos orchestrates a task switch (which already executes from flash). I guess this would hard fault? Is that correct? Are there alternatives possible that would prevent this hard fault, other then protecting the entire sector erase call with a critical section?

I hope you understand my somewhat poorly formulated question.

0 件の賞賛
1 解決策
310件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @bp1979 ,

I'm afraid hardfault can't avoid if you write while read the flash. RT1024 embeds a Winbond W25Q32JV serial NOR flash. Think about you send a erase command then read it immediately. Will the flash feedback good data?

If RWW is must, you can add another flash or eeprom.

 

Regards,

Jing

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
311件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @bp1979 ,

I'm afraid hardfault can't avoid if you write while read the flash. RT1024 embeds a Winbond W25Q32JV serial NOR flash. Think about you send a erase command then read it immediately. Will the flash feedback good data?

If RWW is must, you can add another flash or eeprom.

 

Regards,

Jing

0 件の賞賛
297件の閲覧回数
bp1979
Senior Contributor I
Hi @jingpan
Thanks for confirming. We have an additional flash, which we have a hard time getting it to work. We'll continue on that path.
0 件の賞賛