I am getting Fatal Exception quite often so can not use code in production. Looking forward to your help. This seems to be happening during spi_flash_erase_sector()
Fatal Exception Details
Fatal exception 0(IllegalInstructionCause):
epc1=0x40205f8a, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0
2nd boot version : 1.4(b1)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
Checked address in (epc1=0x40205f8a) in .s file and instruction is beqz.n at this address
Code: Select all
40205f82: 3109 s32i.n a0, a1, 12
if(SPI_FLASH_RESULT_OK != spi_flash_erase_sector(SWITCH_STATUS_SECTOR))
40205f84: f40901 l32r a0, 40202fa8 <system_get_checksum+0x34>
40205f87: 0000c0 callx0 a0
40205f8a: 328c beqz.n a2, 40205f91 <write_switchstatus_sector+0x19>
{
LOG(("ERROR: %s:%d\r\n",__FILE__,__LINE__));
return ERROR;
40205f8c: f27c movi.n a2, -1
40205f8e: 000946 j 40205fb7 <write_switchstatus_sector+0x3f>
}