ESP8266 Developer Zone The Official ESP8266 Forum 2015-02-13T14:57:52+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=150 2015-02-13T14:57:52+08:00 2015-02-13T14:57:52+08:00 https://bbs.espressif.com:443/viewtopic.php?t=150&p=712#p712 <![CDATA[Re: Timer interrupt during spi_flash causes crash]]> In my project all code was in Flash by default, so I had to explicitly move it to IRAM.
Also check all functions called from your ISR. And I had a (c++) function declared as inline which the compiler didn't inline but placed in flash instead.

Statistics: Posted by joostn — Fri Feb 13, 2015 2:57 pm


]]>
2015-02-12T10:18:12+08:00 2015-02-12T10:18:12+08:00 https://bbs.espressif.com:443/viewtopic.php?t=150&p=693#p693 <![CDATA[Re: Timer interrupt during spi_flash causes crash]]>
joostn wrote:
Ah! Thanks, I'll check my code.

Do you have resolved this bug?

I just delete the ICACHE_FLASH_ATTR,but it still remains.

Statistics: Posted by younger — Thu Feb 12, 2015 10:18 am


]]>
2015-01-27T17:40:12+08:00 2015-01-27T17:40:12+08:00 https://bbs.espressif.com:443/viewtopic.php?t=150&p=580#p580 <![CDATA[Re: Timer interrupt during spi_flash causes crash]]> Statistics: Posted by joostn — Tue Jan 27, 2015 5:40 pm


]]>
2015-01-27T15:57:21+08:00 2015-01-27T15:57:21+08:00 https://bbs.espressif.com:443/viewtopic.php?t=150&p=576#p576 <![CDATA[Re: Timer interrupt during spi_flash causes crash]]> spi_flash_xxxx apis will firstly disable cache, then enable cache.
so if your isr codes use ICACHE_FLASH_ATTR, it will crash, because cache is disabled when interrupt occur.
Pls don't use ICACHE_FLASH_ATTR in any functions isr calls and isr self.

Statistics: Posted by jackon — Tue Jan 27, 2015 3:57 pm


]]>
2015-01-22T21:29:53+08:00 2015-01-22T21:29:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=150&p=538#p538 <![CDATA[Timer interrupt during spi_flash causes crash]]>
I'm using a timer interrupt on Timer1:

Code:

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:

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.

Statistics: Posted by joostn — Thu Jan 22, 2015 9:29 pm


]]>