Writing data in FlexNVM Data Flash Memory in MK22FX512AVLQ12

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Writing data in FlexNVM Data Flash Memory in MK22FX512AVLQ12

Jump to solution
840 Views
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 Kudos
1 Solution
831 Views
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

View solution in original post

0 Kudos
4 Replies
832 Views
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 Kudos
828 Views
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 Kudos
824 Views
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 Kudos
821 Views
vaibhavi_padwal
Contributor II

Thank you so much for your help!

0 Kudos