I'm using a timer interrupt on Timer1:
Code: Select all
ETS_FRC_TIMER1_INTR_ATTACH(...);
TM1_EDGE_INT_ENABLE();
ETS_FRC1_INTR_ENABLE();
running every millisecond or so.
If I do a flash erase/flash write at the same time:
Code: Select all
spi_flash_erase_sector(...);
spi_flash_write(...);
the ESP seems to crash and reboot if a timer interrupt occurs during the flash access.
Of course this can be worked around by disabling interrupts whenever I access flash. But I'm having similar problems if I start the timer interrupt already in user_init(): the esp will reboot if I do so. Only if I enable the timer interrupt after the ESP has connected to a wifi network things work fine. I'm guessing this is caused by the same problem: the firmware reads stored configuration data from flash pages 7c-7f. Unfortunately I'm not able to disable interrupts temporarily while this happens, because it happens inside your SDK code.