Skip to content

Commit 2b941f5

Browse files
committed
Merge pull request #1239 from esp8266/sdk-1.5
Update to SDK 1.5 (#1102)
2 parents fa485cd + 5b012b2 commit 2b941f5

30 files changed

+868
-23
lines changed

cores/esp8266/core_esp8266_main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern "C" {
3131
#include "user_interface.h"
3232
#include "cont.h"
3333
}
34-
#define LOOP_TASK_PRIORITY 0
34+
#define LOOP_TASK_PRIORITY 1
3535
#define LOOP_QUEUE_SIZE 1
3636

3737
#define OPTIMISTIC_YIELD_TIME_US 16000
@@ -73,7 +73,7 @@ extern "C" void esp_yield() {
7373
}
7474

7575
extern "C" void esp_schedule() {
76-
system_os_post(LOOP_TASK_PRIORITY, 0, 0);
76+
ets_post(LOOP_TASK_PRIORITY, 0, 0);
7777
}
7878

7979
extern "C" void __yield() {
@@ -144,7 +144,7 @@ extern "C" void user_init(void) {
144144

145145
cont_init(&g_cont);
146146

147-
system_os_task(loop_task,
147+
ets_task(loop_task,
148148
LOOP_TASK_PRIORITY, g_loop_queue,
149149
LOOP_QUEUE_SIZE);
150150

cores/esp8266/core_esp8266_phy.c

+7
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ static uint8_t phy_init_data[128] =
231231
// force_freq_offset
232232
// signed, unit is 8kHz
233233
[113] = 0,
234+
235+
// rf_cal_use_flash
236+
// 0: RF init no RF CAL, using all RF CAL data in flash, it takes about 2ms for RF init
237+
// 1: RF init only do TX power control CAL, others using RF CAL data in flash , it takes about 20ms for RF init
238+
// 2: RF init no RF CAL, using all RF CAL data in flash, it takes about 2ms for RF init (same as 0?!)
239+
// 3: RF init do all RF CAL, it takes about 200ms for RF init
240+
[114] = 2
234241
};
235242

236243
extern int __real_register_chipv6_phy(uint8_t* init_data);

libraries/ESP8266WiFi/src/lwip/mem.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ typedef size_t mem_size_t;
5151
* allow these defines to be overridden.
5252
*/
5353
#ifndef mem_free
54-
#define mem_free vPortFree
54+
#define mem_free(p) vPortFree(p, "", 0)
5555
#endif
5656
#ifndef mem_malloc
57-
#define mem_malloc pvPortMalloc
57+
#define mem_malloc(s) pvPortMalloc(s, "", 0)
5858
#endif
5959
#ifndef mem_calloc
60-
#define mem_calloc pvPortCalloc
60+
#define mem_calloc(s) pvPortCalloc(s, "", 0)
6161
#endif
6262
#ifndef mem_realloc
63-
#define mem_realloc pvPortRealloc
63+
#define mem_realloc(p, s) pvPortRealloc(p, s, "", 0)
6464
#endif
6565
#ifndef mem_zalloc
66-
#define mem_zalloc pvPortZalloc
66+
#define mem_zalloc(s) pvPortZalloc(s, "", 0)
6767
#endif
6868

6969
#ifndef os_malloc

platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ compiler.S.flags=-c -g -x assembler-with-cpp -MMD
2424
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
2525

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

2929
compiler.cpp.cmd=xtensa-lx106-elf-g++
3030
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

tools/sdk/changelog.txt

+80
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,83 @@
1+
esp_iot_sdk_v1.4.0_15_09_18 Release Note
2+
----------------------------------------
3+
Resolved Issues(Bugs below are eligible for Bug Bounty Program):
4+
1.Espconn may fail to download big chunk of data(FOTA).
5+
2.Invalid TCP data sent issue.
6+
3.Fatal exceptions occur when change WiFi mode in WiFi scan callback.
7+
4.WiFi compatibility problem of special network card.
8+
5.Deep sleep may appear high current under certain circumstances.
9+
10+
Optimization:
11+
1. Add a new method to check memory leaks (API : system_show_malloc).
12+
2. Add print information when exception happens.
13+
3. Resolve the problem of os_timer_disarm.
14+
4. Optimize DHCP server, add API to set up the lease time of DHCP server. More details are in the “Added APIs”.
15+
5. Add event “EVENT_STAMODE_DHCP_TIMEOUT” for the DHCP timeout handling mechanism.
16+
6. Optimize handling of the reception of data and ZWP message.
17+
7. Add new APIs to support SSL bidirectional authentication. More details are in the “Added APIs”.
18+
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”.
19+
9. Optimize the process of FOTA (firmware upgrade through WiFi.
20+
10. Optimize mDNS, and resolve the problem that in certain case the ESP8266 softAP can not work in the sta+AP mode.
21+
11. Release mesh as a lib in the esp_iot_sdk, and do not provide SDK of the mesh version any more.
22+
12. Optimize mesh’s handling of UDP packets.
23+
13. Optimize checking of the validity of the mesh API’s parameters.
24+
14. Add an API to set up the largest hop of mesh. For detailed information, go to mesh instructions.
25+
15. Optimize the process of powering up and booting to shorten booting time by 20 ms.
26+
16. Optimize the function of automatic frequency offset calibration.
27+
17. Optimize the function of sniffer.
28+
18. Strengthen reliability of the checking of beacon timeout.
29+
19.Optimize Wi-Fi event mechanism, and add event “ EVENT_SOFTAPMODE_PROBEREQRECVED”, and reason for a failed connection.
30+
20. Optimize Wi-Fi callback function and strengthen reliability of the software.
31+
21. Add the function of data transferring between stations in the soft-AP mode.
32+
22. Update SmartConfig to the version of 2.5.1.
33+
34+
23.Update esp_init_data_default.bin. Please use the newest esp_init_data_default.bin when burning.
35+
36+
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.
37+
38+
39+
Added APIs:
40+
1.System API
41+
system_show_malloc : for checking memory leak, to print the memory usage.
42+
2.DHCP server lease time related APIs
43+
wifi_softap_set_dhcps_lease_time:set ESP8266 softAP DHCP server lease time.
44+
wifi_softap_get_dhcps_lease_time:check ESP8266 softAP DHCP server lease time.
45+
wifi_softap_reset_dhcps_lease_time:reset ESP8266 softAP DHCP server lease time which is 120 minutes by default.
46+
3.wifi_station_dhcpc_set_maxtry:set the maximum number that ESP8266 station DHCP client will try to reconnect to the AP.
47+
4.Force sleep APIs
48+
wifi_fpm_open:enable force sleep function.
49+
wifi_fpm_close:disable force sleep function.
50+
wifi_fpm_do_sleep:force ESP8266 enter sleep mode.
51+
wifi_fpm_do_wakeup:wake ESP8266 up from force sleep.
52+
wifi_fpm_set_sleep_type:set sleep type of force sleep function.
53+
wifi_fpm_get_sleep_type:get sleep type of force sleep function.
54+
5.Send packet freedom APIs (to send user-define 802.11 packets)
55+
wifi_register_send_pkt_freedom_cb:register a callback for sending user-define 802.11 packets.
56+
wifi_unregister_send_pkt_freedom_cb:unregister the callback for sending user-define 802.11 packets.
57+
wifi_send_pkt_freedom:send user-define 802.11 packet.
58+
6.RFID LOCP APIs
59+
wifi_rfid_locp_recv_open:enable RFID LOCP to receive WDS packets.
60+
wifi_rfid_locp_recv_close:disable RFID LOCP.
61+
wifi_register_rfid_locp_recv_cb:register a callback of receiving WDS packets.
62+
wifi_unregister_rfid_locp_recv_cb:unregister the callback of receiving WDS packets.
63+
7.Rate Control APIs
64+
wifi_set_user_fixed_rate:set the fixed rate and mask of sending data from ESP8266
65+
wifi_get_user_fixed_rate:check the fixed rate and mask of ESP8266
66+
wifi_set_user_sup_rate:set the rate range supported by ESP8266 to limit the rate of sending packets from other devices.
67+
wifi_set_user_rate_limit:limit the rate of sending data from ESP8266.
68+
wifi_set_user_limit_rate_mask:set the interfaces of ESP8266 whose rate of sending packets is limited by wifi_set_user_rate_limit.
69+
wifi_get_user_limit_rate_mask:get the interfaces of ESP8266 whose rate of sending packets is limited by wifi_set_user_rate_limit.
70+
8.Espconn APIs
71+
espconn_sendto:send UDP data.
72+
espconn_secure_cert_req_enable:enable certificates verification function when ESP8266 runs as SSL client.
73+
espconn_secure_cert_req_disable:disable certificates verification function when ESP8266 runs as SSL client.
74+
espconn_secure_set_default_certificate:set the certificate when ESP8266 runs as SSL server.
75+
espconn_secure_set_default_private_key:set the encryption key when ESP8266 runs as SSL server.
76+
9.SmartConfig API
77+
smartconfig_set_type: set the protocol type of SmartConfig.
78+
79+
80+
181
esp_iot_sdk_v1.3.0_15_08_10_p1 Release Note
282
----------------------------------------
383

tools/sdk/include/at_custom.h

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
2+
/*
3+
* custom_at.h
4+
*
5+
* This file is part of Espressif's AT+ command set program.
6+
* Copyright (C) 2013 - 2016, Espressif Systems
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of version 3 of the GNU General Public License as
10+
* published by the Free Software Foundation.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License along
18+
* with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
#ifndef CUSTOM_AT_H_
22+
#define CUSTOM_AT_H_
23+
24+
#include "c_types.h"
25+
26+
typedef struct
27+
{
28+
char *at_cmdName;
29+
int8_t at_cmdLen;
30+
void (*at_testCmd)(uint8_t id);
31+
void (*at_queryCmd)(uint8_t id);
32+
void (*at_setupCmd)(uint8_t id, char *pPara);
33+
void (*at_exeCmd)(uint8_t id);
34+
}at_funcationType;
35+
36+
typedef void (*at_custom_uart_rx_intr)(uint8* data,int32 len);
37+
38+
typedef void (*at_custom_response_func_type)(const char *str);
39+
40+
extern uint8 at_customLinkMax;
41+
42+
/**
43+
* @brief Response "OK" to uart.
44+
* @param None
45+
* @retval None
46+
*/
47+
void at_response_ok(void);
48+
/**
49+
* @brief Response "ERROR" to uart.
50+
* @param None
51+
* @retval None
52+
*/
53+
void at_response_error(void);
54+
/**
55+
* @brief Response string.
56+
* It is equivalent to at_port_print,if not call at_register_response_func or call at_register_response_func(NULL);
57+
* It will run custom response function,if call at_register_response_func and parameter is not NULL.
58+
* @param string
59+
* @retval None
60+
*/
61+
void at_response(const char *str);
62+
/**
63+
* @brief register custom response function.
64+
* @param response_func: the function that will run when call at_response
65+
* @retval None
66+
*/
67+
void at_register_response_func(at_custom_response_func_type response_func);
68+
/**
69+
* @brief Task of process command or txdata.
70+
* @param custom_at_cmd_array: the array of at cmd that custom defined
71+
* cmd_num : the num of at cmd that custom defined
72+
* @retval None
73+
*/
74+
void at_cmd_array_regist(at_funcationType *custom_at_cmd_array,uint32 cmd_num);
75+
/**
76+
* @brief get digit form at cmd line.the maybe alter pSrc
77+
* @param p_src: at cmd line string
78+
* result:the buffer to be placed result
79+
* err : err num
80+
* @retval TRUE:
81+
* FALSE:
82+
*/
83+
bool at_get_next_int_dec(char **p_src,int*result,int* err);
84+
/**
85+
* @brief get string form at cmd line.the maybe alter pSrc
86+
* @param p_dest: the buffer to be placed result
87+
* p_src: at cmd line string
88+
* max_len :max len of string excepted to get
89+
* @retval None
90+
*/
91+
int32 at_data_str_copy(char *p_dest, char **p_src, int32 max_len);
92+
93+
/**
94+
* @brief initialize at module
95+
* @param None
96+
* @retval None
97+
*/
98+
void at_init(void);
99+
/**
100+
* @brief print string to at port
101+
* @param string
102+
* @retval None
103+
*/
104+
void at_port_print(const char *str);
105+
/**
106+
* @brief print custom information when AT+GMR
107+
* @param string
108+
* @retval None
109+
*/
110+
void at_set_custom_info(char* info);
111+
/**
112+
* @brief if current at command is processing,you can call at_enter_special_state,
113+
* then if other comamnd coming,it will return busy.
114+
* @param None
115+
* @retval None
116+
*/
117+
void at_enter_special_state(void);
118+
/**
119+
* @brief
120+
* @param None
121+
* @retval None
122+
*/
123+
void at_leave_special_state(void);
124+
/**
125+
* @brief get at version
126+
* @param None
127+
* @retval at version
128+
* bit24~31: at main version
129+
* bit23~16: at sub version
130+
* bit15~8 : at test version
131+
* bit7~0 : customized version
132+
*/
133+
uint32 at_get_version(void);
134+
135+
/**
136+
* @brief register custom uart rx interrupt function
137+
* @param rx_func: custom uart rx interrupt function.
138+
* If rx_func is non-void,when rx interrupt comming,it will call rx_func(data,len),
139+
* data is the buffer of data,len is the length of data.Otherwise,it will run AT rx function.
140+
* @retval None
141+
*/
142+
void at_register_uart_rx_intr(at_custom_uart_rx_intr rx_func);
143+
#endif

0 commit comments

Comments
 (0)