mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
Disable interrupt during FTFC operation
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
89bd6ab74a
commit
b4b7710c63
@@ -77,6 +77,13 @@ static uint32_t execute_ftfc_command(void)
|
||||
uint8_t regval;
|
||||
uint32_t retval;
|
||||
|
||||
/* AN12003: only one FlexNVM operation can be executed at a time.
|
||||
* Disable ISR during this time so an ISR doesn't cause a hardfault
|
||||
* from a simultaneous read.
|
||||
*/
|
||||
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
/* Clear CCIF to launch command */
|
||||
|
||||
regval = getreg8(S32K1XX_FTFC_FSTAT);
|
||||
@@ -87,6 +94,8 @@ static uint32_t execute_ftfc_command(void)
|
||||
|
||||
retval = getreg8(S32K1XX_FTFC_FSTAT);
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
||||
if (retval & (FTTC_FSTAT_MGSTAT0 | FTTC_FSTAT_FPVIOL |
|
||||
FTTC_FSTAT_ACCERR | FTTC_FSTAT_RDCOLERR))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user