Writing data in FlexNVM Data Flash Memory in MK22FX512AVLQ12

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

Writing data in FlexNVM Data Flash Memory in MK22FX512AVLQ12

跳至解决方案
865 次查看
vaibhavi_padwal
Contributor II
Hi, I am using MK22FX512AVLQ12 controller for my custom board design. The controller has 128KB of FlexNVM which I want to use as Data flash to store certain parameters only when a trigger is given. I also have 2 FTM timer interrupts, 2 UART interrupts, 2 DMA channel interrupts and 1 SPI interrupt in my code, but none of these interrupts use the FlexNVM data Flash. Should I disable any or all of the interrupts in my code before I Erase/Write/Read in the FlexNVM dataFlash? Please help in resolving the doubt. Thanks & Regards, Vaibhavi P
0 项奖励
1 解答
856 次查看
mjbcswitzerland
Specialist V

Hi

If you can be sure that there is no interrupt code that will try to access the data Flash when it is being written or erased there is no need to disable interrupts.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements

For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html

在原帖中查看解决方案

0 项奖励
4 回复数
857 次查看
mjbcswitzerland
Specialist V

Hi

If you can be sure that there is no interrupt code that will try to access the data Flash when it is being written or erased there is no need to disable interrupts.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements

For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html

0 项奖励
853 次查看
vaibhavi_padwal
Contributor II

Hi,

I am performing erase and write in one of the timer interrupts when I see that a particular GPIO has switched the state. In rest of the interrupts, there is no activity related to Data flash.

So can I be sure that all other interrupts are not using this Data Flash? As per my understanding, these interrupts would be using Program Flash and SRAM during their execution.

Also since I am performing the write operation in one the FTM timer interrupts itself, will it cause some problem?

Can you please confirm?

Thanks & Regards,

Vaibhavi P

0 项奖励
849 次查看
mjbcswitzerland
Specialist V

Hi

>>So can I be sure that all other interrupts are not using this Data Flash?

If you wrote the other interrupts code you will know whether they are accessing data flash or not. Very probably not and a naked interrupt won't be doing so.

 

>>Also since I am performing the write operation in one the FTM timer interrupts itself, will it cause some problem?

Flash operations take some time (eg. 200us for word write or several 10s of ms of sector erase) but the operation itself doesn't care whether called from an interrupt or not. The impact on blocking lower priority interrupts during slow operations is the thing to consider.

Regards

Mark

 

0 项奖励
846 次查看
vaibhavi_padwal
Contributor II

Thank you so much for your help!

0 项奖励