Skip to content

Commit cdf7d37

Browse files
committed
Update IDF to f586f5e
1 parent db2e679 commit cdf7d37

File tree

159 files changed

+6219
-641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+6219
-641
lines changed

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
3535

3636
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
3737
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception
38-
compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lhal -lnewlib -ldriver -lbootloader_support -lpp -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lcxx -lxtensa-debug-module -lmdns -lvfs -lsoc -lcore -lsdmmc -lcoap -ltcpip_adapter -lc_nano -lrtc -lspi_flash -lwpa2 -lesp32 -lapp_update -lnghttp -lspiffs -lespnow -lnvs_flash -lesp_adc_cal -llog -lexpat -lm -lc -lheap -lmbedtls -llwip -lnet80211 -lpthread -ljson -lstdc++
38+
compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lhal -lnewlib -ldriver -lbootloader_support -lpp -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lcxx -lxtensa-debug-module -lmdns -lvfs -lsoc -lcore -lsdmmc -lcoap -ltcpip_adapter -lc_nano -lrtc -lspi_flash -lwpa2 -lesp32 -lapp_update -lnghttp -lspiffs -lespnow -lnvs_flash -lesp_adc_cal -llog -lexpat -lm -lc -lheap -lmbedtls -llwip -lnet80211 -lpthread -ljson -lstdc++
3939

4040
compiler.as.cmd=xtensa-esp32-elf-as
4141

tools/esptool.py

Lines changed: 290 additions & 177 deletions
Large diffs are not rendered by default.

tools/gen_esp32part.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@
2626
import re
2727
import struct
2828
import sys
29+
import hashlib
30+
import binascii
2931

3032
MAX_PARTITION_LENGTH = 0xC00 # 3K for partition data (96 entries) leaves 1K in a 4K sector for signature
33+
MD5_PARTITION_BEGIN = b"\xEB\xEB" + b"\xFF" * 14 # The first 2 bytes are like magic numbers for MD5 sum
3134

3235
__version__ = '1.0'
3336

3437
quiet = False
38+
md5sum = True
3539

3640
def status(msg):
3741
""" Print status message to stderr """
@@ -112,18 +116,28 @@ def verify(self):
112116

113117
@classmethod
114118
def from_binary(cls, b):
119+
md5 = hashlib.md5();
115120
result = cls()
116121
for o in range(0,len(b),32):
117122
data = b[o:o+32]
118123
if len(data) != 32:
119124
raise InputError("Partition table length must be a multiple of 32 bytes")
120125
if data == b'\xFF'*32:
121126
return result # got end marker
127+
if md5sum and data[:2] == MD5_PARTITION_BEGIN[:2]: #check only the magic number part
128+
if data[16:] == md5.digest():
129+
continue # the next iteration will check for the end marker
130+
else:
131+
raise InputError("MD5 checksums don't match! (computed: 0x%s, parsed: 0x%s)" % (md5.hexdigest(), binascii.hexlify(data[16:])))
132+
else:
133+
md5.update(data)
122134
result.append(PartitionDefinition.from_binary(data))
123135
raise InputError("Partition table is missing an end-of-table marker")
124136

125137
def to_binary(self):
126138
result = b"".join(e.to_binary() for e in self)
139+
if md5sum:
140+
result += MD5_PARTITION_BEGIN + hashlib.md5(result).digest()
127141
if len(result )>= MAX_PARTITION_LENGTH:
128142
raise InputError("Binary partition table length (%d) longer than max" % len(result))
129143
result += b"\xFF" * (MAX_PARTITION_LENGTH - len(result)) # pad the sector, for signing
@@ -333,8 +347,10 @@ def parse_int(v, keywords={}):
333347

334348
def main():
335349
global quiet
350+
global md5sum
336351
parser = argparse.ArgumentParser(description='ESP32 partition table utility')
337352

353+
parser.add_argument('--disable-md5sum', help='Disable md5 checksum for the partition table', default=False, action='store_true')
338354
parser.add_argument('--verify', '-v', help='Verify partition table fields', default=True, action='store_false')
339355
parser.add_argument('--quiet', '-q', help="Don't print status messages to stderr", action='store_true')
340356

@@ -346,6 +362,7 @@ def main():
346362
args = parser.parse_args()
347363

348364
quiet = args.quiet
365+
md5sum = not args.disable_md5sum
349366
input = args.input.read()
350367
input_is_binary = input[0:2] == PartitionDefinition.MAGIC_BYTES
351368
if input_is_binary:

