Can S32K3 Flash memory operation be changed to asynchronous operation

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

Can S32K3 Flash memory operation be changed to asynchronous operation

Jump to solution
2,572 Views
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 Kudos
Reply
1 Solution
2,556 Views
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.

View solution in original post

3 Replies
2,557 Views
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,545 Views
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 Kudos
Reply
2,526 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

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