diff --git a/cores/esp8266/core_esp8266_eboot_command.c b/cores/esp8266/core_esp8266_eboot_command.c index 60c92bf18..ee3ccb480 100644 --- a/cores/esp8266/core_esp8266_eboot_command.c +++ b/cores/esp8266/core_esp8266_eboot_command.c @@ -60,7 +60,7 @@ int eboot_command_read(struct eboot_command* cmd) } uint32_t crc32 = eboot_command_calculate_crc32(cmd); - if (cmd->magic & EBOOT_MAGIC_MASK != EBOOT_MAGIC || + if ((cmd->magic & EBOOT_MAGIC_MASK) != EBOOT_MAGIC || cmd->crc32 != crc32) { return 1; } diff --git a/cores/esp8266/core_esp8266_flash_utils.c b/cores/esp8266/core_esp8266_flash_utils.c index 6f8a34f41..0713998a6 100644 --- a/cores/esp8266/core_esp8266_flash_utils.c +++ b/cores/esp8266/core_esp8266_flash_utils.c @@ -28,7 +28,7 @@ int SPIEraseAreaEx(const uint32_t start, const uint32_t size) { - if (start & (FLASH_SECTOR_SIZE - 1) != 0) { + if ((start & (FLASH_SECTOR_SIZE - 1)) != 0) { return 1; } diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp index 16902b15c..b67543f8b 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -129,7 +129,7 @@ void user_init(void) { uart_div_modify(0, UART_CLK_FREQ / (74480)); system_rtc_mem_read(0, &resetInfo, sizeof(struct rst_info)); - if(resetInfo.reason == WDT_RST_FLAG || resetInfo.reason == EXCEPTION_RST_FLAG) { + if(resetInfo.reason == REASON_WDT_RST || resetInfo.reason == REASON_EXCEPTION_RST) { os_printf("Last Reset:\n - flag=%d\n - Fatal exception (%d):\n - epc1=0x%08x,epc2=0x%08x,epc3=0x%08x,excvaddr=0x%08x,depc=0x%08x\n", resetInfo.reason, resetInfo.exccause, resetInfo.epc1, resetInfo.epc2, resetInfo.epc3, resetInfo.excvaddr, resetInfo.depc); } struct rst_info info = { 0 }; diff --git a/cores/esp8266/spiffs/spiffs_config.h b/cores/esp8266/spiffs/spiffs_config.h index d59ac80b1..fa4bbd7b1 100644 --- a/cores/esp8266/spiffs/spiffs_config.h +++ b/cores/esp8266/spiffs/spiffs_config.h @@ -19,8 +19,8 @@ #define c_memset os_memset typedef signed short file_t; -typedef long int s32_t; -typedef long unsigned int u32_t; +typedef int32_t s32_t; +typedef uint32_t u32_t; typedef int16_t s16_t; typedef uint16_t u16_t; typedef int8_t s8_t; diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp index 3fd09dace..b589ef737 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp @@ -69,7 +69,7 @@ int ESP8266WiFiClass::begin(const char* ssid, const char *passphrase, int32_t ch mode(WIFI_STA); } - if(!ssid || strlen(ssid) > 31) { + if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) { // fail SSID to long or missing! return WL_CONNECT_FAILED; } @@ -178,7 +178,7 @@ void ESP8266WiFiClass::softAP(const char* ssid, const char* passphrase, int chan mode(WIFI_AP); } - if(!ssid || strlen(ssid) > 31) { + if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) { // fail SSID to long or missing! return; } diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp index 91f03bbc0..34f249637 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp @@ -25,6 +25,7 @@ #include "ESP8266WiFiMulti.h" #include +#include ESP8266WiFiMulti::ESP8266WiFiMulti() { } @@ -151,7 +152,7 @@ bool ESP8266WiFiMulti::APlistAdd(const char* ssid, const char *passphrase) { WifiAPlist_t newAP; - if(!ssid || strlen(ssid) > 31) { + if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) { // fail SSID to long or missing! return false; } @@ -161,21 +162,18 @@ bool ESP8266WiFiMulti::APlistAdd(const char* ssid, const char *passphrase) { return false; } - newAP.ssid = (char*) malloc((strlen(ssid) + 1)); + newAP.ssid = strdup(ssid); if(!newAP.ssid) { return false; } - strcpy(newAP.ssid, ssid); - if(passphrase && *passphrase != 0x00) { - newAP.passphrase = (char*) malloc((strlen(passphrase) + 1)); + newAP.passphrase = strdup(passphrase); if(!newAP.passphrase) { free(newAP.ssid); return false; } - strcpy(newAP.passphrase, passphrase); } APlist.push_back(newAP); diff --git a/platform.txt b/platform.txt index 2695115c2..fe41377ee 100644 --- a/platform.txt +++ b/platform.txt @@ -16,7 +16,7 @@ compiler.sdk.path={runtime.platform.path}/tools/sdk/ compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" compiler.c.cmd=xtensa-lx106-elf-gcc -compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=c99 +compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=c99 -pedantic compiler.S.cmd=xtensa-lx106-elf-gcc compiler.S.flags=-c -g -x assembler-with-cpp -MMD @@ -26,7 +26,7 @@ compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig compiler.cpp.cmd=xtensa-lx106-elf-g++ -compiler.cpp.flags=-c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD +compiler.cpp.flags=-c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -pedantic compiler.as.cmd=xtensa-lx106-elf-as diff --git a/tools/sdk/changelog.txt b/tools/sdk/changelog.txt index b3faa0773..185750669 100644 --- a/tools/sdk/changelog.txt +++ b/tools/sdk/changelog.txt @@ -1,3 +1,54 @@ +esp_iot_sdk_v1.1.1_15_06_05 Release Note +------------------------------------------- + +Resolved Issues(Bugs below are eligible for Bug Bounty Program): +1.Too short timer which set by os_arm_timer_us may cause crash. [Tommy] +2.Call os_malloc in low heap situation may cause crash. [MeneerThijs] +3.Memory leak issue when SSL connection fail. [孙新虎] + +Optimization: +1.Update JSON parser to handle with illegal parameter and illegal calling progress. +2.Add parameter of user_esp_platform_check_ip in user_websever.c which in IOT_Demo. +3.Update UART driver to solve the problem that if send data through UART while ESP8266 startup may cause UART invalid. +4.Update smartconfig to version 2.2, corresponding phone APP v0.3.2. And update the description and example of smartconfig_start in document "2C_ESP8266__Programming Guide" +5.Update code in iram to solve the problem that space for text is not enough. +6.Update PWM driver and provide libpwm.a in esp_iot_sdk, update PWM APIs in "2C_ESP8266__Programming Guide", more details in "Added APIs" below. +7.Revised issue that multicast may fail in ESP8266 softAP mode. +8.Update folder "driver",add folder "driver_lib" in \esp_iot_sdk\examples , add "hw_timer.c" about frc1 hardware timer. +9.Remove useless driver code in IOT_Demo +10.Update IOT_Demo to use the latest PWM driver in light demo. +11.Provide liblwip_536.a of which MSS size is 536 +12.Revised issue that boot may fail when 80Mhz SPI clock selected +13.Update esp_init_data_default.bin about RF option in \esp_iot_sdk\bin + +Added APIs: +1.PWM APIs: +Updated: pwm_init,add parameter to set PWM channel and GPIO pin +Added: +(1)get_pwm_version:get version information of PWM driver +(2)pwm_set_period:set PWM period +(3)pwm_get_period:get PWM period +Deleted: +(1)pwm_set_freq:set PWM frequency +(2)pwm_get_freq:get PWM frequency +2.Read/write flash with protection +(1)system_param_save_with_protect:write data into flash with backup protection +(2)system_param_load:read data which saved into flash with backup protection +3.system_get_rst_info:get information about current startup,it is a normal startup or watch dog reset +4.at_response:set AT response +5.at_register_response_func:register a callback for user-define AT response. +6.Update document "2C_ESP8266__Programming Guide" to add description of interrupt definition in ets_sys.h + +AT_v0.25 Release Note: +Note: For AT firmware to support FOTA, flash size need to be 1024KB or more than that. +Optimization: +1.Add parameter about UDP local port in command "AT+SAVETRANSLINK" + +Added AT command: +1.AT+CIPDINFO:set configuration whether show remote IP and remote port with “+IPD” or not + + + esp_iot_sdk_v1.1.0_15_05_27_p1 Release Note ------------------------------------------- diff --git a/tools/sdk/include/ets_sys.h b/tools/sdk/include/ets_sys.h index 8b118b341..c21826cbd 100644 --- a/tools/sdk/include/ets_sys.h +++ b/tools/sdk/include/ets_sys.h @@ -74,6 +74,9 @@ inline uint32_t ETS_INTR_PENDING(void) #define ETS_FRC_TIMER1_INTR_ATTACH(func, arg) \ ets_isr_attach(ETS_FRC_TIMER1_INUM, (int_handler_t)(func), (void *)(arg)) +#define ETS_FRC_TIMER1_NMI_INTR_ATTACH(func) \ + NmiTimSetFunc(func) + #define ETS_GPIO_INTR_ATTACH(func, arg) \ ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg)) diff --git a/tools/sdk/include/smartconfig.h b/tools/sdk/include/smartconfig.h index 4035ad39d..7b1ec90e1 100644 --- a/tools/sdk/include/smartconfig.h +++ b/tools/sdk/include/smartconfig.h @@ -24,5 +24,6 @@ typedef void (*sc_callback_t)(sc_status status, void *pdata); const char *smartconfig_get_version(void); bool smartconfig_start(sc_type type, sc_callback_t cb, ...); bool smartconfig_stop(void); +bool esptouch_set_timeout(uint8 time_s); //15s~255s, offset:45s #endif diff --git a/tools/sdk/include/user_interface.h b/tools/sdk/include/user_interface.h index 7c4706dc4..4e6dc34f7 100644 --- a/tools/sdk/include/user_interface.h +++ b/tools/sdk/include/user_interface.h @@ -23,11 +23,12 @@ #endif enum rst_reason { - DEFAULT_RST_FLAG = 0, - WDT_RST_FLAG = 1, - EXCEPTION_RST_FLAG = 2, - SOFT_RST_FLAG = 3, - DEEP_SLEEP_AWAKE_FLAG = 4 + REASON_DEFAULT_RST = 0, + REASON_WDT_RST = 1, + REASON_EXCEPTION_RST = 2, + REASON_SOFT_WDT_RST = 3, + REASON_SOFT_RESTART = 4, + REASON_DEEP_SLEEP_AWAKE = 5 }; struct rst_info { @@ -40,6 +41,8 @@ struct rst_info { uint32 depc; }; +struct rst_info* system_get_rst_info(void); + #define UPGRADE_FW_BIN1 0x00 #define UPGRADE_FW_BIN2 0x01 @@ -129,6 +132,9 @@ void system_phy_set_max_tpw(uint8 max_tpw); void system_phy_set_tpw_via_vdd33(uint16 vdd33); void system_phy_set_rfoption(uint8 option); +bool system_param_save_with_protect(uint16 start_sec, void *param, uint16 len); +bool system_param_load(uint16 start_sec, uint16 offset, void *param, uint16 len); + #define NULL_MODE 0x00 #define STATION_MODE 0x01 #define SOFTAP_MODE 0x02 diff --git a/tools/sdk/lib/libjson.a b/tools/sdk/lib/libjson.a index 5a889af73..e8fa9d8da 100644 Binary files a/tools/sdk/lib/libjson.a and b/tools/sdk/lib/libjson.a differ diff --git a/tools/sdk/lib/liblwip.a b/tools/sdk/lib/liblwip.a index b4304413a..a6c42f9e9 100644 Binary files a/tools/sdk/lib/liblwip.a and b/tools/sdk/lib/liblwip.a differ diff --git a/tools/sdk/lib/libmain.a b/tools/sdk/lib/libmain.a index ec7bb4cdf..90caec3de 100644 Binary files a/tools/sdk/lib/libmain.a and b/tools/sdk/lib/libmain.a differ diff --git a/tools/sdk/lib/libnet80211.a b/tools/sdk/lib/libnet80211.a index 0c634acfa..648852e52 100644 Binary files a/tools/sdk/lib/libnet80211.a and b/tools/sdk/lib/libnet80211.a differ diff --git a/tools/sdk/lib/libpp.a b/tools/sdk/lib/libpp.a index c2e844b54..e42233ab3 100644 Binary files a/tools/sdk/lib/libpp.a and b/tools/sdk/lib/libpp.a differ diff --git a/tools/sdk/lib/libsmartconfig.a b/tools/sdk/lib/libsmartconfig.a index b8feefc98..03f296fd9 100644 Binary files a/tools/sdk/lib/libsmartconfig.a and b/tools/sdk/lib/libsmartconfig.a differ diff --git a/tools/sdk/lib/libssl.a b/tools/sdk/lib/libssl.a index d68dc61bb..1608d8484 100644 Binary files a/tools/sdk/lib/libssl.a and b/tools/sdk/lib/libssl.a differ diff --git a/tools/sdk/lib/libupgrade.a b/tools/sdk/lib/libupgrade.a index 6eaebbd30..d0d2d5bda 100644 Binary files a/tools/sdk/lib/libupgrade.a and b/tools/sdk/lib/libupgrade.a differ diff --git a/tools/sdk/lib/libwpa.a b/tools/sdk/lib/libwpa.a index 39de3f001..c6f1bb620 100644 Binary files a/tools/sdk/lib/libwpa.a and b/tools/sdk/lib/libwpa.a differ diff --git a/tools/sdk/version b/tools/sdk/version index a64d2ed43..1aeff03a8 100644 --- a/tools/sdk/version +++ b/tools/sdk/version @@ -1 +1 @@ -1.1.0_15_05_27_p1 \ No newline at end of file +1.1.1_15_06_05 \ No newline at end of file