tools/platformio-build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
join(FRAMEWORK_DIR, "tools", "sdk", "ld")
9999
],
100100
LIBS=[
101-
"gcc", "openssl", "btdm_app", "fatfs", "wps", "coexist", "wear_levelling", "hal", "newlib", "driver", "bootloader_support", "pp", "smartconfig", "jsmn", "wpa", "ethernet", "phy", "app_trace", "console", "ulp", "wpa_supplicant", "freertos", "bt", "micro-ecc", "cxx", "xtensa-debug-module", "mdns", "vfs", "soc", "core", "sdmmc", "coap", "tcpip_adapter", "c_nano", "rtc", "spi_flash", "wpa2", "esp32", "app_update", "nghttp", "spiffs", "espnow", "nvs_flash", "esp_adc_cal", "log", "expat", "m", "c", "heap", "mbedtls", "lwip", "net80211", "pthread", "json", "stdc++"
101+
"gcc", "openssl", "btdm_app", "fatfs", "wps", "coexist", "wear_levelling", "hal", "newlib", "driver", "bootloader_support", "pp", "mesh", "smartconfig", "jsmn", "wpa", "ethernet", "phy", "app_trace", "console", "ulp", "wpa_supplicant", "freertos", "bt", "micro-ecc", "cxx", "xtensa-debug-module", "mdns", "vfs", "soc", "core", "sdmmc", "coap", "tcpip_adapter", "c_nano", "rtc", "spi_flash", "wpa2", "esp32", "app_update", "nghttp", "spiffs", "espnow", "nvs_flash", "esp_adc_cal", "log", "expat", "m", "c", "heap", "mbedtls", "lwip", "net80211", "pthread", "json", "stdc++"
102102
],
103103

