Is FTFA_FSTAT->CCIF reliable as Flash available flag ?

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

Is FTFA_FSTAT->CCIF reliable as Flash available flag ?

1,409 次查看
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,

标记 (2)
0 项奖励
回复
1 回复

1,296 次查看
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 项奖励
回复