Is FTFA_FSTAT->CCIF reliable as Flash available flag ?

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

Is FTFA_FSTAT->CCIF reliable as Flash available flag ?

772 Views
zixunli
Contributor I

Hi,

I'm using KM34Z256 with IAP support. Currently interrupts are disabled during IAP flash write/erase to ensure there is no collision error (IAP code itself is executed in RAM).

However I'd like to have some interrupts available during Flash read/write (for example USART and DMA), my approach is :

1.Copy vector table to RAM and modify SCB->VTOR

2.Define all interrupt handlers as ramfunc

3.Check CCIF in interrupt handler before access to flash resident functions.

__ramfunc void SysTick_Handler(void)
{
  msTicks++; /* increment counter necessary in Delay()*/
  if(FTFA->FSTAT & FTFA_FSTAT_CCIF_MASK)
  {
    /* Flash resident function */

   DoEvents();
  }
}

I want to know if CCIF flag is a reliable indicator of Flash available ?

Thanks,

Tags (2)
0 Kudos
Reply
1 Reply

659 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Dear Zixun Li,

Here's the description of the reference manual about this flag:

pastedImage_1.png

While a flash command is executing, the flag will stay low. So you can use it to check if there isn't a flash operation executing.

Best Regards,

Alexis Andalon

0 Kudos
Reply