MKW21D256 Flash Operation interrupt disable

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

MKW21D256 Flash Operation interrupt disable

427 Views
roybenshlomo
Contributor I

Hi,

I am developing a system based on the MKW21D256 that implements a certain standard that requires pretty accurate baud rate, to achieve this I have implemented a timer that triggers an interrupt and there I toggle the correct pins etc.

My problem is when I would like to upgrade the system, at the beginning of the operation I want to erase the internal storage flash block (~96kB).

The problem is that it takes a lot of time to format this section and it is being done while under disabling all interrupts.

I tried splitting the erase of the entire block to smaller erases but each one is >5ms long and my timer interrupt interval is every 3.5ms.

Any idea how I can format the flash region without hurting the timing of the system? I want to be able to upgrade the device while still "In service" in terms of the protocol I am implementing.

Thanks,

Roy.

0 Kudos
1 Reply

339 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello roybenshlomo:

A possible workaround in your case would be to leave the timer interrupt enabled during flash programming. This requires that the interrupt vectors are copied to RAM and setting the SCB_VTOR register accordingly, and also the timer interrupt handler code itself must be in RAM. The procedure to place a function in RAM depends on the IDE/toolchain. In the appnote from the next link you can find some ideas:

http://cache.freescale.com/files/32bit/doc/app_note/AN4695


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos