Hi,
I am erasing 1 1KB flash block and it did complete the erasing a little over 8ms as the datasheet stated. The 1KB block internal flash was erased. My question is writing the HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_ERASE; HWREG doesn't return to the firmware until 8ms later.
#define HWREG(x) (*((volatile uint32_t *)(x)))
The firmware has to kick the watchdog every 3ms and this HWREG(FLASH_FMC) is blocking for over 8ms.
I reviewed Tiva TM4C123BH6ZRB Microcontroller DATA SHEET and tried a couple options for FLASH_FCMISC but the result is the same. Here are my register settings:
CPU_RegisterWrite( FLASH_FCMISC, (FLASH_FCMISC_AMISC | FLASH_FCMISC_VOLTMISC | FLASH_FCMISC_ERMISC) );
CPU_RegisterWrite( FLASH_FMA, addr_ );
CPU_RegisterWrite( FLASH_FMC, (FLASH_FMC_WRKEY | FLASH_FMC_ERASE) );
My question is does this silicon actually blocks the erase function until it complete or I am missing something in the register configuration? My ultimate goal is sending the erase request and check the complete status may be once every ms or interrupt. Since I can poll FLASH_FMC, I assume that the erase function is non-blocking but it is blocking from my firmware point of view.
Please comment. Thanks.
Dennis