I want use LVW interrupt to detect power off and save some data to eerpom(flexNVM), but the it can't into LVD_LVW_IRQHandler.
Set breakpoint in LVD_LVW_IRQHandler, in debug mode , power off MCU, the program can't run to breakpoint ;
Set breakpoint in HardFault_IRQHandler, in debug mode , power off MCU, the program also can't run to breakpoint ;




After power off the MCU, the +5V power can keep 1ms from 4V to 3V, why it can't work into interrupt?
Or how to store some status data at the power off ?
This is the configration LVW Interrupt code.
void low_voltage_warning_config(void)
{
pmc_low_volt_detect_config_t lvds_lvd_config;
pmc_low_volt_warning_config_t lvds_lvw_config;
lvds_lvd_config.enableInt = true ;
lvds_lvd_config.enableReset = false ;
lvds_lvw_config.enableInt = true ;
PMC_ConfigureLowVoltDetect(PMC, &lvds_lvd_config);
PMC_ConfigureLowVoltWarning(PMC, &lvds_lvw_config);
EnableIRQ(LVD_LVW_IRQn);
}
At the beginning of the program , set LVD_LVW_IRQn priority is 0.
NVIC_SetPriority( LVD_LVW_IRQn , 0);
void LVD_LVW_IRQHandler(void)
{
bool lvdf_status;
bool lvwf_status;
lvdf_status = PMC_GetLowVoltDetectFlag( PMC );
lvwf_status = PMC_GetLowVoltWarningFlag( PMC );
if( lvdf_status ) PMC_ClearLowVoltDetectFlag( PMC );
if( lvwf_status ) PMC_ClearLowVoltWarningFlag( PMC );
if( lvwf_status || lvdf_status )
{
flash_eeprom_write_4_byte( software_ver_address, 1101 );
}
PRINTF("MCU power low and system halt \r\n");
while(1);
}