环境: ESP8266-12F 1MB flash, FTOA版本, SDK:esp_iot_sdk_v1.5.0_15_11_27
现象: 准备自定义升级时,操作FLASH会导致系统重启, 如下:
程序模块:
#define FIRMWARE_START_0_SEC 0x1 //start from second sector
#define FIRMWARE_START_1_SEC (0x80+0x1)
#define FIRMWARE_MAX_SIZE_SECS 0x78 //480KB
void ICACHE_FLASH_ATTR at_exeCmdCiUpTest(uint8_t id)
{
int i=0, status;
for(i=0; i<FIRMWARE_MAX_SIZE_SECS; i++)
{
status = spi_flash_erase_sector(FIRMWARE_START_1_SEC+i);
if (status != SPI_FLASH_RESULT_OK)
at_port_print("e");
else
at_port_print(".");
}
at_port_print("done!\n");
}
at_funcationType at_custom_cmd[] = {
{"+UPTEST", 7, NULL, NULL, NULL, at_exeCmdCiUpTest}
};
日志:
==============================================================================
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
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: 8Mbit(512KB+512KB)
jump to run user1 @ 1000
don't use rtc mem data
AT+UPTEST
.........................................
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
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: 8Mbit(512KB+512KB)
jump to run user1 @ 1000
[SOLVED]自定义升级时,擦除FLASH导致系统重启
Re: 自定义升级时,擦除FLASH导致系统重启
Postby ESP_Faye » Mon Dec 07, 2015 4:50 pm
您好,
请勿使用 for 循环长时间占用 CPU,这将影响底层无法喂狗,导致看门狗复位。
AT 实现升级功能,您可以参考文档示例 http://bbs.espressif.com/viewtopic.php?f=51&t=732。
感谢您对 ESP8266 的关注!
请勿使用 for 循环长时间占用 CPU,这将影响底层无法喂狗,导致看门狗复位。
AT 实现升级功能,您可以参考文档示例 http://bbs.espressif.com/viewtopic.php?f=51&t=732。
感谢您对 ESP8266 的关注!
Who is online
Users browsing this forum: No registered users and 137 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.