But the chip reboot randomly in the loop.
Here is my code
#define COFFEE_START 0x200000UL
#define COFFEE_SECTOR_SIZE 0x1000UL
pp_soft_wdt_stop();
for(i = 0; i < COFFEE_SECTOR_COUNT; i++) {
printf("%d\n",i);
//clock_delay(100000UL);
while(SPI_FLASH_RESULT_OK!=spi_flash_erase_sector((uint16)((COFFEE_START/COFFEE_SECTOR_SIZE)+(i))));
}
pp_soft_wdt_restart();
And there is serial output
format: formatting file system, please wait...
0
1
2
3
4
5
6
7
8
Fatal exception (0):
epc1=0x40234d94, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Even I delay 100000us is not help. Sometime the sector number will up to 81.But total is 256.
So what is the problem