Skip to content

Update to SDK 1.5 (#1102) #1239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C" {
#include "user_interface.h"
#include "cont.h"
}
#define LOOP_TASK_PRIORITY 0
#define LOOP_TASK_PRIORITY 1
#define LOOP_QUEUE_SIZE 1

#define OPTIMISTIC_YIELD_TIME_US 16000
Expand Down Expand Up @@ -73,7 +73,7 @@ extern "C" void esp_yield() {
}

extern "C" void esp_schedule() {
system_os_post(LOOP_TASK_PRIORITY, 0, 0);
ets_post(LOOP_TASK_PRIORITY, 0, 0);
}

extern "C" void __yield() {
Expand Down Expand Up @@ -144,7 +144,7 @@ extern "C" void user_init(void) {

cont_init(&g_cont);

system_os_task(loop_task,
ets_task(loop_task,
LOOP_TASK_PRIORITY, g_loop_queue,
LOOP_QUEUE_SIZE);

Expand Down
7 changes: 7 additions & 0 deletions cores/esp8266/core_esp8266_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ static uint8_t phy_init_data[128] =
// force_freq_offset
// signed, unit is 8kHz
[113] = 0,

// rf_cal_use_flash
// 0: RF init no RF CAL, using all RF CAL data in flash, it takes about 2ms for RF init
// 1: RF init only do TX power control CAL, others using RF CAL data in flash , it takes about 20ms for RF init
// 2: RF init no RF CAL, using all RF CAL data in flash, it takes about 2ms for RF init (same as 0?!)
// 3: RF init do all RF CAL, it takes about 200ms for RF init
[114] = 2
};

extern int __real_register_chipv6_phy(uint8_t* init_data);
Expand Down
10 changes: 5 additions & 5 deletions libraries/ESP8266WiFi/src/lwip/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ typedef size_t mem_size_t;
* allow these defines to be overridden.
*/
#ifndef mem_free
#define mem_free vPortFree
#define mem_free(p) vPortFree(p, "", 0)
#endif
#ifndef mem_malloc
#define mem_malloc pvPortMalloc
#define mem_malloc(s) pvPortMalloc(s, "", 0)
#endif
#ifndef mem_calloc
#define mem_calloc pvPortCalloc
#define mem_calloc(s) pvPortCalloc(s, "", 0)
#endif
#ifndef mem_realloc
#define mem_realloc pvPortRealloc
#define mem_realloc(p, s) pvPortRealloc(p, s, "", 0)
#endif
#ifndef mem_zalloc
#define mem_zalloc pvPortZalloc
#define mem_zalloc(s) pvPortZalloc(s, "", 0)
#endif

#ifndef os_malloc
Expand Down
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ compiler.S.flags=-c -g -x assembler-with-cpp -MMD
compiler.c.elf.flags=-g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy

compiler.c.elf.cmd=xtensa-lx106-elf-gcc
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -laxtls
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig

compiler.cpp.cmd=xtensa-lx106-elf-g++
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections
Expand Down
80 changes: 80 additions & 0 deletions tools/sdk/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
esp_iot_sdk_v1.4.0_15_09_18 Release Note
----------------------------------------
Resolved Issues(Bugs below are eligible for Bug Bounty Program):
1.Espconn may fail to download big chunk of data(FOTA).
2.Invalid TCP data sent issue.
3.Fatal exceptions occur when change WiFi mode in WiFi scan callback.
4.WiFi compatibility problem of special network card.
5.Deep sleep may appear high current under certain circumstances.

Optimization:
1. Add a new method to check memory leaks (API : system_show_malloc).
2. Add print information when exception happens.
3. Resolve the problem of os_timer_disarm.
4. Optimize DHCP server, add API to set up the lease time of DHCP server. More details are in the “Added APIs”.
5. Add event “EVENT_STAMODE_DHCP_TIMEOUT” for the DHCP timeout handling mechanism.
6. Optimize handling of the reception of data and ZWP message.
7. Add new APIs to support SSL bidirectional authentication. More details are in the “Added APIs”.
8. Add new APIs to set up SSL certificates and encryption keys. API espconn_secure_set_default_certificate and espconn_secure_set_default_private_key should be called to set SSL certificate and secure key, if ESP8266 runs as SSL server. More details are in the “Added APIs”.
9. Optimize the process of FOTA (firmware upgrade through WiFi.
10. Optimize mDNS, and resolve the problem that in certain case the ESP8266 softAP can not work in the sta+AP mode.
11. Release mesh as a lib in the esp_iot_sdk, and do not provide SDK of the mesh version any more.
12. Optimize mesh’s handling of UDP packets.
13. Optimize checking of the validity of the mesh API’s parameters.
14. Add an API to set up the largest hop of mesh. For detailed information, go to mesh instructions.
15. Optimize the process of powering up and booting to shorten booting time by 20 ms.
16. Optimize the function of automatic frequency offset calibration.
17. Optimize the function of sniffer.
18. Strengthen reliability of the checking of beacon timeout.
19.Optimize Wi-Fi event mechanism, and add event “ EVENT_SOFTAPMODE_PROBEREQRECVED”, and reason for a failed connection.
20. Optimize Wi-Fi callback function and strengthen reliability of the software.
21. Add the function of data transferring between stations in the soft-AP mode.
22. Update SmartConfig to the version of 2.5.1.

23.Update esp_init_data_default.bin. Please use the newest esp_init_data_default.bin when burning.

24.Modify the espconn pointer in the receive callback of UDP. Parameters remote_ip and remote_port in it are the remote IP and port set by espconn_create. If users want to obtain IP and ports of the current sender, please call espconn_get_connection_info to get relevant information.


Added APIs:
1.System API
system_show_malloc : for checking memory leak, to print the memory usage.
2.DHCP server lease time related APIs
wifi_softap_set_dhcps_lease_time:set ESP8266 softAP DHCP server lease time.
wifi_softap_get_dhcps_lease_time:check ESP8266 softAP DHCP server lease time.
wifi_softap_reset_dhcps_lease_time:reset ESP8266 softAP DHCP server lease time which is 120 minutes by default.
3.wifi_station_dhcpc_set_maxtry:set the maximum number that ESP8266 station DHCP client will try to reconnect to the AP.
4.Force sleep APIs
wifi_fpm_open:enable force sleep function.
wifi_fpm_close:disable force sleep function.
wifi_fpm_do_sleep:force ESP8266 enter sleep mode.
wifi_fpm_do_wakeup:wake ESP8266 up from force sleep.
wifi_fpm_set_sleep_type:set sleep type of force sleep function.
wifi_fpm_get_sleep_type:get sleep type of force sleep function.
5.Send packet freedom APIs (to send user-define 802.11 packets)
wifi_register_send_pkt_freedom_cb:register a callback for sending user-define 802.11 packets.
wifi_unregister_send_pkt_freedom_cb:unregister the callback for sending user-define 802.11 packets.
wifi_send_pkt_freedom:send user-define 802.11 packet.
6.RFID LOCP APIs
wifi_rfid_locp_recv_open:enable RFID LOCP to receive WDS packets.
wifi_rfid_locp_recv_close:disable RFID LOCP.
wifi_register_rfid_locp_recv_cb:register a callback of receiving WDS packets.
wifi_unregister_rfid_locp_recv_cb:unregister the callback of receiving WDS packets.
7.Rate Control APIs
wifi_set_user_fixed_rate:set the fixed rate and mask of sending data from ESP8266
wifi_get_user_fixed_rate:check the fixed rate and mask of ESP8266
wifi_set_user_sup_rate:set the rate range supported by ESP8266 to limit the rate of sending packets from other devices.
wifi_set_user_rate_limit:limit the rate of sending data from ESP8266.
wifi_set_user_limit_rate_mask:set the interfaces of ESP8266 whose rate of sending packets is limited by wifi_set_user_rate_limit.
wifi_get_user_limit_rate_mask:get the interfaces of ESP8266 whose rate of sending packets is limited by wifi_set_user_rate_limit.
8.Espconn APIs
espconn_sendto:send UDP data.
espconn_secure_cert_req_enable:enable certificates verification function when ESP8266 runs as SSL client.
espconn_secure_cert_req_disable:disable certificates verification function when ESP8266 runs as SSL client.
espconn_secure_set_default_certificate:set the certificate when ESP8266 runs as SSL server.
espconn_secure_set_default_private_key:set the encryption key when ESP8266 runs as SSL server.
9.SmartConfig API
smartconfig_set_type: set the protocol type of SmartConfig.



esp_iot_sdk_v1.3.0_15_08_10_p1 Release Note
----------------------------------------

Expand Down
143 changes: 143 additions & 0 deletions tools/sdk/include/at_custom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@

/*
* custom_at.h
*
* This file is part of Espressif's AT+ command set program.
* Copyright (C) 2013 - 2016, Espressif Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of version 3 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CUSTOM_AT_H_
#define CUSTOM_AT_H_

#include "c_types.h"

typedef struct
{
char *at_cmdName;
int8_t at_cmdLen;
void (*at_testCmd)(uint8_t id);
void (*at_queryCmd)(uint8_t id);
void (*at_setupCmd)(uint8_t id, char *pPara);
void (*at_exeCmd)(uint8_t id);
}at_funcationType;

typedef void (*at_custom_uart_rx_intr)(uint8* data,int32 len);

typedef void (*at_custom_response_func_type)(const char *str);

extern uint8 at_customLinkMax;

/**
* @brief Response "OK" to uart.
* @param None
* @retval None
*/
void at_response_ok(void);
/**
* @brief Response "ERROR" to uart.
* @param None
* @retval None
*/
void at_response_error(void);
/**
* @brief Response string.
* It is equivalent to at_port_print,if not call at_register_response_func or call at_register_response_func(NULL);
* It will run custom response function,if call at_register_response_func and parameter is not NULL.
* @param string
* @retval None
*/
void at_response(const char *str);
/**
* @brief register custom response function.
* @param response_func: the function that will run when call at_response
* @retval None
*/
void at_register_response_func(at_custom_response_func_type response_func);
/**
* @brief Task of process command or txdata.
* @param custom_at_cmd_array: the array of at cmd that custom defined
* cmd_num : the num of at cmd that custom defined
* @retval None
*/
void at_cmd_array_regist(at_funcationType *custom_at_cmd_array,uint32 cmd_num);
/**
* @brief get digit form at cmd line.the maybe alter pSrc
* @param p_src: at cmd line string
* result:the buffer to be placed result
* err : err num
* @retval TRUE:
* FALSE:
*/
bool at_get_next_int_dec(char **p_src,int*result,int* err);
/**
* @brief get string form at cmd line.the maybe alter pSrc
* @param p_dest: the buffer to be placed result
* p_src: at cmd line string
* max_len :max len of string excepted to get
* @retval None
*/
int32 at_data_str_copy(char *p_dest, char **p_src, int32 max_len);

/**
* @brief initialize at module
* @param None
* @retval None
*/
void at_init(void);
/**
* @brief print string to at port
* @param string
* @retval None
*/
void at_port_print(const char *str);
/**
* @brief print custom information when AT+GMR
* @param string
* @retval None
*/
void at_set_custom_info(char* info);
/**
* @brief if current at command is processing,you can call at_enter_special_state,
* then if other comamnd coming,it will return busy.
* @param None
* @retval None
*/
void at_enter_special_state(void);
/**
* @brief
* @param None
* @retval None
*/
void at_leave_special_state(void);
/**
* @brief get at version
* @param None
* @retval at version
* bit24~31: at main version
* bit23~16: at sub version
* bit15~8 : at test version
* bit7~0 : customized version
*/
uint32 at_get_version(void);

/**
* @brief register custom uart rx interrupt function
* @param rx_func: custom uart rx interrupt function.
* If rx_func is non-void,when rx interrupt comming,it will call rx_func(data,len),
* data is the buffer of data,len is the length of data.Otherwise,it will run AT rx function.
* @retval None
*/
void at_register_uart_rx_intr(at_custom_uart_rx_intr rx_func);
#endif
Loading