Can S32K3 Flash memory operation be changed to asynchronous operation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can S32K3 Flash memory operation be changed to asynchronous operation

ソリューションへジャンプ
2,561件の閲覧回数
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,545件の閲覧回数
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,546件の閲覧回数
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,534件の閲覧回数
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,515件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

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