104104
UPLOADERFLAGS=[

tools/sdk/bin/bootloader_dio_40m.bin

176 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dio_80m.bin

-1.61 KB
Binary file not shown.

tools/sdk/bin/bootloader_dout_40m.bin

176 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dout_80m.bin

176 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qio_40m.bin

176 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qio_80m.bin

192 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qout_40m.bin

176 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qout_80m.bin

192 Bytes
Binary file not shown.

tools/sdk/include/bluedroid/a2d_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,5 +251,6 @@ extern UINT8 A2D_BitsSet(UINT8 num);
251251
**
252252
*******************************************************************************/
253253
extern void A2D_Init(void);
254+
extern void A2D_Deinit(void);
254255
#endif ///A2D_INCLUDED
255256
#endif /* A2D_API_H */

tools/sdk/include/bluedroid/allocator.h

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <stddef.h>
2323
#include <stdlib.h>
24+
#include "esp_heap_caps.h"
2425
#include "sdkconfig.h"
2526

2627
typedef void *(*alloc_fn)(size_t size);
@@ -48,24 +49,78 @@ void osi_mem_dbg_record(void *p, int size, const char *func, int line);
4849
void osi_mem_dbg_clean(void *p, const char *func, int line);
4950
void osi_mem_dbg_show(void);
5051

52+
#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
5153
#define osi_malloc(size) \
5254
({ \
5355
void *p; \
54-
\
55-
p = malloc((size)); \
56+
p = heap_caps_malloc_prefer(size, 2, \
57+
MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, \
58+
MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
5659
osi_mem_dbg_record(p, size, __func__, __LINE__); \
5760
(void *)p; \
5861
})
5962

6063
#define osi_calloc(size) \
6164
({ \
6265
void *p; \
63-
\
66+
p = heap_caps_calloc_prefer(1, size, 2, \
67+
MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, \
68+
MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
69+
osi_mem_dbg_record(p, size, __func__, __LINE__); \
70+
(void *)p; \
71+
})
72+
73+
#else
74+
75+
#define osi_malloc(size) \
76+
({ \
77+
void *p; \
78+
p = malloc((size)); \
79+
osi_mem_dbg_record(p, size, __func__, __LINE__); \
80+
(void *)p; \
81+
})
82+
83+
#define osi_calloc(size) \
84+
({ \
85+
void *p; \
6486
p = calloc(1, (size)); \
6587
osi_mem_dbg_record(p, size, __func__, __LINE__); \
6688
(void *)p; \
6789
})
6890

91+
#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
92+
93+
94+
#if 0
95+
#define osi_malloc(size) \
96+
do { \
97+
void *p; \
98+
\
99+
#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST \
100+
p = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
101+
#else \
102+
p = malloc((size)); \
103+
#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ \
104+
osi_mem_dbg_record(p, size, __func__, __LINE__); \
105+
(void *)p; \
106+
}while(0)
107+
108+
#define osi_calloc(size) \
109+
do { \
110+
void *p; \
111+
\
112+
#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST \
113+
p = heap_caps_calloc_prefer(1, size, 2, \
114+
MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, \
115+
MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
116+
#else \
117+
p = calloc(1, (size)); \
118+
#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ \
119+
osi_mem_dbg_record(p, size, __func__, __LINE__); \
120+
(void *)p; \
121+
} while(0)
122+
#endif
123+
69124
#define osi_free(ptr) \
70125
do { \
71126
void *tmp_point = (void *)(ptr); \
@@ -75,10 +130,24 @@ do { \
75130

76131
#else
77132

133+
#if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
134+
#define osi_malloc(size) heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
135+
#define osi_calloc(size) heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
136+
#else
78137
#define osi_malloc(size) malloc((size))
79138
#define osi_calloc(size) calloc(1, (size))
139+
#endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */
80140
#define osi_free(p) free((p))
81141

82142
#endif /* CONFIG_BLUEDROID_MEM_DEBUG */
83143

144+
#define FREE_AND_RESET(a) \
145+
do { \
146+
if (a) { \
147+
osi_free(a); \
148+
a = NULL; \
149+
} \
150+
}while (0)
151+
152+
84153
#endif /* _ALLOCATOR_H_ */

tools/sdk/include/bluedroid/avrc_api.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,19 @@ extern UINT8 AVRC_SetTraceLevel (UINT8 new_level);
554554
*******************************************************************************/
555555
extern void AVRC_Init(void);
556556

557+
/*******************************************************************************
558+
**
559+
** Function AVRC_Deinit
560+
**
561+
** Description This function is called at stack shotdown to free the
562+
** control block (if using dynamic memory), and deinitializes the
563+
** control block and tracing level.
564+
**
565+
** Returns void
566+
**
567+
*******************************************************************************/
568+
extern void AVRC_Deinit(void);
569+
557570
/*******************************************************************************
558571
**
559572
** Function AVRC_ParsCommand

tools/sdk/include/bluedroid/blufi_int.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define __BLUFI_INT_H__
1717

1818
#define BTC_BLUFI_GREAT_VER 0x01 //Version + Subversion
19-
#define BTC_BLUFI_SUB_VER 0x01 //Version + Subversion
19+
#define BTC_BLUFI_SUB_VER 0x02 //Version + Subversion
2020
#define BTC_BLUFI_VERSION ((BTC_BLUFI_GREAT_VER<<8)|BTC_BLUFI_SUB_VER) //Version + Subversion
2121

2222
/* service engine control block */
@@ -114,6 +114,8 @@ typedef struct blufi_frag_hdr blufi_frag_hdr_t;
114114
#define BLUFI_TYPE_DATA_SUBTYPE_WIFI_REP 0x0f
115115
#define BLUFI_TYPE_DATA_SUBTYPE_REPLY_VERSION 0x10
116116
#define BLUFI_TYPE_DATA_SUBTYPE_WIFI_LIST 0x11
117+
#define BLUFI_TYPE_DATA_SUBTYPE_ERROR_INFO 0x12
118+
#define BLUFI_TYPE_DATA_SUBTYPE_CUSTOM_DATA 0x13
117119
#define BLUFI_TYPE_IS_CTRL(type) (BLUFI_GET_TYPE((type)) == BLUFI_TYPE_CTRL)
118120
#define BLUFI_TYPE_IS_DATA(type) (BLUFI_GET_TYPE((type)) == BLUFI_TYPE_DATA)
119121

@@ -142,6 +144,7 @@ typedef struct blufi_frag_hdr blufi_frag_hdr_t;
142144
#define BLUFI_TYPE_IS_DATA_SERVER_CERT(type) (BLUFI_TYPE_IS_DATA((type)) && BLUFI_GET_SUBTYPE((type)) == BLUFI_TYPE_DATA_SUBTYPE_SERVER_CERT)
143145
#define BLUFI_TYPE_IS_DATA_CLIENT_PRIV_KEY(type) (BLUFI_TYPE_IS_DATA((type)) && BLUFI_GET_SUBTYPE((type)) == BLUFI_TYPE_DATA_SUBTYPE_CLIENT_PRIV_KEY)
144146
#define BLUFI_TYPE_IS_DATA_SERVER_PRIV_KEY(type) (BLUFI_TYPE_IS_DATA((type)) && BLUFI_GET_SUBTYPE((type)) == BLUFI_TYPE_DATA_SUBTYPE_SERVER_PRIV_KEY)
147+
#define BLUFI_TYPE_IS_DATA_ERROR_INFO(type) (BLUFI_TYPE_IS_DATA((type)) && BLUFI_GET_SUBTYPE((type)) == BLUFI_TYPE_DATA_SUBTYPE_ERROR_INFO)
145148

146149
// packet frame control
147150
#define BLUFI_FC_ENC_MASK 0x01

tools/sdk/include/bluedroid/bt_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ typedef struct {
499499
#define BLE_ADDR_RANDOM 0x01
500500
#define BLE_ADDR_PUBLIC_ID 0x02
501501
#define BLE_ADDR_RANDOM_ID 0x03
502+
#define BLE_ADDR_TYPE_MAX BLE_ADDR_RANDOM_ID
503+
#define BLE_ADDR_UNKNOWN_TYPE 0XFF
502504
typedef UINT8 tBLE_ADDR_TYPE;
503505
#define BLE_ADDR_TYPE_MASK (BLE_ADDR_RANDOM | BLE_ADDR_PUBLIC)
504506

tools/sdk/include/bluedroid/bta_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ typedef tBTM_ADD_WHITELIST_CBACK tBTA_ADD_WHITELIST_CBACK;
409409

410410
typedef tBTM_SET_PKT_DATA_LENGTH_CBACK tBTA_SET_PKT_DATA_LENGTH_CBACK;
411411

412+
typedef tBTM_SET_RAND_ADDR_CBACK tBTA_SET_RAND_ADDR_CBACK;
413+
412414
typedef tBTM_SET_LOCAL_PRIVACY_CBACK tBTA_SET_LOCAL_PRIVACY_CBACK;
413415

414416
typedef tBTM_CMPL_CB tBTA_CMPL_CB;
@@ -2060,7 +2062,7 @@ extern void BTA_DmBleScan(BOOLEAN start, UINT32 duration,
20602062

20612063
extern void BTA_DmBleStopAdvertising(void);
20622064

2063-
extern void BTA_DmSetRandAddress(BD_ADDR rand_addr);
2065+
extern void BTA_DmSetRandAddress(BD_ADDR rand_addr, tBTA_SET_RAND_ADDR_CBACK *p_set_rand_addr_cback);
20642066

20652067
#endif
20662068

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/******************************************************************************
2+
*
3+
* Copyright (C) 2008-2012 Broadcom Corporation
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at:
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
******************************************************************************/
18+
19+
/******************************************************************************
20+
*
21+
* This is the private interface file for the BTA audio/video registration
22+
* module.
23+
*
24+
******************************************************************************/
25+
#ifndef BTA_AR_INT_H
26+
#define BTA_AR_INT_H
27+
28+
#include "bta_av_api.h"
29+
30+
#if (BTA_AR_INCLUDED == TRUE)
31+
32+
#ifndef BTA_AR_DEBUG
33+
#define BTA_AR_DEBUG FALSE
34+
#endif
35+
36+
#define BTA_AR_AV_MASK 0x01
37+
#define BTA_AR_AVK_MASK 0x02
38+
39+
/* data associated with BTA_AR */
40+
typedef struct {
41+
tAVDT_CTRL_CBACK *p_av_conn_cback; /* av connection callback function */
42+
tAVDT_CTRL_CBACK *p_avk_conn_cback; /* avk connection callback function */
43+
UINT8 avdt_registered;
44+
UINT8 avct_registered;
45+
UINT32 sdp_tg_handle;
46+
UINT32 sdp_ct_handle;
47+
UINT16 ct_categories[2];
48+
UINT8 tg_registered;
49+
tBTA_AV_HNDL hndl; /* Handle associated with the stream that rejected the connection. */
50+
} tBTA_AR_CB;
51+
52+
/*****************************************************************************
53+
** Global data
54+
*****************************************************************************/
55+
56+
/* control block declaration */
57+
#if BTA_DYNAMIC_MEMORY == FALSE
58+
extern tBTA_AR_CB bta_ar_cb;
59+
#else
60+
extern tBTA_AR_CB *bta_ar_cb_ptr;
61+
#define bta_ar_cb (*bta_ar_cb_ptr)
62+
#endif
63+
64+
#endif ///BTA_AR_INCLUDED == TRUE
65+
66+
#endif /* BTA_AR_INT_H */

0 commit comments

Comments
 (0)