Can S32K3 Flash memory operation be changed to asynchronous operation

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

Can S32K3 Flash memory operation be changed to asynchronous operation

跳至解决方案
2,630 次查看
xudequn
Contributor II

I find the operation of flash memory is synchronous in AN13388. Can I change it to asynchronous?

The sample code in AN13388 is followed.

I don't want to wait for the MCRS[DONE].

Thank you.

 

tFLASH_STATUS FLASH_ExecSeq (register uint32_t mask)
{
register tFLASH_STATUS status;
FLASH->MCR |= mask; /* initiate sequence */
FLASH->MCR |= FLASH_MCR_EHV_MASK; /* enable high voltage */
while(!(FLASH->MCRS&FLASH_MCRS_DONE_MASK)); /* wait until MCRS[DONE]=1 */
FLASH->MCR &=~FLASH_MCR_EHV_MASK; /* disable high voltage */
status = FLASH_GetStatus(); /* read main interface status */
FLASH->MCR &=~mask; /* close sequence */
return status;
}

0 项奖励
回复
1 解答
2,614 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

MCRS[DONE] flag can be used for generating interrupt, so it can be used ansynchornously.

Ideally you could used FLS driver (part of RTD drivers pack) and it this driver works asynchronously by the default.

在原帖中查看解决方案

3 回复数
2,615 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

MCRS[DONE] flag can be used for generating interrupt, so it can be used ansynchornously.

Ideally you could used FLS driver (part of RTD drivers pack) and it this driver works asynchronously by the default.

2,603 次查看
xudequn
Contributor II

Thanks a lot.

And can I use a polling way to make it ansynchornous?

For example, I don't wait for the MCRS[DONE] in FLASH_ExecSeq, I just check the MCRS in main loop until the MCRS is done.

0 项奖励
回复
2,584 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

It is basically up to you - you can do it this way.