Skip to content

Commit a15b7e9

Browse files
authored
Update IDF to afe4c76 and BLE lib (#2130)
* Update BLE * Update IDF to afe4c76 * Update CMakeLists.txt * Update BLE to fix compilation issues * Update BLE
1 parent ce340fa commit a15b7e9

Some content is hidden

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

79 files changed

+551
-12
lines changed

Diff for: CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ set(BLE_SRCS
150150
libraries/BLE/src/BLEDescriptor.cpp
151151
libraries/BLE/src/BLEDescriptorMap.cpp
152152
libraries/BLE/src/BLEDevice.cpp
153+
libraries/BLE/src/BLEEddystoneTLM.cpp
154+
libraries/BLE/src/BLEEddystoneURL.cpp
153155
libraries/BLE/src/BLEExceptions.cpp
154156
libraries/BLE/src/BLEHIDDevice.cpp
155157
libraries/BLE/src/BLERemoteCharacteristic.cpp

Diff for: libraries/BLE

Submodule BLE updated 59 files

Diff for: tools/gen_esp32part.py

+11
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import sys
3030
import hashlib
3131
import binascii
32+
import errno
3233

3334
MAX_PARTITION_LENGTH = 0xC00 # 3K for partition data (96 entries) leaves 1K in a 4K sector for signature
3435
MD5_PARTITION_BEGIN = b"\xEB\xEB" + b"\xFF" * 14 # The first 2 bytes are like magic numbers for MD5 sum
@@ -480,6 +481,16 @@ def main():
480481
raise InputError("Partitions defined in '%s' occupy %.1fMB of flash (%d bytes) which does not fit in configured flash size %dMB. Change the flash size in menuconfig under the 'Serial Flasher Config' menu." %
481482
(args.input.name, table_size / 1024.0 / 1024.0, table_size, size_mb))
482483

484+
# Make sure that the output directory is created
485+
output_dir = os.path.abspath(os.path.dirname(args.output))
486+
487+
if not os.path.exists(output_dir):
488+
try:
489+
os.makedirs(output_dir)
490+
except OSError as exc:
491+
if exc.errno != errno.EEXIST:
492+
raise
493+
483494
if input_is_binary:
484495
output = table.to_csv()
485496
with sys.stdout if args.output == '-' else open(args.output, 'w') as f:

Diff for: tools/sdk/bin/bootloader_dio_80m.bin

1.47 KB
Binary file not shown.

Diff for: tools/sdk/bin/bootloader_qout_40m.bin

0 Bytes
Binary file not shown.

Diff for: tools/sdk/include/config/sdkconfig.h

+6
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
#define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR 1
121121
#define CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER 1
122122
#define CONFIG_MB_SERIAL_TASK_STACK_SIZE 2048
123+
#define CONFIG_MBEDTLS_PSK_MODES 1
123124
#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1
124125
#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60
125126
#define CONFIG_SPIFFS_USE_MAGIC 1
@@ -164,9 +165,11 @@
164165
#define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1
165166
#define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1
166167
#define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1
168+
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK 1
167169
#define CONFIG_SW_COEXIST_PREFERENCE_WIFI 1
168170
#define CONFIG_DMA_RX_BUF_NUM 10
169171
#define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1
172+
#define CONFIG_MBEDTLS_KEY_EXCHANGE_PSK 1
170173
#define CONFIG_TCP_SYNMAXRTX 6
171174
#define CONFIG_MB_UART_RTS 32
172175
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA 1
@@ -199,6 +202,7 @@
199202
#define CONFIG_SW_COEXIST_PREFERENCE_VALUE 0
200203
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1
201204
#define CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER 1
205+
#define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK 1
202206
#define CONFIG_PPP_SUPPORT 1
203207
#define CONFIG_SPIRAM_SPEED_40M 1
204208
#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2048
@@ -278,6 +282,7 @@
278282
#define CONFIG_MBEDTLS_HAVE_TIME 1
279283
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1
280284
#define CONFIG_TCP_QUEUE_OOSEQ 1
285+
#define CONFIG_FATFS_ALLOC_PREFER_EXTRAM 1
281286
#define CONFIG_GATTS_ENABLE 1
282287
#define CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE 0
283288
#define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1
@@ -287,6 +292,7 @@
287292
#define CONFIG_SUPPORT_TERMIOS 1
288293
#define CONFIG_CLASSIC_BT_ENABLED 1
289294
#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1
295+
#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK 1
290296
#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1
291297
#define CONFIG_IDF_TARGET "esp32"
292298
#define CONFIG_WL_SECTOR_SIZE_4096 1

Diff for: tools/sdk/include/driver/driver/i2s.h

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ typedef struct {
139139
int dma_buf_count; /*!< I2S DMA Buffer Count */
140140
int dma_buf_len; /*!< I2S DMA Buffer Length */
141141
bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */
142+
bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */
142143
int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value.*/
143144
} i2s_config_t;
144145

Diff for: tools/sdk/include/driver/driver/rmt.h

+27
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ typedef enum {
8080
RMT_CARRIER_LEVEL_MAX
8181
} rmt_carrier_level_t;
8282

83+
typedef enum {
84+
RMT_CHANNEL_UNINIT = 0, /*!< RMT channel uninitialized */
85+
RMT_CHANNEL_IDLE = 1, /*!< RMT channel status idle */
86+
RMT_CHANNEL_BUSY = 2, /*!< RMT channel status busy */
87+
} rmt_channel_status_t;
88+
89+
/**
90+
* @brief Data struct of RMT channel status
91+
*/
92+
typedef struct {
93+
rmt_channel_status_t status[RMT_CHANNEL_MAX]; /*!< Store the current status of each channel */
94+
} rmt_channel_status_result_t;
95+
8396
/**
8497
* @brief Data struct of RMT TX configure parameters
8598
*/
@@ -496,6 +509,7 @@ esp_err_t rmt_set_idle_level(rmt_channel_t channel, bool idle_out_en, rmt_idle_l
496509
* @param channel RMT channel (0-7)
497510
*
498511
* @param status Pointer to accept channel status.
512+
* Please refer to RMT_CHnSTATUS_REG(n=0~7) in `rmt_reg.h` for more details of each field.
499513
*
500514
* @return
501515
* - ESP_ERR_INVALID_ARG Parameter error
@@ -679,6 +693,19 @@ esp_err_t rmt_driver_install(rmt_channel_t channel, size_t rx_buf_size, int intr
679693
*/
680694
esp_err_t rmt_driver_uninstall(rmt_channel_t channel);
681695

696+
/**
697+
* @brief Get the current status of eight channels.
698+
*
699+
* @note Do not call this function if it is possible that `rmt_driver_uninstall` will be called at the same time.
700+
*
701+
* @param[out] channel_status store the current status of each channel
702+
*
703+
* @return
704+
* - ESP_ERR_INVALID_ARG Parameter is NULL
705+
* - ESP_OK Success
706+
*/
707+
esp_err_t rmt_get_channel_status(rmt_channel_status_result_t *channel_status);
708+
682709
/**
683710
* @brief RMT send waveform from rmt_item array.
684711
*

Diff for: tools/sdk/include/driver/driver/uart.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag);
801801
* light sleep. This function allows setting the threshold value.
802802
*
803803
* Stop bit and parity bits (if enabled) also contribute to the number of edges.
804-
* For example, letter 'a' with ASCII code 97 is encoded as 010001101 on the wire
804+
* For example, letter 'a' with ASCII code 97 is encoded as 0100001101 on the wire
805805
* (with 8n1 configuration), start and stop bits included. This sequence has 3
806806
* positive edges (transitions from 0 to 1). Therefore, to wake up the system
807807
* when 'a' is sent, set wakeup_threshold=3.
@@ -813,7 +813,10 @@ esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag);
813813
* correct baud rate all the time, select REF_TICK as UART clock source,
814814
* by setting use_ref_tick field in uart_config_t to true.
815815
*
816-
* @note in ESP32, UART2 does not support light sleep wakeup feature.
816+
* @note in ESP32, the wakeup signal can only be input via IO_MUX (i.e.
817+
* GPIO3 should be configured as function_1 to wake up UART0,
818+
* GPIO9 should be configured as function_5 to wake up UART1), UART2
819+
* does not support light sleep wakeup feature.
817820
*
818821
* @param uart_num UART number
819822
* @param wakeup_threshold number of RX edges for light sleep wakeup, value is 3 .. 0x3ff.

Diff for: tools/sdk/include/esp32/esp_mesh.h

+49-4
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ typedef enum {
187187
this event, and add the corresponding scan done handler in this event. */
188188
MESH_EVENT_NETWORK_STATE, /**< network state, such as whether current mesh network has a root. */
189189
MESH_EVENT_STOP_RECONNECTION, /**< the root stops reconnecting to the router and non-root devices stop reconnecting to their parents. */
190+
MESH_EVENT_FIND_NETWORK, /**< when the channel field in mesh configuration is set to zero, mesh stack will perform a
191+
full channel scan to find a mesh network that can join, and return the channel value
192+
after finding it. */
193+
MESH_EVENT_ROUTER_SWITCH, /**< if users specify BSSID of the router in mesh configuration, when the root connects to another
194+
router with the same SSID, this event will be posted and the new router information is attached. */
190195
MESH_EVENT_MAX,
191196
} mesh_event_id_t;
192197

@@ -310,6 +315,14 @@ typedef struct {
310315
mesh_addr_t rc_addr; /**< root address specified by users via API esp_mesh_waive_root() */
311316
} mesh_event_vote_started_t;
312317

318+
/**
319+
* @brief find a mesh network that this device can join
320+
*/
321+
typedef struct {
322+
uint8_t channel; /**< channel number of the new found network */
323+
uint8_t router_bssid[6]; /**< router BSSID */
324+
} mesh_event_find_network_t;
325+
313326
/**
314327
* @brief IP settings from LwIP stack
315328
*/
@@ -381,6 +394,11 @@ typedef struct {
381394
bool is_rootless; /**< whether current mesh network has a root */
382395
} mesh_event_network_state_t;
383396

397+
/**
398+
* @brief New router information
399+
*/
400+
typedef system_event_sta_connected_t mesh_event_router_switch_t;
401+
384402
/**
385403
* @brief Mesh event information
386404
*/
@@ -405,6 +423,8 @@ typedef union {
405423
mesh_event_root_fixed_t root_fixed; /**< fixed root */
406424
mesh_event_scan_done_t scan_done; /**< scan done */
407425
mesh_event_network_state_t network_state; /**< network state, such as whether current mesh network has a root. */
426+
mesh_event_find_network_t find_network; /**< network found that can join */
427+
mesh_event_router_switch_t router_switch; /**< new router information */
408428
} mesh_event_info_t;
409429

410430
/**
@@ -445,10 +465,16 @@ typedef struct {
445465
* @brief Router configuration
446466
*/
447467
typedef struct {
448-
uint8_t ssid[32]; /**< SSID */
449-
uint8_t ssid_len; /**< length of SSID */
450-
uint8_t bssid[6]; /**< BSSID, if router is hidden, this value is mandatory */
451-
uint8_t password[64]; /**< password */
468+
uint8_t ssid[32]; /**< SSID */
469+
uint8_t ssid_len; /**< length of SSID */
470+
uint8_t bssid[6]; /**< BSSID, if this value is specified, users should also specify "allow_router_switch". */
471+
uint8_t password[64]; /**< password */
472+
bool allow_router_switch; /**< if the BSSID is specified and this value is also set, when the router of this specified BSSID
473+
fails to be found after "fail" (mesh_attempts_t) times, the whole network is allowed to switch
474+
to another router with the same SSID. The new router might also be on a different channel.
475+
The default value is false.
476+
There is a risk that if the password is different between the new switched router and the previous
477+
one, the mesh network could be established but the root will never connect to the new switched router. */
452478
} mesh_router_t;
453479

454480
/**
@@ -464,6 +490,8 @@ typedef struct {
464490
*/
465491
typedef struct {
466492
uint8_t channel; /**< channel, the mesh network on */
493+
bool allow_channel_switch; /**< if this value is set, when "fail" (mesh_attempts_t) times is reached, device will change to
494+
a full channel scan for a network that could join. The default value is false. */
467495
mesh_event_cb_t event_cb; /**< mesh event callback */
468496
mesh_addr_t mesh_id; /**< mesh network identification */
469497
mesh_router_t router; /**< router configuration */
@@ -1412,6 +1440,23 @@ esp_err_t esp_mesh_disconnect(void);
14121440
*/
14131441
esp_err_t esp_mesh_connect(void);
14141442

1443+
/**
1444+
* @brief Cause the root device to add Channel Switch Announcement Element (CSA IE) to beacon
1445+
* - Set the new channel
1446+
* - Set how many beacons with CSA IE will be sent before changing a new channel
1447+
* - Enable the channel switch function
1448+
*
1449+
* @attention This API is only called by the root.
1450+
*
1451+
* @param[in] new_bssid the new router BSSID if the router changes
1452+
* @param[in] csa_newchan the new channel number to which the whole network is moving
1453+
* @param[in] csa_count channel switch period(beacon count), unit is based on beacon interval of its softAP, the default value is 15.
1454+
*
1455+
* @return
1456+
* - ESP_OK
1457+
*/
1458+
esp_err_t esp_mesh_switch_channel(const uint8_t *new_bssid, int csa_newchan, int csa_count);
1459+
14151460
#ifdef __cplusplus
14161461
}
14171462
#endif

Diff for: tools/sdk/include/fatfs/ffconf.h

+7
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,11 @@
301301
#include "freertos/FreeRTOS.h"
302302
#include "freertos/semphr.h"
303303

304+
/* Some memory allocation functions are declared here in addition to ff.h, so that
305+
they can be used also by external code when LFN feature is disabled.
306+
*/
307+
void* ff_memalloc (UINT msize);
308+
void* ff_memcalloc (UINT num, UINT size);
309+
310+
304311
/*--- End of configuration options ---*/

Diff for: tools/sdk/include/idf_test/idf_performance.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING_NO_DMA 15
1313
/* Due to code size & linker layout differences interacting with cache, VFS
1414
microbenchmark currently runs slower with PSRAM enabled. */
15-
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 50000
16-
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 40000
15+
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 20000
16+
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 25000
1717
// throughput performance by iperf
1818
#define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 50
1919
#define IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT 40

0 commit comments

Comments
 (0)